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

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

%struct.SM2_KEY = type { %struct.SM2_Z256_POINT, [4 x i64] }
%struct.SM2_Z256_POINT = type { [4 x i64], [4 x i64], [4 x i64] }
%struct.SM2_SIGN_CTX = type { %struct.SM3_CTX, %struct.SM3_CTX, %struct.SM2_KEY, [4 x i64], [32 x %struct.SM2_SIGN_PRE_COMP], i32, [16 x %struct.SM2_Z256_POINT] }
%struct.SM3_CTX = type { [8 x i32], i64, [64 x i8], i64 }
%struct.SM2_SIGN_PRE_COMP = type { [4 x i64], [4 x i64] }
%struct.TLS_CLIENT_VERIFY_CTX = type { i32, [8 x ptr], [8 x i64] }
%struct.TLS_CONNECT = type { i32, i32, [64 x i32], i64, i32, [18437 x i8], i64, [18437 x i8], [18437 x i8], ptr, i64, i32, [32 x i8], i64, [2048 x i8], i64, [2048 x i8], i64, [2048 x i8], i64, %struct.SM2_KEY, %struct.SM2_KEY, i32, [48 x i8], [96 x i8], %struct.SM3_HMAC_CTX, %struct.SM3_HMAC_CTX, %struct.SM4_KEY, %struct.SM4_KEY, [8 x i8], [8 x i8], [12 x i8], [12 x i8], %struct.BLOCK_CIPHER_KEY, %struct.BLOCK_CIPHER_KEY, i32 }
%struct.SM3_HMAC_CTX = type { %struct.SM3_CTX, [64 x i8] }
%struct.SM4_KEY = type { [32 x i32] }
%struct.BLOCK_CIPHER_KEY = type { %union.anon, ptr }
%union.anon = type { %struct.SM4_KEY }

@stderr = external global ptr, align 8
@.str = external hidden unnamed_addr constant [13 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [59 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [16 x i8], align 1
@__const.tls12_do_accept.server_ciphers = external hidden unnamed_addr constant [1 x i32], align 4
@__FUNCTION__.tls12_do_accept = external hidden unnamed_addr constant [16 x i8], align 1
@__const.tls12_do_accept.cert_types = external hidden unnamed_addr constant [1 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [26 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local i32 @tls_record_set_handshake_server_key_exchange_ecdhe(ptr noundef, ptr noundef, i32 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

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

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

declare void @sm3_init(ptr noundef) #3

declare i32 @tls_random_generate(ptr noundef) #3

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

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

declare i32 @tls_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

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

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

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

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

declare 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 @sm2_key_generate(ptr noundef) #3

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

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

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

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

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

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

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

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

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

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

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

declare i32 @tls_seq_num_incr(ptr noundef) #3

declare i32 @tls_record_get_change_cipher_spec(ptr noundef) #3

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

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

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

; Function Attrs: nounwind uwtable
define dso_local i32 @tls12_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 [512 x i8], align 16
  %22 = alloca i64, align 8
  %23 = alloca i32, align 4
  %24 = alloca %struct.SM2_KEY, align 8
  %25 = alloca %struct.SM2_SIGN_CTX, align 8
  %26 = alloca [72 x i8], align 16
  %27 = alloca i64, align 8
  %28 = alloca %struct.TLS_CLIENT_VERIFY_CTX, align 8
  %29 = alloca %struct.SM2_KEY, align 8
  %30 = alloca ptr, align 8
  %31 = alloca i32, align 4
  %32 = alloca i32, align 4
  %33 = alloca %struct.SM2_Z256_POINT, align 8
  %34 = alloca [255 x i8], align 16
  %35 = alloca %struct.SM3_CTX, align 8
  %36 = alloca %struct.SM3_CTX, align 8
  %37 = alloca [32 x i8], align 16
  %38 = alloca [12 x i8], align 1
  %39 = alloca ptr, align 8
  %40 = alloca i64, align 8
  %41 = alloca ptr, align 8
  %42 = alloca i64, align 8
  %43 = alloca i32, align 4
  %44 = alloca [1 x i8], align 1
  %45 = alloca [16377 x i8], align 16
  %46 = alloca i64, align 8
  %47 = alloca [64 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
  %48 = load ptr, ptr %3, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.TLS_CONNECT, ptr %48, i32 0, i32 7
  %50 = getelementptr inbounds [18437 x i8], ptr %49, i64 0, i64 0
  store ptr %50, 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.tls12_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 512, ptr %21) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #7
  store i32 41, ptr %23, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 128, ptr %24) #7
  call void @llvm.lifetime.start.p0(i64 3976, ptr %25) #7
  call void @llvm.lifetime.start.p0(i64 72, ptr %26) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #7
  call void @llvm.lifetime.start.p0(i64 136, ptr %28) #7
  call void @llvm.lifetime.start.p0(i64 128, ptr %29) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #7
  store i32 5, ptr %31, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #7
  call void @llvm.lifetime.start.p0(i64 96, ptr %33) #7
  call void @llvm.lifetime.start.p0(i64 255, ptr %34) #7
  call void @llvm.lifetime.start.p0(i64 112, ptr %35) #7
  call void @llvm.lifetime.start.p0(i64 112, ptr %36) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr %37) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr %38) #7
  call void @llvm.lifetime.start.p0(i64 8, 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
  %51 = load ptr, ptr %3, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.TLS_CONNECT, ptr %51, i32 0, i32 19
  %53 = load i64, ptr %52, align 8, !tbaa !11
  %54 = icmp ne i64 %53, 0
  br i1 %54, label %55, label %56

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

56:                                               ; preds = %55, %1
  call void @sm3_init(ptr noundef %35)
  %57 = load i32, ptr %5, align 4, !tbaa !9
  %58 = icmp ne i32 %57, 0
  br i1 %58, label %59, label %61

59:                                               ; preds = %56
  %60 = call i32 @tls_client_verify_init(ptr noundef %28)
  br label %61

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

68:                                               ; preds = %61
  br label %69

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

72:                                               ; preds = %69
  br label %73

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

76:                                               ; preds = %61
  %77 = load ptr, ptr %6, align 8, !tbaa !5
  %78 = getelementptr inbounds i8, ptr %77, i64 1
  %79 = load i8, ptr %78, align 1, !tbaa !21
  %80 = zext i8 %79 to i16
  %81 = zext i16 %80 to i32
  %82 = shl i32 %81, 8
  %83 = load ptr, ptr %6, align 8, !tbaa !5
  %84 = getelementptr inbounds i8, ptr %83, i64 2
  %85 = load i8, ptr %84, align 1, !tbaa !21
  %86 = zext i8 %85 to i32
  %87 = or i32 %82, %86
  %88 = load ptr, ptr %3, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.TLS_CONNECT, ptr %88, i32 0, i32 0
  %90 = load i32, ptr %89, align 8, !tbaa !22
  %91 = icmp ne i32 %87, %90
  br i1 %91, label %92, label %113

92:                                               ; preds = %76
  %93 = load ptr, ptr %6, align 8, !tbaa !5
  %94 = getelementptr inbounds i8, ptr %93, i64 1
  %95 = load i8, ptr %94, align 1, !tbaa !21
  %96 = zext i8 %95 to i16
  %97 = zext i16 %96 to i32
  %98 = shl i32 %97, 8
  %99 = load ptr, ptr %6, align 8, !tbaa !5
  %100 = getelementptr inbounds i8, ptr %99, i64 2
  %101 = load i8, ptr %100, align 1, !tbaa !21
  %102 = zext i8 %101 to i32
  %103 = or i32 %98, %102
  %104 = icmp ne i32 %103, 769
  br i1 %104, label %105, label %113

105:                                              ; preds = %92
  br label %106

106:                                              ; preds = %105
  %107 = load ptr, ptr @stderr, align 8, !tbaa !5
  %108 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %107, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 731, ptr noundef @__FUNCTION__.tls12_do_accept) #7
  br label %109

109:                                              ; preds = %106
  br label %110

110:                                              ; preds = %109
  %111 = load ptr, ptr %3, align 8, !tbaa !5
  %112 = call i32 @tls_send_alert(ptr noundef %111, i32 noundef 70)
  br label %978

113:                                              ; preds = %92, %76
  %114 = load ptr, ptr %6, align 8, !tbaa !5
  %115 = call i32 @tls_record_get_handshake_client_hello(ptr noundef %114, ptr noundef %13, ptr noundef %14, ptr noundef %15, ptr noundef %16, ptr noundef %17, ptr noundef %18, ptr noundef %19, ptr noundef %20)
  %116 = icmp ne i32 %115, 1
  br i1 %116, label %117, label %125

117:                                              ; preds = %113
  br label %118

118:                                              ; preds = %117
  %119 = load ptr, ptr @stderr, align 8, !tbaa !5
  %120 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %119, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 739, ptr noundef @__FUNCTION__.tls12_do_accept) #7
  br label %121

121:                                              ; preds = %118
  br label %122

122:                                              ; preds = %121
  %123 = load ptr, ptr %3, align 8, !tbaa !5
  %124 = call i32 @tls_send_alert(ptr noundef %123, i32 noundef 10)
  br label %978

125:                                              ; preds = %113
  %126 = load i32, ptr %13, align 4, !tbaa !9
  %127 = load ptr, ptr %3, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.TLS_CONNECT, ptr %127, i32 0, i32 0
  %129 = load i32, ptr %128, align 8, !tbaa !22
  %130 = icmp ne i32 %126, %129
  br i1 %130, label %131, label %139

131:                                              ; preds = %125
  br label %132

132:                                              ; preds = %131
  %133 = load ptr, ptr @stderr, align 8, !tbaa !5
  %134 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %133, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 744, ptr noundef @__FUNCTION__.tls12_do_accept) #7
  br label %135

135:                                              ; preds = %132
  br label %136

136:                                              ; preds = %135
  %137 = load ptr, ptr %3, align 8, !tbaa !5
  %138 = call i32 @tls_send_alert(ptr noundef %137, i32 noundef 70)
  br label %978

139:                                              ; preds = %125
  %140 = getelementptr inbounds [32 x i8], ptr %11, i64 0, i64 0
  %141 = load ptr, ptr %14, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %140, ptr align 1 %141, i64 32, i1 false)
  %142 = load ptr, ptr %17, align 8, !tbaa !5
  %143 = load i64, ptr %18, align 8, !tbaa !23
  %144 = getelementptr inbounds [1 x i32], ptr %10, i64 0, i64 0
  %145 = load ptr, ptr %3, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct.TLS_CONNECT, ptr %145, i32 0, i32 11
  %147 = call i32 @tls_cipher_suites_select(ptr noundef %142, i64 noundef %143, ptr noundef %144, i64 noundef 1, ptr noundef %146)
  %148 = icmp ne i32 %147, 1
  br i1 %148, label %149, label %157

149:                                              ; preds = %139
  br label %150

150:                                              ; preds = %149
  %151 = load ptr, ptr @stderr, align 8, !tbaa !5
  %152 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %151, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 752, ptr noundef @__FUNCTION__.tls12_do_accept) #7
  br label %153

153:                                              ; preds = %150
  br label %154

154:                                              ; preds = %153
  %155 = load ptr, ptr %3, align 8, !tbaa !5
  %156 = call i32 @tls_send_alert(ptr noundef %155, i32 noundef 71)
  br label %978

157:                                              ; preds = %139
  %158 = load ptr, ptr %19, align 8, !tbaa !5
  %159 = icmp ne ptr %158, null
  br i1 %159, label %160, label %165

160:                                              ; preds = %157
  store i64 0, ptr %22, align 8, !tbaa !23
  store i32 41, ptr %23, align 4, !tbaa !9
  %161 = load ptr, ptr %19, align 8, !tbaa !5
  %162 = load i64, ptr %20, align 8, !tbaa !23
  %163 = getelementptr inbounds [512 x i8], ptr %21, i64 0, i64 0
  %164 = call i32 @tls_process_client_hello_exts(ptr noundef %161, i64 noundef %162, ptr noundef %163, ptr noundef %22, i64 noundef 512)
  br label %165

165:                                              ; preds = %160, %157
  %166 = load ptr, ptr %6, align 8, !tbaa !5
  %167 = getelementptr inbounds i8, ptr %166, i64 5
  %168 = load i64, ptr %8, align 8, !tbaa !23
  %169 = sub i64 %168, 5
  call void @sm3_update(ptr noundef %35, ptr noundef %167, i64 noundef %169)
  %170 = load i32, ptr %5, align 4, !tbaa !9
  %171 = icmp ne i32 %170, 0
  br i1 %171, label %172, label %178

172:                                              ; preds = %165
  %173 = load ptr, ptr %6, align 8, !tbaa !5
  %174 = getelementptr inbounds i8, ptr %173, i64 5
  %175 = load i64, ptr %8, align 8, !tbaa !23
  %176 = sub i64 %175, 5
  %177 = call i32 @tls_client_verify_update(ptr noundef %28, ptr noundef %174, i64 noundef %176)
  br label %178

178:                                              ; preds = %172, %165
  %179 = getelementptr inbounds [32 x i8], ptr %12, i64 0, i64 0
  %180 = call i32 @tls_random_generate(ptr noundef %179)
  %181 = load ptr, ptr %6, align 8, !tbaa !5
  %182 = load ptr, ptr %3, align 8, !tbaa !5
  %183 = getelementptr inbounds %struct.TLS_CONNECT, ptr %182, i32 0, i32 0
  %184 = load i32, ptr %183, align 8, !tbaa !22
  %185 = call i32 @tls_record_set_protocol(ptr noundef %181, i32 noundef %184)
  %186 = load ptr, ptr %6, align 8, !tbaa !5
  %187 = load ptr, ptr %3, align 8, !tbaa !5
  %188 = getelementptr inbounds %struct.TLS_CONNECT, ptr %187, i32 0, i32 0
  %189 = load i32, ptr %188, align 8, !tbaa !22
  %190 = getelementptr inbounds [32 x i8], ptr %12, i64 0, i64 0
  %191 = load ptr, ptr %3, align 8, !tbaa !5
  %192 = getelementptr inbounds %struct.TLS_CONNECT, ptr %191, i32 0, i32 11
  %193 = load i32, ptr %192, align 8, !tbaa !24
  %194 = getelementptr inbounds [512 x i8], ptr %21, i64 0, i64 0
  %195 = load i64, ptr %22, align 8, !tbaa !23
  %196 = call i32 @tls_record_set_handshake_server_hello(ptr noundef %186, ptr noundef %8, i32 noundef %189, ptr noundef %190, ptr noundef null, i64 noundef 0, i32 noundef %193, ptr noundef %194, i64 noundef %195)
  %197 = icmp ne i32 %196, 1
  br i1 %197, label %198, label %206

198:                                              ; preds = %178
  br label %199

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

202:                                              ; preds = %199
  br label %203

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

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

214:                                              ; preds = %206
  br label %215

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

218:                                              ; preds = %215
  br label %219

219:                                              ; preds = %218
  br label %978

220:                                              ; preds = %206
  %221 = load ptr, ptr %6, align 8, !tbaa !5
  %222 = getelementptr inbounds i8, ptr %221, i64 5
  %223 = load i64, ptr %8, align 8, !tbaa !23
  %224 = sub i64 %223, 5
  call void @sm3_update(ptr noundef %35, ptr noundef %222, i64 noundef %224)
  %225 = load i32, ptr %5, align 4, !tbaa !9
  %226 = icmp ne i32 %225, 0
  br i1 %226, label %227, label %233

227:                                              ; preds = %220
  %228 = load ptr, ptr %6, align 8, !tbaa !5
  %229 = getelementptr inbounds i8, ptr %228, i64 5
  %230 = load i64, ptr %8, align 8, !tbaa !23
  %231 = sub i64 %230, 5
  %232 = call i32 @tls_client_verify_update(ptr noundef %28, ptr noundef %229, i64 noundef %231)
  br label %233

233:                                              ; preds = %227, %220
  %234 = load ptr, ptr %6, align 8, !tbaa !5
  %235 = load ptr, ptr %3, align 8, !tbaa !5
  %236 = getelementptr inbounds %struct.TLS_CONNECT, ptr %235, i32 0, i32 14
  %237 = getelementptr inbounds [2048 x i8], ptr %236, i64 0, i64 0
  %238 = load ptr, ptr %3, align 8, !tbaa !5
  %239 = getelementptr inbounds %struct.TLS_CONNECT, ptr %238, i32 0, i32 15
  %240 = load i64, ptr %239, align 8, !tbaa !25
  %241 = call i32 @tls_record_set_handshake_certificate(ptr noundef %234, ptr noundef %8, ptr noundef %237, i64 noundef %240)
  %242 = icmp ne i32 %241, 1
  br i1 %242, label %243, label %251

243:                                              ; preds = %233
  br label %244

244:                                              ; preds = %243
  %245 = load ptr, ptr @stderr, align 8, !tbaa !5
  %246 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %245, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 794, ptr noundef @__FUNCTION__.tls12_do_accept) #7
  br label %247

247:                                              ; preds = %244
  br label %248

248:                                              ; preds = %247
  %249 = load ptr, ptr %3, align 8, !tbaa !5
  %250 = call i32 @tls_send_alert(ptr noundef %249, i32 noundef 80)
  br label %978

251:                                              ; preds = %233
  %252 = load ptr, ptr %6, align 8, !tbaa !5
  %253 = load i64, ptr %8, align 8, !tbaa !23
  %254 = load ptr, ptr %3, align 8, !tbaa !5
  %255 = getelementptr inbounds %struct.TLS_CONNECT, ptr %254, i32 0, i32 4
  %256 = load i32, ptr %255, align 8, !tbaa !20
  %257 = call i32 @tls_record_send(ptr noundef %252, i64 noundef %253, i32 noundef %256)
  %258 = icmp ne i32 %257, 1
  br i1 %258, label %259, label %265

259:                                              ; preds = %251
  br label %260

260:                                              ; preds = %259
  %261 = load ptr, ptr @stderr, align 8, !tbaa !5
  %262 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %261, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 800, ptr noundef @__FUNCTION__.tls12_do_accept) #7
  br label %263

263:                                              ; preds = %260
  br label %264

264:                                              ; preds = %263
  br label %978

265:                                              ; preds = %251
  %266 = load ptr, ptr %6, align 8, !tbaa !5
  %267 = getelementptr inbounds i8, ptr %266, i64 5
  %268 = load i64, ptr %8, align 8, !tbaa !23
  %269 = sub i64 %268, 5
  call void @sm3_update(ptr noundef %35, ptr noundef %267, i64 noundef %269)
  %270 = load i32, ptr %5, align 4, !tbaa !9
  %271 = icmp ne i32 %270, 0
  br i1 %271, label %272, label %278

272:                                              ; preds = %265
  %273 = load ptr, ptr %6, align 8, !tbaa !5
  %274 = getelementptr inbounds i8, ptr %273, i64 5
  %275 = load i64, ptr %8, align 8, !tbaa !23
  %276 = sub i64 %275, 5
  %277 = call i32 @tls_client_verify_update(ptr noundef %28, ptr noundef %274, i64 noundef %276)
  br label %278

278:                                              ; preds = %272, %265
  %279 = call i32 @sm2_key_generate(ptr noundef %24)
  %280 = load ptr, ptr %3, align 8, !tbaa !5
  %281 = getelementptr inbounds %struct.TLS_CONNECT, ptr %280, i32 0, i32 20
  %282 = getelementptr inbounds [32 x i8], ptr %11, i64 0, i64 0
  %283 = getelementptr inbounds [32 x i8], ptr %12, i64 0, i64 0
  %284 = getelementptr inbounds %struct.SM2_KEY, ptr %24, i32 0, i32 0
  %285 = getelementptr inbounds [72 x i8], ptr %26, i64 0, i64 0
  %286 = call i32 @tls_sign_server_ecdh_params(ptr noundef %281, ptr noundef %282, ptr noundef %283, i32 noundef 41, ptr noundef %284, ptr noundef %285, ptr noundef %27)
  %287 = icmp ne i32 %286, 1
  br i1 %287, label %288, label %296

288:                                              ; preds = %278
  br label %289

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

292:                                              ; preds = %289
  br label %293

293:                                              ; preds = %292
  %294 = load ptr, ptr %3, align 8, !tbaa !5
  %295 = call i32 @tls_send_alert(ptr noundef %294, i32 noundef 80)
  store i32 -1, ptr %2, align 4
  store i32 1, ptr %43, align 4
  br label %985

296:                                              ; preds = %278
  %297 = load ptr, ptr %6, align 8, !tbaa !5
  %298 = load i32, ptr %23, align 4, !tbaa !9
  %299 = getelementptr inbounds %struct.SM2_KEY, ptr %24, i32 0, i32 0
  %300 = getelementptr inbounds [72 x i8], ptr %26, i64 0, i64 0
  %301 = load i64, ptr %27, align 8, !tbaa !23
  %302 = call i32 @tls_record_set_handshake_server_key_exchange_ecdhe(ptr noundef %297, ptr noundef %8, i32 noundef %298, ptr noundef %299, ptr noundef %300, i64 noundef %301)
  %303 = icmp ne i32 %302, 1
  br i1 %303, label %304, label %312

304:                                              ; preds = %296
  br label %305

305:                                              ; preds = %304
  %306 = load ptr, ptr @stderr, align 8, !tbaa !5
  %307 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %306, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 819, ptr noundef @__FUNCTION__.tls12_do_accept) #7
  br label %308

308:                                              ; preds = %305
  br label %309

309:                                              ; preds = %308
  %310 = load ptr, ptr %3, align 8, !tbaa !5
  %311 = call i32 @tls_send_alert(ptr noundef %310, i32 noundef 80)
  br label %978

312:                                              ; preds = %296
  %313 = load ptr, ptr %6, align 8, !tbaa !5
  %314 = load i64, ptr %8, align 8, !tbaa !23
  %315 = load ptr, ptr %3, align 8, !tbaa !5
  %316 = getelementptr inbounds %struct.TLS_CONNECT, ptr %315, i32 0, i32 4
  %317 = load i32, ptr %316, align 8, !tbaa !20
  %318 = call i32 @tls_record_send(ptr noundef %313, i64 noundef %314, i32 noundef %317)
  %319 = icmp ne i32 %318, 1
  br i1 %319, label %320, label %326

320:                                              ; preds = %312
  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 825, ptr noundef @__FUNCTION__.tls12_do_accept) #7
  br label %324

324:                                              ; preds = %321
  br label %325

325:                                              ; preds = %324
  br label %978

326:                                              ; preds = %312
  %327 = load ptr, ptr %6, align 8, !tbaa !5
  %328 = getelementptr inbounds i8, ptr %327, i64 5
  %329 = load i64, ptr %8, align 8, !tbaa !23
  %330 = sub i64 %329, 5
  call void @sm3_update(ptr noundef %35, ptr noundef %328, i64 noundef %330)
  %331 = load i32, ptr %5, align 4, !tbaa !9
  %332 = icmp ne i32 %331, 0
  br i1 %332, label %333, label %339

333:                                              ; preds = %326
  %334 = load ptr, ptr %6, align 8, !tbaa !5
  %335 = getelementptr inbounds i8, ptr %334, i64 5
  %336 = load i64, ptr %8, align 8, !tbaa !23
  %337 = sub i64 %336, 5
  %338 = call i32 @tls_client_verify_update(ptr noundef %28, ptr noundef %335, i64 noundef %337)
  br label %339

339:                                              ; preds = %333, %326
  %340 = load i32, ptr %5, align 4, !tbaa !9
  %341 = icmp ne i32 %340, 0
  br i1 %341, label %342, label %398

342:                                              ; preds = %339
  call void @llvm.lifetime.start.p0(i64 1, ptr %44) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %44, ptr align 1 @__const.tls12_do_accept.cert_types, i64 1, i1 false)
  call void @llvm.lifetime.start.p0(i64 16377, ptr %45) #7
  call void @llvm.memset.p0.i64(ptr align 16 %45, i8 0, i64 16377, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %46) #7
  store i64 0, ptr %46, align 8, !tbaa !23
  %343 = getelementptr inbounds [16377 x i8], ptr %45, i64 0, i64 0
  %344 = load ptr, ptr %3, align 8, !tbaa !5
  %345 = getelementptr inbounds %struct.TLS_CONNECT, ptr %344, i32 0, i32 18
  %346 = getelementptr inbounds [2048 x i8], ptr %345, i64 0, i64 0
  %347 = load ptr, ptr %3, align 8, !tbaa !5
  %348 = getelementptr inbounds %struct.TLS_CONNECT, ptr %347, i32 0, i32 19
  %349 = load i64, ptr %348, align 8, !tbaa !11
  %350 = call i32 @tls_authorities_from_certs(ptr noundef %343, ptr noundef %46, i64 noundef 16377, ptr noundef %346, i64 noundef %349)
  %351 = icmp ne i32 %350, 1
  br i1 %351, label %352, label %358

352:                                              ; preds = %342
  br label %353

353:                                              ; preds = %352
  %354 = load ptr, ptr @stderr, align 8, !tbaa !5
  %355 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %354, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 841, ptr noundef @__FUNCTION__.tls12_do_accept) #7
  br label %356

356:                                              ; preds = %353
  br label %357

357:                                              ; preds = %356
  store i32 4, ptr %43, align 4
  br label %395

358:                                              ; preds = %342
  %359 = load ptr, ptr %6, align 8, !tbaa !5
  %360 = getelementptr inbounds [1 x i8], ptr %44, i64 0, i64 0
  %361 = getelementptr inbounds [16377 x i8], ptr %45, i64 0, i64 0
  %362 = load i64, ptr %46, align 8, !tbaa !23
  %363 = call i32 @tls_record_set_handshake_certificate_request(ptr noundef %359, ptr noundef %8, ptr noundef %360, i64 noundef 1, ptr noundef %361, i64 noundef %362)
  %364 = icmp ne i32 %363, 1
  br i1 %364, label %365, label %371

365:                                              ; preds = %358
  br label %366

366:                                              ; preds = %365
  %367 = load ptr, ptr @stderr, align 8, !tbaa !5
  %368 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %367, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 847, ptr noundef @__FUNCTION__.tls12_do_accept) #7
  br label %369

369:                                              ; preds = %366
  br label %370

370:                                              ; preds = %369
  store i32 4, ptr %43, align 4
  br label %395

371:                                              ; preds = %358
  %372 = load ptr, ptr %6, align 8, !tbaa !5
  %373 = load i64, ptr %8, align 8, !tbaa !23
  %374 = load ptr, ptr %3, align 8, !tbaa !5
  %375 = getelementptr inbounds %struct.TLS_CONNECT, ptr %374, i32 0, i32 4
  %376 = load i32, ptr %375, align 8, !tbaa !20
  %377 = call i32 @tls_record_send(ptr noundef %372, i64 noundef %373, i32 noundef %376)
  %378 = icmp ne i32 %377, 1
  br i1 %378, label %379, label %385

379:                                              ; preds = %371
  br label %380

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

383:                                              ; preds = %380
  br label %384

384:                                              ; preds = %383
  store i32 4, ptr %43, align 4
  br label %395

385:                                              ; preds = %371
  %386 = load ptr, ptr %6, align 8, !tbaa !5
  %387 = getelementptr inbounds i8, ptr %386, i64 5
  %388 = load i64, ptr %8, align 8, !tbaa !23
  %389 = sub i64 %388, 5
  call void @sm3_update(ptr noundef %35, ptr noundef %387, i64 noundef %389)
  %390 = load ptr, ptr %6, align 8, !tbaa !5
  %391 = getelementptr inbounds i8, ptr %390, i64 5
  %392 = load i64, ptr %8, align 8, !tbaa !23
  %393 = sub i64 %392, 5
  %394 = call i32 @tls_client_verify_update(ptr noundef %28, ptr noundef %391, i64 noundef %393)
  store i32 0, ptr %43, align 4
  br label %395

395:                                              ; preds = %385, %384, %370, %357
  call void @llvm.lifetime.end.p0(i64 8, ptr %46) #7
  call void @llvm.lifetime.end.p0(i64 16377, ptr %45) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %44) #7
  %396 = load i32, ptr %43, align 4
  switch i32 %396, label %985 [
    i32 0, label %397
    i32 4, label %978
  ]

397:                                              ; preds = %395
  br label %398

398:                                              ; preds = %397, %339
  %399 = load ptr, ptr %6, align 8, !tbaa !5
  %400 = call i32 @tls_record_set_handshake_server_hello_done(ptr noundef %399, ptr noundef %8)
  %401 = load ptr, ptr %6, align 8, !tbaa !5
  %402 = load i64, ptr %8, align 8, !tbaa !23
  %403 = load ptr, ptr %3, align 8, !tbaa !5
  %404 = getelementptr inbounds %struct.TLS_CONNECT, ptr %403, i32 0, i32 4
  %405 = load i32, ptr %404, align 8, !tbaa !20
  %406 = call i32 @tls_record_send(ptr noundef %401, i64 noundef %402, i32 noundef %405)
  %407 = icmp ne i32 %406, 1
  br i1 %407, label %408, label %414

408:                                              ; preds = %398
  br label %409

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

412:                                              ; preds = %409
  br label %413

413:                                              ; preds = %412
  br label %978

414:                                              ; preds = %398
  %415 = load ptr, ptr %6, align 8, !tbaa !5
  %416 = getelementptr inbounds i8, ptr %415, i64 5
  %417 = load i64, ptr %8, align 8, !tbaa !23
  %418 = sub i64 %417, 5
  call void @sm3_update(ptr noundef %35, ptr noundef %416, i64 noundef %418)
  %419 = load i32, ptr %5, align 4, !tbaa !9
  %420 = icmp ne i32 %419, 0
  br i1 %420, label %421, label %427

421:                                              ; preds = %414
  %422 = load ptr, ptr %6, align 8, !tbaa !5
  %423 = getelementptr inbounds i8, ptr %422, i64 5
  %424 = load i64, ptr %8, align 8, !tbaa !23
  %425 = sub i64 %424, 5
  %426 = call i32 @tls_client_verify_update(ptr noundef %28, ptr noundef %423, i64 noundef %425)
  br label %427

427:                                              ; preds = %421, %414
  %428 = load ptr, ptr %3, align 8, !tbaa !5
  %429 = getelementptr inbounds %struct.TLS_CONNECT, ptr %428, i32 0, i32 19
  %430 = load i64, ptr %429, align 8, !tbaa !11
  %431 = icmp ne i64 %430, 0
  br i1 %431, label %432, label %513

432:                                              ; preds = %427
  %433 = load ptr, ptr %6, align 8, !tbaa !5
  %434 = load ptr, ptr %3, align 8, !tbaa !5
  %435 = getelementptr inbounds %struct.TLS_CONNECT, ptr %434, i32 0, i32 4
  %436 = load i32, ptr %435, align 8, !tbaa !20
  %437 = call i32 @tls_record_recv(ptr noundef %433, ptr noundef %8, i32 noundef %436)
  %438 = icmp ne i32 %437, 1
  br i1 %438, label %455, label %439

439:                                              ; preds = %432
  %440 = load ptr, ptr %6, align 8, !tbaa !5
  %441 = getelementptr inbounds i8, ptr %440, i64 1
  %442 = load i8, ptr %441, align 1, !tbaa !21
  %443 = zext i8 %442 to i16
  %444 = zext i16 %443 to i32
  %445 = shl i32 %444, 8
  %446 = load ptr, ptr %6, align 8, !tbaa !5
  %447 = getelementptr inbounds i8, ptr %446, i64 2
  %448 = load i8, ptr %447, align 1, !tbaa !21
  %449 = zext i8 %448 to i32
  %450 = or i32 %445, %449
  %451 = load ptr, ptr %3, align 8, !tbaa !5
  %452 = getelementptr inbounds %struct.TLS_CONNECT, ptr %451, i32 0, i32 0
  %453 = load i32, ptr %452, align 8, !tbaa !22
  %454 = icmp ne i32 %450, %453
  br i1 %454, label %455, label %463

455:                                              ; preds = %439, %432
  br label %456

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

459:                                              ; preds = %456
  br label %460

460:                                              ; preds = %459
  %461 = load ptr, ptr %3, align 8, !tbaa !5
  %462 = call i32 @tls_send_alert(ptr noundef %461, i32 noundef 10)
  br label %978

463:                                              ; preds = %439
  %464 = load ptr, ptr %6, align 8, !tbaa !5
  %465 = load ptr, ptr %3, align 8, !tbaa !5
  %466 = getelementptr inbounds %struct.TLS_CONNECT, ptr %465, i32 0, i32 16
  %467 = getelementptr inbounds [2048 x i8], ptr %466, i64 0, i64 0
  %468 = load ptr, ptr %3, align 8, !tbaa !5
  %469 = getelementptr inbounds %struct.TLS_CONNECT, ptr %468, i32 0, i32 17
  %470 = call i32 @tls_record_get_handshake_certificate(ptr noundef %464, ptr noundef %467, ptr noundef %469)
  %471 = icmp ne i32 %470, 1
  br i1 %471, label %472, label %480

472:                                              ; preds = %463
  br label %473

473:                                              ; preds = %472
  %474 = load ptr, ptr @stderr, align 8, !tbaa !5
  %475 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %474, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 882, ptr noundef @__FUNCTION__.tls12_do_accept) #7
  br label %476

476:                                              ; preds = %473
  br label %477

477:                                              ; preds = %476
  %478 = load ptr, ptr %3, align 8, !tbaa !5
  %479 = call i32 @tls_send_alert(ptr noundef %478, i32 noundef 10)
  br label %978

480:                                              ; preds = %463
  %481 = load ptr, ptr %3, align 8, !tbaa !5
  %482 = getelementptr inbounds %struct.TLS_CONNECT, ptr %481, i32 0, i32 16
  %483 = getelementptr inbounds [2048 x i8], ptr %482, i64 0, i64 0
  %484 = load ptr, ptr %3, align 8, !tbaa !5
  %485 = getelementptr inbounds %struct.TLS_CONNECT, ptr %484, i32 0, i32 17
  %486 = load i64, ptr %485, align 8, !tbaa !26
  %487 = load ptr, ptr %3, align 8, !tbaa !5
  %488 = getelementptr inbounds %struct.TLS_CONNECT, ptr %487, i32 0, i32 18
  %489 = getelementptr inbounds [2048 x i8], ptr %488, i64 0, i64 0
  %490 = load ptr, ptr %3, align 8, !tbaa !5
  %491 = getelementptr inbounds %struct.TLS_CONNECT, ptr %490, i32 0, i32 19
  %492 = load i64, ptr %491, align 8, !tbaa !11
  %493 = call i32 @x509_certs_verify(ptr noundef %483, i64 noundef %486, i32 noundef 1, ptr noundef %489, i64 noundef %492, i32 noundef 5, ptr noundef %32)
  %494 = icmp ne i32 %493, 1
  br i1 %494, label %495, label %503

495:                                              ; preds = %480
  br label %496

496:                                              ; preds = %495
  %497 = load ptr, ptr @stderr, align 8, !tbaa !5
  %498 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %497, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 888, ptr noundef @__FUNCTION__.tls12_do_accept) #7
  br label %499

499:                                              ; preds = %496
  br label %500

500:                                              ; preds = %499
  %501 = load ptr, ptr %3, align 8, !tbaa !5
  %502 = call i32 @tls_send_alert(ptr noundef %501, i32 noundef 42)
  br label %978

503:                                              ; preds = %480
  %504 = load ptr, ptr %6, align 8, !tbaa !5
  %505 = getelementptr inbounds i8, ptr %504, i64 5
  %506 = load i64, ptr %8, align 8, !tbaa !23
  %507 = sub i64 %506, 5
  call void @sm3_update(ptr noundef %35, ptr noundef %505, i64 noundef %507)
  %508 = load ptr, ptr %6, align 8, !tbaa !5
  %509 = getelementptr inbounds i8, ptr %508, i64 5
  %510 = load i64, ptr %8, align 8, !tbaa !23
  %511 = sub i64 %510, 5
  %512 = call i32 @tls_client_verify_update(ptr noundef %28, ptr noundef %509, i64 noundef %511)
  br label %513

513:                                              ; preds = %503, %427
  %514 = load ptr, ptr %6, align 8, !tbaa !5
  %515 = load ptr, ptr %3, align 8, !tbaa !5
  %516 = getelementptr inbounds %struct.TLS_CONNECT, ptr %515, i32 0, i32 4
  %517 = load i32, ptr %516, align 8, !tbaa !20
  %518 = call i32 @tls_record_recv(ptr noundef %514, ptr noundef %8, i32 noundef %517)
  %519 = icmp ne i32 %518, 1
  br i1 %519, label %536, label %520

520:                                              ; preds = %513
  %521 = load ptr, ptr %6, align 8, !tbaa !5
  %522 = getelementptr inbounds i8, ptr %521, i64 1
  %523 = load i8, ptr %522, align 1, !tbaa !21
  %524 = zext i8 %523 to i16
  %525 = zext i16 %524 to i32
  %526 = shl i32 %525, 8
  %527 = load ptr, ptr %6, align 8, !tbaa !5
  %528 = getelementptr inbounds i8, ptr %527, i64 2
  %529 = load i8, ptr %528, align 1, !tbaa !21
  %530 = zext i8 %529 to i32
  %531 = or i32 %526, %530
  %532 = load ptr, ptr %3, align 8, !tbaa !5
  %533 = getelementptr inbounds %struct.TLS_CONNECT, ptr %532, i32 0, i32 0
  %534 = load i32, ptr %533, align 8, !tbaa !22
  %535 = icmp ne i32 %531, %534
  br i1 %535, label %536, label %544

536:                                              ; preds = %520, %513
  br label %537

537:                                              ; preds = %536
  %538 = load ptr, ptr @stderr, align 8, !tbaa !5
  %539 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %538, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 900, ptr noundef @__FUNCTION__.tls12_do_accept) #7
  br label %540

540:                                              ; preds = %537
  br label %541

541:                                              ; preds = %540
  %542 = load ptr, ptr %3, align 8, !tbaa !5
  %543 = call i32 @tls_send_alert(ptr noundef %542, i32 noundef 10)
  br label %978

544:                                              ; preds = %520
  %545 = load ptr, ptr %6, align 8, !tbaa !5
  %546 = call i32 @tls_record_get_handshake_client_key_exchange_ecdhe(ptr noundef %545, ptr noundef %33)
  %547 = icmp ne i32 %546, 1
  br i1 %547, label %548, label %556

548:                                              ; preds = %544
  br label %549

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

552:                                              ; preds = %549
  br label %553

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

556:                                              ; preds = %544
  %557 = load ptr, ptr %6, align 8, !tbaa !5
  %558 = getelementptr inbounds i8, ptr %557, i64 5
  %559 = load i64, ptr %8, align 8, !tbaa !23
  %560 = sub i64 %559, 5
  call void @sm3_update(ptr noundef %35, ptr noundef %558, i64 noundef %560)
  %561 = load i32, ptr %5, align 4, !tbaa !9
  %562 = icmp ne i32 %561, 0
  br i1 %562, label %563, label %569

563:                                              ; preds = %556
  %564 = load ptr, ptr %6, align 8, !tbaa !5
  %565 = getelementptr inbounds i8, ptr %564, i64 5
  %566 = load i64, ptr %8, align 8, !tbaa !23
  %567 = sub i64 %566, 5
  %568 = call i32 @tls_client_verify_update(ptr noundef %28, ptr noundef %565, i64 noundef %567)
  br label %569

569:                                              ; preds = %563, %556
  %570 = load i32, ptr %5, align 4, !tbaa !9
  %571 = icmp ne i32 %570, 0
  br i1 %571, label %572, label %655

572:                                              ; preds = %569
  %573 = load ptr, ptr %6, align 8, !tbaa !5
  %574 = load ptr, ptr %3, align 8, !tbaa !5
  %575 = getelementptr inbounds %struct.TLS_CONNECT, ptr %574, i32 0, i32 4
  %576 = load i32, ptr %575, align 8, !tbaa !20
  %577 = call i32 @tls_record_recv(ptr noundef %573, ptr noundef %8, i32 noundef %576)
  %578 = icmp ne i32 %577, 1
  br i1 %578, label %595, label %579

579:                                              ; preds = %572
  %580 = load ptr, ptr %6, align 8, !tbaa !5
  %581 = getelementptr inbounds i8, ptr %580, i64 1
  %582 = load i8, ptr %581, align 1, !tbaa !21
  %583 = zext i8 %582 to i16
  %584 = zext i16 %583 to i32
  %585 = shl i32 %584, 8
  %586 = load ptr, ptr %6, align 8, !tbaa !5
  %587 = getelementptr inbounds i8, ptr %586, i64 2
  %588 = load i8, ptr %587, align 1, !tbaa !21
  %589 = zext i8 %588 to i32
  %590 = or i32 %585, %589
  %591 = load ptr, ptr %3, align 8, !tbaa !5
  %592 = getelementptr inbounds %struct.TLS_CONNECT, ptr %591, i32 0, i32 0
  %593 = load i32, ptr %592, align 8, !tbaa !22
  %594 = icmp ne i32 %590, %593
  br i1 %594, label %595, label %603

595:                                              ; preds = %579, %572
  %596 = load ptr, ptr %3, align 8, !tbaa !5
  %597 = call i32 @tls_send_alert(ptr noundef %596, i32 noundef 10)
  br label %598

598:                                              ; preds = %595
  %599 = load ptr, ptr @stderr, align 8, !tbaa !5
  %600 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %599, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 921, ptr noundef @__FUNCTION__.tls12_do_accept) #7
  br label %601

601:                                              ; preds = %598
  br label %602

602:                                              ; preds = %601
  br label %978

603:                                              ; preds = %579
  %604 = load ptr, ptr %6, align 8, !tbaa !5
  %605 = call i32 @tls_record_get_handshake_certificate_verify(ptr noundef %604, ptr noundef %30, ptr noundef %27)
  %606 = icmp ne i32 %605, 1
  br i1 %606, label %607, label %615

607:                                              ; preds = %603
  %608 = load ptr, ptr %3, align 8, !tbaa !5
  %609 = call i32 @tls_send_alert(ptr noundef %608, i32 noundef 10)
  br label %610

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

613:                                              ; preds = %610
  br label %614

614:                                              ; preds = %613
  br label %978

615:                                              ; preds = %603
  %616 = load ptr, ptr %3, align 8, !tbaa !5
  %617 = getelementptr inbounds %struct.TLS_CONNECT, ptr %616, i32 0, i32 16
  %618 = getelementptr inbounds [2048 x i8], ptr %617, i64 0, i64 0
  %619 = load ptr, ptr %3, align 8, !tbaa !5
  %620 = getelementptr inbounds %struct.TLS_CONNECT, ptr %619, i32 0, i32 17
  %621 = load i64, ptr %620, align 8, !tbaa !26
  %622 = call i32 @x509_certs_get_cert_by_index(ptr noundef %618, i64 noundef %621, i32 noundef 0, ptr noundef %41, ptr noundef %42)
  %623 = icmp ne i32 %622, 1
  br i1 %623, label %629, label %624

624:                                              ; preds = %615
  %625 = load ptr, ptr %41, align 8, !tbaa !5
  %626 = load i64, ptr %42, align 8, !tbaa !23
  %627 = call i32 @x509_cert_get_subject_public_key(ptr noundef %625, i64 noundef %626, ptr noundef %29)
  %628 = icmp ne i32 %627, 1
  br i1 %628, label %629, label %637

629:                                              ; preds = %624, %615
  br label %630

630:                                              ; preds = %629
  %631 = load ptr, ptr @stderr, align 8, !tbaa !5
  %632 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %631, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 932, ptr noundef @__FUNCTION__.tls12_do_accept) #7
  br label %633

633:                                              ; preds = %630
  br label %634

634:                                              ; preds = %633
  %635 = load ptr, ptr %3, align 8, !tbaa !5
  %636 = call i32 @tls_send_alert(ptr noundef %635, i32 noundef 42)
  br label %978

637:                                              ; preds = %624
  %638 = load ptr, ptr %30, align 8, !tbaa !5
  %639 = load i64, ptr %27, align 8, !tbaa !23
  %640 = call i32 @tls_client_verify_finish(ptr noundef %28, ptr noundef %638, i64 noundef %639, ptr noundef %29)
  %641 = icmp ne i32 %640, 1
  br i1 %641, label %642, label %650

642:                                              ; preds = %637
  br label %643

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

646:                                              ; preds = %643
  br label %647

647:                                              ; preds = %646
  %648 = load ptr, ptr %3, align 8, !tbaa !5
  %649 = call i32 @tls_send_alert(ptr noundef %648, i32 noundef 51)
  br label %978

650:                                              ; preds = %637
  %651 = load ptr, ptr %6, align 8, !tbaa !5
  %652 = getelementptr inbounds i8, ptr %651, i64 5
  %653 = load i64, ptr %8, align 8, !tbaa !23
  %654 = sub i64 %653, 5
  call void @sm3_update(ptr noundef %35, ptr noundef %652, i64 noundef %654)
  br label %655

655:                                              ; preds = %650, %569
  %656 = call i32 @sm2_do_ecdh(ptr noundef %24, ptr noundef %33, ptr noundef %33)
  %657 = getelementptr inbounds [64 x i8], ptr %47, i64 0, i64 0
  %658 = call i32 @sm2_z256_point_to_bytes(ptr noundef %33, ptr noundef %657)
  %659 = getelementptr inbounds [255 x i8], ptr %34, i64 0, i64 0
  %660 = getelementptr inbounds [64 x i8], ptr %47, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %659, ptr align 16 %660, i64 32, i1 false)
  %661 = getelementptr inbounds [255 x i8], ptr %34, i64 0, i64 0
  %662 = getelementptr inbounds [32 x i8], ptr %11, i64 0, i64 0
  %663 = getelementptr inbounds [32 x i8], ptr %12, i64 0, i64 0
  %664 = load ptr, ptr %3, align 8, !tbaa !5
  %665 = getelementptr inbounds %struct.TLS_CONNECT, ptr %664, i32 0, i32 23
  %666 = getelementptr inbounds [48 x i8], ptr %665, i64 0, i64 0
  %667 = call i32 @tls_prf(ptr noundef %661, i64 noundef 32, ptr noundef @.str.3, ptr noundef %662, i64 noundef 32, ptr noundef %663, i64 noundef 32, i64 noundef 48, ptr noundef %666)
  %668 = load ptr, ptr %3, align 8, !tbaa !5
  %669 = getelementptr inbounds %struct.TLS_CONNECT, ptr %668, i32 0, i32 23
  %670 = getelementptr inbounds [48 x i8], ptr %669, i64 0, i64 0
  %671 = getelementptr inbounds [32 x i8], ptr %12, i64 0, i64 0
  %672 = getelementptr inbounds [32 x i8], ptr %11, i64 0, i64 0
  %673 = load ptr, ptr %3, align 8, !tbaa !5
  %674 = getelementptr inbounds %struct.TLS_CONNECT, ptr %673, i32 0, i32 24
  %675 = getelementptr inbounds [96 x i8], ptr %674, i64 0, i64 0
  %676 = call i32 @tls_prf(ptr noundef %670, i64 noundef 48, ptr noundef @.str.4, ptr noundef %671, i64 noundef 32, ptr noundef %672, i64 noundef 32, i64 noundef 96, ptr noundef %675)
  %677 = load ptr, ptr %3, align 8, !tbaa !5
  %678 = getelementptr inbounds %struct.TLS_CONNECT, ptr %677, i32 0, i32 25
  %679 = load ptr, ptr %3, align 8, !tbaa !5
  %680 = getelementptr inbounds %struct.TLS_CONNECT, ptr %679, i32 0, i32 24
  %681 = getelementptr inbounds [96 x i8], ptr %680, i64 0, i64 0
  call void @sm3_hmac_init(ptr noundef %678, ptr noundef %681, i64 noundef 32)
  %682 = load ptr, ptr %3, align 8, !tbaa !5
  %683 = getelementptr inbounds %struct.TLS_CONNECT, ptr %682, i32 0, i32 26
  %684 = load ptr, ptr %3, align 8, !tbaa !5
  %685 = getelementptr inbounds %struct.TLS_CONNECT, ptr %684, i32 0, i32 24
  %686 = getelementptr inbounds [96 x i8], ptr %685, i64 0, i64 0
  %687 = getelementptr inbounds i8, ptr %686, i64 32
  call void @sm3_hmac_init(ptr noundef %683, ptr noundef %687, i64 noundef 32)
  %688 = load ptr, ptr %3, align 8, !tbaa !5
  %689 = getelementptr inbounds %struct.TLS_CONNECT, ptr %688, i32 0, i32 27
  %690 = load ptr, ptr %3, align 8, !tbaa !5
  %691 = getelementptr inbounds %struct.TLS_CONNECT, ptr %690, i32 0, i32 24
  %692 = getelementptr inbounds [96 x i8], ptr %691, i64 0, i64 0
  %693 = getelementptr inbounds i8, ptr %692, i64 64
  call void @sm4_set_decrypt_key(ptr noundef %689, ptr noundef %693)
  %694 = load ptr, ptr %3, align 8, !tbaa !5
  %695 = getelementptr inbounds %struct.TLS_CONNECT, ptr %694, i32 0, i32 28
  %696 = load ptr, ptr %3, align 8, !tbaa !5
  %697 = getelementptr inbounds %struct.TLS_CONNECT, ptr %696, i32 0, i32 24
  %698 = getelementptr inbounds [96 x i8], ptr %697, i64 0, i64 0
  %699 = getelementptr inbounds i8, ptr %698, i64 80
  call void @sm4_set_encrypt_key(ptr noundef %695, ptr noundef %699)
  %700 = load ptr, ptr @stderr, align 8, !tbaa !5
  %701 = getelementptr inbounds [255 x i8], ptr %34, i64 0, i64 0
  %702 = getelementptr inbounds [32 x i8], ptr %11, i64 0, i64 0
  %703 = getelementptr inbounds [32 x i8], ptr %12, i64 0, i64 0
  %704 = load ptr, ptr %3, align 8, !tbaa !5
  %705 = getelementptr inbounds %struct.TLS_CONNECT, ptr %704, i32 0, i32 23
  %706 = getelementptr inbounds [48 x i8], ptr %705, i64 0, i64 0
  %707 = load ptr, ptr %3, align 8, !tbaa !5
  %708 = getelementptr inbounds %struct.TLS_CONNECT, ptr %707, i32 0, i32 24
  %709 = getelementptr inbounds [96 x i8], ptr %708, i64 0, i64 0
  %710 = call i32 @tls_secrets_print(ptr noundef %700, ptr noundef %701, i64 noundef 48, ptr noundef %702, ptr noundef %703, ptr noundef %706, ptr noundef %709, i64 noundef 96, i32 noundef 0, i32 noundef 4)
  %711 = load ptr, ptr %6, align 8, !tbaa !5
  %712 = load ptr, ptr %3, align 8, !tbaa !5
  %713 = getelementptr inbounds %struct.TLS_CONNECT, ptr %712, i32 0, i32 4
  %714 = load i32, ptr %713, align 8, !tbaa !20
  %715 = call i32 @tls_record_recv(ptr noundef %711, ptr noundef %8, i32 noundef %714)
  %716 = icmp ne i32 %715, 1
  br i1 %716, label %733, label %717

717:                                              ; preds = %655
  %718 = load ptr, ptr %6, align 8, !tbaa !5
  %719 = getelementptr inbounds i8, ptr %718, i64 1
  %720 = load i8, ptr %719, align 1, !tbaa !21
  %721 = zext i8 %720 to i16
  %722 = zext i16 %721 to i32
  %723 = shl i32 %722, 8
  %724 = load ptr, ptr %6, align 8, !tbaa !5
  %725 = getelementptr inbounds i8, ptr %724, i64 2
  %726 = load i8, ptr %725, align 1, !tbaa !21
  %727 = zext i8 %726 to i32
  %728 = or i32 %723, %727
  %729 = load ptr, ptr %3, align 8, !tbaa !5
  %730 = getelementptr inbounds %struct.TLS_CONNECT, ptr %729, i32 0, i32 0
  %731 = load i32, ptr %730, align 8, !tbaa !22
  %732 = icmp ne i32 %728, %731
  br i1 %732, label %733, label %741

733:                                              ; preds = %717, %655
  br label %734

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

737:                                              ; preds = %734
  br label %738

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

741:                                              ; preds = %717
  %742 = load ptr, ptr %6, align 8, !tbaa !5
  %743 = call i32 @tls_record_get_change_cipher_spec(ptr noundef %742)
  %744 = icmp ne i32 %743, 1
  br i1 %744, label %745, label %753

745:                                              ; preds = %741
  br label %746

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

749:                                              ; preds = %746
  br label %750

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

753:                                              ; preds = %741
  %754 = load ptr, ptr %6, align 8, !tbaa !5
  %755 = load ptr, ptr %3, align 8, !tbaa !5
  %756 = getelementptr inbounds %struct.TLS_CONNECT, ptr %755, i32 0, i32 4
  %757 = load i32, ptr %756, align 8, !tbaa !20
  %758 = call i32 @tls_record_recv(ptr noundef %754, ptr noundef %8, i32 noundef %757)
  %759 = icmp ne i32 %758, 1
  br i1 %759, label %776, label %760

760:                                              ; preds = %753
  %761 = load ptr, ptr %6, align 8, !tbaa !5
  %762 = getelementptr inbounds i8, ptr %761, i64 1
  %763 = load i8, ptr %762, align 1, !tbaa !21
  %764 = zext i8 %763 to i16
  %765 = zext i16 %764 to i32
  %766 = shl i32 %765, 8
  %767 = load ptr, ptr %6, align 8, !tbaa !5
  %768 = getelementptr inbounds i8, ptr %767, i64 2
  %769 = load i8, ptr %768, align 1, !tbaa !21
  %770 = zext i8 %769 to i32
  %771 = or i32 %766, %770
  %772 = load ptr, ptr %3, align 8, !tbaa !5
  %773 = getelementptr inbounds %struct.TLS_CONNECT, ptr %772, i32 0, i32 0
  %774 = load i32, ptr %773, align 8, !tbaa !22
  %775 = icmp ne i32 %771, %774
  br i1 %775, label %776, label %784

776:                                              ; preds = %760, %753
  br label %777

777:                                              ; preds = %776
  %778 = load ptr, ptr @stderr, align 8, !tbaa !5
  %779 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %778, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 985, ptr noundef @__FUNCTION__.tls12_do_accept) #7
  br label %780

780:                                              ; preds = %777
  br label %781

781:                                              ; preds = %780
  %782 = load ptr, ptr %3, align 8, !tbaa !5
  %783 = call i32 @tls_send_alert(ptr noundef %782, i32 noundef 10)
  br label %978

784:                                              ; preds = %760
  %785 = load i64, ptr %8, align 8, !tbaa !23
  %786 = icmp ugt i64 %785, 309
  br i1 %786, label %787, label %795

787:                                              ; preds = %784
  br label %788

788:                                              ; preds = %787
  %789 = load ptr, ptr @stderr, align 8, !tbaa !5
  %790 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %789, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 990, ptr noundef @__FUNCTION__.tls12_do_accept) #7
  br label %791

791:                                              ; preds = %788
  br label %792

792:                                              ; preds = %791
  %793 = load ptr, ptr %3, align 8, !tbaa !5
  %794 = call i32 @tls_send_alert(ptr noundef %793, i32 noundef 10)
  br label %978

795:                                              ; preds = %784
  %796 = load ptr, ptr %3, align 8, !tbaa !5
  %797 = getelementptr inbounds %struct.TLS_CONNECT, ptr %796, i32 0, i32 25
  %798 = load ptr, ptr %3, align 8, !tbaa !5
  %799 = getelementptr inbounds %struct.TLS_CONNECT, ptr %798, i32 0, i32 27
  %800 = load ptr, ptr %3, align 8, !tbaa !5
  %801 = getelementptr inbounds %struct.TLS_CONNECT, ptr %800, i32 0, i32 29
  %802 = getelementptr inbounds [8 x i8], ptr %801, i64 0, i64 0
  %803 = load ptr, ptr %6, align 8, !tbaa !5
  %804 = load i64, ptr %8, align 8, !tbaa !23
  %805 = getelementptr inbounds [309 x i8], ptr %7, i64 0, i64 0
  %806 = call i32 @tls_record_decrypt(ptr noundef %797, ptr noundef %799, ptr noundef %802, ptr noundef %803, i64 noundef %804, ptr noundef %805, ptr noundef %9)
  %807 = icmp ne i32 %806, 1
  br i1 %807, label %808, label %816

808:                                              ; preds = %795
  br label %809

809:                                              ; preds = %808
  %810 = load ptr, ptr @stderr, align 8, !tbaa !5
  %811 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %810, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 1000, ptr noundef @__FUNCTION__.tls12_do_accept) #7
  br label %812

812:                                              ; preds = %809
  br label %813

813:                                              ; preds = %812
  %814 = load ptr, ptr %3, align 8, !tbaa !5
  %815 = call i32 @tls_send_alert(ptr noundef %814, i32 noundef 20)
  br label %978

816:                                              ; preds = %795
  %817 = load ptr, ptr %3, align 8, !tbaa !5
  %818 = getelementptr inbounds %struct.TLS_CONNECT, ptr %817, i32 0, i32 29
  %819 = getelementptr inbounds [8 x i8], ptr %818, i64 0, i64 0
  %820 = call i32 @tls_seq_num_incr(ptr noundef %819)
  %821 = getelementptr inbounds [309 x i8], ptr %7, i64 0, i64 0
  %822 = call i32 @tls_record_get_handshake_finished(ptr noundef %821, ptr noundef %39, ptr noundef %40)
  %823 = icmp ne i32 %822, 1
  br i1 %823, label %824, label %832

824:                                              ; preds = %816
  br label %825

825:                                              ; preds = %824
  %826 = load ptr, ptr @stderr, align 8, !tbaa !5
  %827 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %826, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 1007, ptr noundef @__FUNCTION__.tls12_do_accept) #7
  br label %828

828:                                              ; preds = %825
  br label %829

829:                                              ; preds = %828
  %830 = load ptr, ptr %3, align 8, !tbaa !5
  %831 = call i32 @tls_send_alert(ptr noundef %830, i32 noundef 20)
  br label %978

832:                                              ; preds = %816
  %833 = load i64, ptr %40, align 8, !tbaa !23
  %834 = icmp ne i64 %833, 12
  br i1 %834, label %835, label %843

835:                                              ; preds = %832
  br label %836

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

839:                                              ; preds = %836
  br label %840

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

843:                                              ; preds = %832
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %36, ptr align 8 %35, i64 112, i1 false)
  %844 = getelementptr inbounds [309 x i8], ptr %7, i64 0, i64 0
  %845 = getelementptr inbounds i8, ptr %844, i64 5
  %846 = load i64, ptr %9, align 8, !tbaa !23
  %847 = sub i64 %846, 5
  call void @sm3_update(ptr noundef %35, ptr noundef %845, i64 noundef %847)
  %848 = getelementptr inbounds [32 x i8], ptr %37, i64 0, i64 0
  call void @sm3_finish(ptr noundef %36, ptr noundef %848)
  %849 = load ptr, ptr %3, align 8, !tbaa !5
  %850 = getelementptr inbounds %struct.TLS_CONNECT, ptr %849, i32 0, i32 23
  %851 = getelementptr inbounds [48 x i8], ptr %850, i64 0, i64 0
  %852 = getelementptr inbounds [32 x i8], ptr %37, i64 0, i64 0
  %853 = getelementptr inbounds [12 x i8], ptr %38, i64 0, i64 0
  %854 = call i32 @tls_prf(ptr noundef %851, i64 noundef 48, ptr noundef @.str.5, ptr noundef %852, i64 noundef 32, ptr noundef null, i64 noundef 0, i64 noundef 12, ptr noundef %853)
  %855 = icmp ne i32 %854, 1
  br i1 %855, label %856, label %864

856:                                              ; preds = %843
  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 1023, ptr noundef @__FUNCTION__.tls12_do_accept) #7
  br label %860

860:                                              ; preds = %857
  br label %861

861:                                              ; preds = %860
  %862 = load ptr, ptr %3, align 8, !tbaa !5
  %863 = call i32 @tls_send_alert(ptr noundef %862, i32 noundef 80)
  br label %978

864:                                              ; preds = %843
  %865 = load ptr, ptr %39, align 8, !tbaa !5
  %866 = getelementptr inbounds [12 x i8], ptr %38, i64 0, i64 0
  %867 = call i32 @memcmp(ptr noundef %865, ptr noundef %866, i64 noundef 12) #8
  %868 = icmp ne i32 %867, 0
  br i1 %868, label %869, label %877

869:                                              ; preds = %864
  br label %870

870:                                              ; preds = %869
  %871 = load ptr, ptr @stderr, align 8, !tbaa !5
  %872 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %871, ptr noundef @.str.8, ptr noundef @.str.1, i32 noundef 1028, ptr noundef @__FUNCTION__.tls12_do_accept, ptr noundef @.str.9) #7
  br label %873

873:                                              ; preds = %870
  br label %874

874:                                              ; preds = %873
  %875 = load ptr, ptr %3, align 8, !tbaa !5
  %876 = call i32 @tls_send_alert(ptr noundef %875, i32 noundef 51)
  br label %978

877:                                              ; preds = %864
  %878 = load ptr, ptr %6, align 8, !tbaa !5
  %879 = call i32 @tls_record_set_change_cipher_spec(ptr noundef %878, ptr noundef %8)
  %880 = icmp ne i32 %879, 1
  br i1 %880, label %881, label %889

881:                                              ; preds = %877
  br label %882

882:                                              ; preds = %881
  %883 = load ptr, ptr @stderr, align 8, !tbaa !5
  %884 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %883, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 1036, ptr noundef @__FUNCTION__.tls12_do_accept) #7
  br label %885

885:                                              ; preds = %882
  br label %886

886:                                              ; preds = %885
  %887 = load ptr, ptr %3, align 8, !tbaa !5
  %888 = call i32 @tls_send_alert(ptr noundef %887, i32 noundef 80)
  br label %978

889:                                              ; preds = %877
  %890 = load ptr, ptr %6, align 8, !tbaa !5
  %891 = load i64, ptr %8, align 8, !tbaa !23
  %892 = load ptr, ptr %3, align 8, !tbaa !5
  %893 = getelementptr inbounds %struct.TLS_CONNECT, ptr %892, i32 0, i32 4
  %894 = load i32, ptr %893, align 8, !tbaa !20
  %895 = call i32 @tls_record_send(ptr noundef %890, i64 noundef %891, i32 noundef %894)
  %896 = icmp ne i32 %895, 1
  br i1 %896, label %897, label %903

897:                                              ; preds = %889
  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 1042, ptr noundef @__FUNCTION__.tls12_do_accept) #7
  br label %901

901:                                              ; preds = %898
  br label %902

902:                                              ; preds = %901
  br label %978

903:                                              ; preds = %889
  %904 = getelementptr inbounds [32 x i8], ptr %37, i64 0, i64 0
  call void @sm3_finish(ptr noundef %35, ptr noundef %904)
  %905 = load ptr, ptr %3, align 8, !tbaa !5
  %906 = getelementptr inbounds %struct.TLS_CONNECT, ptr %905, i32 0, i32 23
  %907 = getelementptr inbounds [48 x i8], ptr %906, i64 0, i64 0
  %908 = getelementptr inbounds [32 x i8], ptr %37, i64 0, i64 0
  %909 = getelementptr inbounds [12 x i8], ptr %38, i64 0, i64 0
  %910 = call i32 @tls_prf(ptr noundef %907, i64 noundef 48, ptr noundef @.str.6, ptr noundef %908, i64 noundef 32, ptr noundef null, i64 noundef 0, i64 noundef 12, ptr noundef %909)
  %911 = icmp ne i32 %910, 1
  br i1 %911, label %917, label %912

912:                                              ; preds = %903
  %913 = getelementptr inbounds [309 x i8], ptr %7, i64 0, i64 0
  %914 = getelementptr inbounds [12 x i8], ptr %38, i64 0, i64 0
  %915 = call i32 @tls_record_set_handshake_finished(ptr noundef %913, ptr noundef %9, ptr noundef %914, i64 noundef 12)
  %916 = icmp ne i32 %915, 1
  br i1 %916, label %917, label %925

917:                                              ; preds = %912, %903
  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 1053, ptr noundef @__FUNCTION__.tls12_do_accept) #7
  br label %921

921:                                              ; preds = %918
  br label %922

922:                                              ; preds = %921
  %923 = load ptr, ptr %3, align 8, !tbaa !5
  %924 = call i32 @tls_send_alert(ptr noundef %923, i32 noundef 80)
  br label %978

925:                                              ; preds = %912
  %926 = load ptr, ptr %3, align 8, !tbaa !5
  %927 = getelementptr inbounds %struct.TLS_CONNECT, ptr %926, i32 0, i32 26
  %928 = load ptr, ptr %3, align 8, !tbaa !5
  %929 = getelementptr inbounds %struct.TLS_CONNECT, ptr %928, i32 0, i32 28
  %930 = load ptr, ptr %3, align 8, !tbaa !5
  %931 = getelementptr inbounds %struct.TLS_CONNECT, ptr %930, i32 0, i32 30
  %932 = getelementptr inbounds [8 x i8], ptr %931, i64 0, i64 0
  %933 = getelementptr inbounds [309 x i8], ptr %7, i64 0, i64 0
  %934 = load i64, ptr %9, align 8, !tbaa !23
  %935 = load ptr, ptr %6, align 8, !tbaa !5
  %936 = call i32 @tls_record_encrypt(ptr noundef %927, ptr noundef %929, ptr noundef %932, ptr noundef %933, i64 noundef %934, ptr noundef %935, ptr noundef %8)
  %937 = icmp ne i32 %936, 1
  br i1 %937, label %938, label %946

938:                                              ; preds = %925
  br label %939

939:                                              ; preds = %938
  %940 = load ptr, ptr @stderr, align 8, !tbaa !5
  %941 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %940, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 1060, ptr noundef @__FUNCTION__.tls12_do_accept) #7
  br label %942

942:                                              ; preds = %939
  br label %943

943:                                              ; preds = %942
  %944 = load ptr, ptr %3, align 8, !tbaa !5
  %945 = call i32 @tls_send_alert(ptr noundef %944, i32 noundef 80)
  br label %978

946:                                              ; preds = %925
  %947 = load ptr, ptr %3, align 8, !tbaa !5
  %948 = getelementptr inbounds %struct.TLS_CONNECT, ptr %947, i32 0, i32 30
  %949 = getelementptr inbounds [8 x i8], ptr %948, i64 0, i64 0
  %950 = call i32 @tls_seq_num_incr(ptr noundef %949)
  %951 = load ptr, ptr %6, align 8, !tbaa !5
  %952 = load i64, ptr %8, align 8, !tbaa !23
  %953 = load ptr, ptr %3, align 8, !tbaa !5
  %954 = getelementptr inbounds %struct.TLS_CONNECT, ptr %953, i32 0, i32 4
  %955 = load i32, ptr %954, align 8, !tbaa !20
  %956 = call i32 @tls_record_send(ptr noundef %951, i64 noundef %952, i32 noundef %955)
  %957 = icmp ne i32 %956, 1
  br i1 %957, label %958, label %964

958:                                              ; preds = %946
  br label %959

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

962:                                              ; preds = %959
  br label %963

963:                                              ; preds = %962
  br label %978

964:                                              ; preds = %946
  %965 = load ptr, ptr %3, align 8, !tbaa !5
  %966 = getelementptr inbounds %struct.TLS_CONNECT, ptr %965, i32 0, i32 0
  %967 = load i32, ptr %966, align 8, !tbaa !22
  %968 = load ptr, ptr %3, align 8, !tbaa !5
  %969 = getelementptr inbounds %struct.TLS_CONNECT, ptr %968, i32 0, i32 0
  store i32 %967, ptr %969, align 8, !tbaa !22
  %970 = load ptr, ptr %3, align 8, !tbaa !5
  %971 = getelementptr inbounds %struct.TLS_CONNECT, ptr %970, i32 0, i32 35
  %972 = load i32, ptr %971, align 8, !tbaa !27
  %973 = icmp ne i32 %972, 0
  br i1 %973, label %977, label %974

974:                                              ; preds = %964
  %975 = load ptr, ptr @stderr, align 8, !tbaa !5
  %976 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %975, ptr noundef @.str.10) #7
  br label %977

977:                                              ; preds = %974, %964
  store i32 1, ptr %4, align 4, !tbaa !9
  br label %978

978:                                              ; preds = %977, %963, %943, %922, %902, %886, %874, %861, %840, %829, %813, %792, %781, %750, %738, %647, %634, %614, %602, %553, %541, %500, %477, %460, %413, %395, %325, %309, %264, %248, %219, %203, %154, %136, %122, %110, %73
  call void @gmssl_secure_clear(ptr noundef %25, i64 noundef 3976)
  %979 = getelementptr inbounds [255 x i8], ptr %34, i64 0, i64 0
  call void @gmssl_secure_clear(ptr noundef %979, i64 noundef 255)
  %980 = load i32, ptr %5, align 4, !tbaa !9
  %981 = icmp ne i32 %980, 0
  br i1 %981, label %982, label %983

982:                                              ; preds = %978
  call void @tls_client_verify_cleanup(ptr noundef %28)
  br label %983

983:                                              ; preds = %982, %978
  %984 = load i32, ptr %4, align 4, !tbaa !9
  store i32 %984, ptr %2, align 4
  store i32 1, ptr %43, align 4
  br label %985

985:                                              ; preds = %983, %395, %293
  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 8, ptr %39) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %38) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %37) #7
  call void @llvm.lifetime.end.p0(i64 112, ptr %36) #7
  call void @llvm.lifetime.end.p0(i64 112, ptr %35) #7
  call void @llvm.lifetime.end.p0(i64 255, ptr %34) #7
  call void @llvm.lifetime.end.p0(i64 96, ptr %33) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #7
  call void @llvm.lifetime.end.p0(i64 128, ptr %29) #7
  call void @llvm.lifetime.end.p0(i64 136, ptr %28) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #7
  call void @llvm.lifetime.end.p0(i64 72, ptr %26) #7
  call void @llvm.lifetime.end.p0(i64 3976, ptr %25) #7
  call void @llvm.lifetime.end.p0(i64 128, ptr %24) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 512, 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
  %986 = load i32, ptr %2, align 4
  ret i32 %986
}

declare i32 @tls_client_verify_init(ptr noundef) #3

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_process_client_hello_exts(ptr noundef, i64 noundef, ptr noundef, ptr noundef, i64 noundef) #3

declare i32 @tls_client_verify_update(ptr noundef, ptr noundef, i64 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

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

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 @tls_record_get_handshake_certificate_verify(ptr noundef, ptr noundef, ptr noundef) #3

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

declare void @tls_client_verify_cleanup(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: write) }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { nounwind willreturn memory(read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nounwind }
attributes #8 = { nounwind willreturn memory(read) }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !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 = !{!12, !10, i64 0}
!23 = !{!13, !13, i64 0}
!24 = !{!12, !10, i64 55624}
!25 = !{!12, !13, i64 57720}
!26 = !{!12, !13, i64 59776}
!27 = !{!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_KEY = type { %struct.SM2_Z256_POINT, [4 x i64] }
%struct.SM2_Z256_POINT = type { [4 x i64], [4 x i64], [4 x i64] }
%struct.SM2_SIGN_CTX = type { %struct.SM3_CTX, %struct.SM3_CTX, %struct.SM2_KEY, [4 x i64], [32 x %struct.SM2_SIGN_PRE_COMP], i32, [16 x %struct.SM2_Z256_POINT] }
%struct.SM3_CTX = type { [8 x i32], i64, [64 x i8], i64 }
%struct.SM2_SIGN_PRE_COMP = type { [4 x i64], [4 x i64] }
%struct.TLS_CLIENT_VERIFY_CTX = type { i32, [8 x ptr], [8 x i64] }

@stderr = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [13 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [59 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [16 x i8], align 1
@__const.tls12_do_accept.server_ciphers = external hidden unnamed_addr constant [1 x i32], align 4
@__FUNCTION__.tls12_do_accept = external hidden unnamed_addr constant [16 x i8], align 1
@__const.tls12_do_accept.cert_types = external hidden unnamed_addr constant [1 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [26 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local i32 @tls_record_set_handshake_server_key_exchange_ecdhe(ptr noundef, ptr noundef, i32 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

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

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

declare void @sm3_init(ptr noundef) local_unnamed_addr #3

declare i32 @tls_random_generate(ptr noundef) local_unnamed_addr #3

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

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

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

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

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

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

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

declare 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 @sm2_key_generate(ptr noundef) local_unnamed_addr #3

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

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

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

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

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

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

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

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

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

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

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

declare i32 @tls_seq_num_incr(ptr noundef) local_unnamed_addr #3

declare i32 @tls_record_get_change_cipher_spec(ptr noundef) local_unnamed_addr #3

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

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

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @tls12_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 [512 x i8], align 16
  %17 = alloca i64, align 8
  %18 = alloca %struct.SM2_KEY, align 8
  %19 = alloca %struct.SM2_SIGN_CTX, align 8
  %20 = alloca [72 x i8], align 16
  %21 = alloca i64, align 8
  %22 = alloca %struct.TLS_CLIENT_VERIFY_CTX, align 8
  %23 = alloca %struct.SM2_KEY, align 8
  %24 = alloca ptr, align 8
  %25 = alloca i32, align 4
  %26 = alloca %struct.SM2_Z256_POINT, align 8
  %27 = alloca [255 x i8], align 16
  %28 = alloca %struct.SM3_CTX, align 8
  %29 = alloca %struct.SM3_CTX, align 8
  %30 = alloca [32 x i8], align 16
  %31 = alloca [12 x i8], align 1
  %32 = alloca ptr, align 8
  %33 = alloca i64, align 8
  %34 = alloca ptr, align 8
  %35 = alloca i64, align 8
  %36 = alloca [1 x i8], align 1
  %37 = alloca [16377 x i8], align 16
  %38 = alloca i64, align 8
  %39 = alloca [64 x i8], align 16
  %40 = 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
  %41 = load i32, ptr @__const.tls12_do_accept.server_ciphers, align 4
  store i32 %41, 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 512, ptr nonnull %16) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %17) #7
  call void @llvm.lifetime.start.p0(i64 128, 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 136, ptr nonnull %22) #7
  call void @llvm.lifetime.start.p0(i64 128, 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 96, ptr nonnull %26) #7
  call void @llvm.lifetime.start.p0(i64 255, ptr nonnull %27) #7
  call void @llvm.lifetime.start.p0(i64 112, ptr nonnull %28) #7
  call void @llvm.lifetime.start.p0(i64 112, ptr nonnull %29) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %30) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %31) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %32) #7
  call void @llvm.lifetime.start.p0(i64 8, 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
  %42 = getelementptr inbounds i8, ptr %0, i64 61832
  %43 = load i64, ptr %42, align 8, !tbaa !5
  %.not = icmp eq i64 %43, 0
  call void @sm3_init(ptr noundef nonnull %28) #7
  br i1 %.not, label %46, label %44

44:                                               ; preds = %1
  %45 = call i32 @tls_client_verify_init(ptr noundef nonnull %22) #7
  br label %46

46:                                               ; preds = %44, %1
  %47 = getelementptr inbounds i8, ptr %0, i64 272
  %48 = load i32, ptr %47, align 8, !tbaa !18
  %49 = call i32 @tls_record_recv(ptr noundef nonnull %40, ptr noundef nonnull %3, i32 noundef %48) #7
  %.not174 = icmp eq i32 %49, 1
  br i1 %.not174, label %54, label %50

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

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

64:                                               ; preds = %54
  %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 731, ptr noundef nonnull @__FUNCTION__.tls12_do_accept) #8
  %67 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 70) #7
  br label %462

68:                                               ; preds = %54
  %69 = call i32 @tls_record_get_handshake_client_hello(ptr noundef nonnull %40, 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
  %.not177 = icmp eq i32 %69, 1
  br i1 %.not177, 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 739, ptr noundef nonnull @__FUNCTION__.tls12_do_accept) #8
  %73 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 10) #7
  br label %462

74:                                               ; preds = %68
  %75 = load i32, ptr %8, align 4, !tbaa !22
  %76 = load i32, ptr %0, align 8, !tbaa !21
  %.not178 = icmp eq i32 %75, %76
  br i1 %.not178, label %81, label %77

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

81:                                               ; preds = %74
  %82 = 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) %82, i64 32, i1 false)
  %83 = load ptr, ptr %12, align 8, !tbaa !19
  %84 = load i64, ptr %13, align 8, !tbaa !23
  %85 = getelementptr inbounds i8, ptr %0, i64 55624
  %86 = call i32 @tls_cipher_suites_select(ptr noundef %83, i64 noundef %84, ptr noundef nonnull %5, i64 noundef 1, ptr noundef nonnull %85) #7
  %.not179 = icmp eq i32 %86, 1
  br i1 %.not179, label %91, label %87

87:                                               ; preds = %81
  %88 = load ptr, ptr @stderr, align 8, !tbaa !19
  %89 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %88, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 752, ptr noundef nonnull @__FUNCTION__.tls12_do_accept) #8
  %90 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 71) #7
  br label %462

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

93:                                               ; preds = %91
  store i64 0, ptr %17, align 8, !tbaa !23
  %94 = load i64, ptr %15, align 8, !tbaa !23
  %95 = call i32 @tls_process_client_hello_exts(ptr noundef nonnull %92, i64 noundef %94, ptr noundef nonnull %16, ptr noundef nonnull %17, i64 noundef 512) #7
  br label %96

96:                                               ; preds = %93, %91
  %97 = getelementptr inbounds i8, ptr %0, i64 18733
  %98 = load i64, ptr %3, align 8, !tbaa !23
  %99 = add i64 %98, -5
  call void @sm3_update(ptr noundef nonnull %28, ptr noundef nonnull %97, i64 noundef %99) #7
  br i1 %.not, label %104, label %100

100:                                              ; preds = %96
  %101 = load i64, ptr %3, align 8, !tbaa !23
  %102 = add i64 %101, -5
  %103 = call i32 @tls_client_verify_update(ptr noundef nonnull %22, ptr noundef nonnull %97, i64 noundef %102) #7
  br label %104

104:                                              ; preds = %100, %96
  %105 = call i32 @tls_random_generate(ptr noundef nonnull %7) #7
  %106 = load i32, ptr %0, align 8, !tbaa !21
  %107 = call i32 @tls_record_set_protocol(ptr noundef nonnull %40, i32 noundef %106) #7
  %108 = load i32, ptr %0, align 8, !tbaa !21
  %109 = load i32, ptr %85, align 8, !tbaa !24
  %110 = load i64, ptr %17, align 8, !tbaa !23
  %111 = call i32 @tls_record_set_handshake_server_hello(ptr noundef nonnull %40, ptr noundef nonnull %3, i32 noundef %108, ptr noundef nonnull %7, ptr noundef null, i64 noundef 0, i32 noundef %109, ptr noundef nonnull %16, i64 noundef %110) #7
  %.not181 = icmp eq i32 %111, 1
  br i1 %.not181, label %116, label %112

112:                                              ; preds = %104
  %113 = load ptr, ptr @stderr, align 8, !tbaa !19
  %114 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %113, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 777, ptr noundef nonnull @__FUNCTION__.tls12_do_accept) #8
  %115 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 80) #7
  br label %462

116:                                              ; preds = %104
  %117 = load i64, ptr %3, align 8, !tbaa !23
  %118 = load i32, ptr %47, align 8, !tbaa !18
  %119 = call i32 @tls_record_send(ptr noundef nonnull %40, i64 noundef %117, i32 noundef %118) #7
  %.not182 = icmp eq i32 %119, 1
  br i1 %.not182, label %123, label %120

120:                                              ; preds = %116
  %121 = load ptr, ptr @stderr, align 8, !tbaa !19
  %122 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %121, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 783, ptr noundef nonnull @__FUNCTION__.tls12_do_accept) #8
  br label %462

123:                                              ; preds = %116
  %124 = load i64, ptr %3, align 8, !tbaa !23
  %125 = add i64 %124, -5
  call void @sm3_update(ptr noundef nonnull %28, ptr noundef nonnull %97, i64 noundef %125) #7
  br i1 %.not, label %130, label %126

126:                                              ; preds = %123
  %127 = load i64, ptr %3, align 8, !tbaa !23
  %128 = add i64 %127, -5
  %129 = call i32 @tls_client_verify_update(ptr noundef nonnull %22, ptr noundef nonnull %97, i64 noundef %128) #7
  br label %130

130:                                              ; preds = %126, %123
  %131 = getelementptr inbounds i8, ptr %0, i64 55672
  %132 = getelementptr inbounds i8, ptr %0, i64 57720
  %133 = load i64, ptr %132, align 8, !tbaa !25
  %134 = call i32 @tls_record_set_handshake_certificate(ptr noundef nonnull %40, ptr noundef nonnull %3, ptr noundef nonnull %131, i64 noundef %133) #7
  %.not183 = icmp eq i32 %134, 1
  br i1 %.not183, label %139, label %135

135:                                              ; preds = %130
  %136 = load ptr, ptr @stderr, align 8, !tbaa !19
  %137 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %136, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 794, ptr noundef nonnull @__FUNCTION__.tls12_do_accept) #8
  %138 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 80) #7
  br label %462

139:                                              ; preds = %130
  %140 = load i64, ptr %3, align 8, !tbaa !23
  %141 = load i32, ptr %47, align 8, !tbaa !18
  %142 = call i32 @tls_record_send(ptr noundef nonnull %40, i64 noundef %140, i32 noundef %141) #7
  %.not184 = icmp eq i32 %142, 1
  br i1 %.not184, label %146, label %143

143:                                              ; preds = %139
  %144 = load ptr, ptr @stderr, align 8, !tbaa !19
  %145 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %144, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 800, ptr noundef nonnull @__FUNCTION__.tls12_do_accept) #8
  br label %462

146:                                              ; preds = %139
  %147 = load i64, ptr %3, align 8, !tbaa !23
  %148 = add i64 %147, -5
  call void @sm3_update(ptr noundef nonnull %28, ptr noundef nonnull %97, i64 noundef %148) #7
  br i1 %.not, label %153, label %149

149:                                              ; preds = %146
  %150 = load i64, ptr %3, align 8, !tbaa !23
  %151 = add i64 %150, -5
  %152 = call i32 @tls_client_verify_update(ptr noundef nonnull %22, ptr noundef nonnull %97, i64 noundef %151) #7
  br label %153

153:                                              ; preds = %149, %146
  %154 = call i32 @sm2_key_generate(ptr noundef nonnull %18) #7
  %155 = getelementptr inbounds i8, ptr %0, i64 61840
  %156 = call i32 @tls_sign_server_ecdh_params(ptr noundef nonnull %155, ptr noundef nonnull %6, ptr noundef nonnull %7, i32 noundef 41, ptr noundef nonnull %18, ptr noundef nonnull %20, ptr noundef nonnull %21) #7
  %.not185 = icmp eq i32 %156, 1
  br i1 %.not185, label %161, label %157

157:                                              ; preds = %153
  %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 813, ptr noundef nonnull @__FUNCTION__.tls12_do_accept) #8
  %160 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 80) #7
  br label %464

161:                                              ; preds = %153
  %162 = load i64, ptr %21, align 8, !tbaa !23
  %163 = call i32 @tls_record_set_handshake_server_key_exchange_ecdhe(ptr noundef nonnull %40, ptr noundef nonnull %3, i32 noundef 41, ptr noundef nonnull %18, ptr noundef nonnull %20, i64 noundef %162)
  %.not186 = icmp eq i32 %163, 1
  br i1 %.not186, 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 819, ptr noundef nonnull @__FUNCTION__.tls12_do_accept) #8
  %167 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 80) #7
  br label %462

168:                                              ; preds = %161
  %169 = load i64, ptr %3, align 8, !tbaa !23
  %170 = load i32, ptr %47, align 8, !tbaa !18
  %171 = call i32 @tls_record_send(ptr noundef nonnull %40, i64 noundef %169, i32 noundef %170) #7
  %.not187 = icmp eq i32 %171, 1
  br i1 %.not187, 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 825, ptr noundef nonnull @__FUNCTION__.tls12_do_accept) #8
  br label %462

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

178:                                              ; preds = %175
  %179 = load i64, ptr %3, align 8, !tbaa !23
  %180 = add i64 %179, -5
  %181 = call i32 @tls_client_verify_update(ptr noundef nonnull %22, ptr noundef nonnull %97, i64 noundef %180) #7
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %36) #7
  %182 = load i8, ptr @__const.tls12_do_accept.cert_types, align 1
  store i8 %182, ptr %36, align 1
  call void @llvm.lifetime.start.p0(i64 16377, ptr nonnull %37) #7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(16377) %37, i8 0, i64 16377, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %38) #7
  store i64 0, ptr %38, align 8, !tbaa !23
  %183 = getelementptr inbounds i8, ptr %0, i64 59784
  %184 = load i64, ptr %42, align 8, !tbaa !5
  %185 = call i32 @tls_authorities_from_certs(ptr noundef nonnull %37, ptr noundef nonnull %38, i64 noundef 16377, ptr noundef nonnull %183, i64 noundef %184) #7
  %.not188 = icmp eq i32 %185, 1
  br i1 %.not188, label %186, label %.thread

186:                                              ; preds = %178
  %187 = load i64, ptr %38, align 8, !tbaa !23
  %188 = call i32 @tls_record_set_handshake_certificate_request(ptr noundef nonnull %40, ptr noundef nonnull %3, ptr noundef nonnull %36, i64 noundef 1, ptr noundef nonnull %37, i64 noundef %187) #7
  %.not189 = icmp eq i32 %188, 1
  br i1 %.not189, label %189, label %.thread

189:                                              ; preds = %186
  %190 = load i64, ptr %3, align 8, !tbaa !23
  %191 = load i32, ptr %47, align 8, !tbaa !18
  %192 = call i32 @tls_record_send(ptr noundef nonnull %40, i64 noundef %190, i32 noundef %191) #7
  %.not190 = icmp eq i32 %192, 1
  br i1 %.not190, label %195, label %.thread

.thread:                                          ; preds = %189, %186, %178
  %.sink228 = phi i32 [ 841, %178 ], [ 847, %186 ], [ 852, %189 ]
  %193 = load ptr, ptr @stderr, align 8, !tbaa !19
  %194 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %193, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef %.sink228, ptr noundef nonnull @__FUNCTION__.tls12_do_accept) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %38) #7
  call void @llvm.lifetime.end.p0(i64 16377, ptr nonnull %37) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %36) #7
  br label %462

195:                                              ; preds = %189
  %196 = load i64, ptr %3, align 8, !tbaa !23
  %197 = add i64 %196, -5
  call void @sm3_update(ptr noundef nonnull %28, ptr noundef nonnull %97, i64 noundef %197) #7
  %198 = load i64, ptr %3, align 8, !tbaa !23
  %199 = add i64 %198, -5
  %200 = call i32 @tls_client_verify_update(ptr noundef nonnull %22, ptr noundef nonnull %97, i64 noundef %199) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %38) #7
  call void @llvm.lifetime.end.p0(i64 16377, ptr nonnull %37) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %36) #7
  br label %.critedge

.critedge:                                        ; preds = %195, %175
  %201 = call i32 @tls_record_set_handshake_server_hello_done(ptr noundef nonnull %40, ptr noundef nonnull %3) #7
  %202 = load i64, ptr %3, align 8, !tbaa !23
  %203 = load i32, ptr %47, align 8, !tbaa !18
  %204 = call i32 @tls_record_send(ptr noundef nonnull %40, i64 noundef %202, i32 noundef %203) #7
  %.not191 = icmp eq i32 %204, 1
  br i1 %.not191, label %208, label %205

205:                                              ; preds = %.critedge
  %206 = load ptr, ptr @stderr, align 8, !tbaa !19
  %207 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %206, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 864, ptr noundef nonnull @__FUNCTION__.tls12_do_accept) #8
  br label %462

208:                                              ; preds = %.critedge
  %209 = load i64, ptr %3, align 8, !tbaa !23
  %210 = add i64 %209, -5
  call void @sm3_update(ptr noundef nonnull %28, ptr noundef nonnull %97, i64 noundef %210) #7
  br i1 %.not, label %215, label %211

211:                                              ; preds = %208
  %212 = load i64, ptr %3, align 8, !tbaa !23
  %213 = add i64 %212, -5
  %214 = call i32 @tls_client_verify_update(ptr noundef nonnull %22, ptr noundef nonnull %97, i64 noundef %213) #7
  br label %215

215:                                              ; preds = %211, %208
  %216 = load i64, ptr %42, align 8, !tbaa !5
  %.not192 = icmp eq i64 %216, 0
  br i1 %.not192, label %255, label %217

217:                                              ; preds = %215
  %218 = load i32, ptr %47, align 8, !tbaa !18
  %219 = call i32 @tls_record_recv(ptr noundef nonnull %40, ptr noundef nonnull %3, i32 noundef %218) #7
  %.not193 = icmp eq i32 %219, 1
  br i1 %.not193, label %220, label %228

220:                                              ; preds = %217
  %221 = load i8, ptr %55, align 1, !tbaa !20
  %222 = zext i8 %221 to i32
  %223 = shl nuw nsw i32 %222, 8
  %224 = load i8, ptr %59, align 1, !tbaa !20
  %225 = zext i8 %224 to i32
  %226 = or disjoint i32 %223, %225
  %227 = load i32, ptr %0, align 8, !tbaa !21
  %.not194 = icmp eq i32 %226, %227
  br i1 %.not194, label %232, label %228

228:                                              ; preds = %217, %220
  %229 = load ptr, ptr @stderr, align 8, !tbaa !19
  %230 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %229, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 876, ptr noundef nonnull @__FUNCTION__.tls12_do_accept) #8
  %231 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 10) #7
  br label %462

232:                                              ; preds = %220
  %233 = getelementptr inbounds i8, ptr %0, i64 57728
  %234 = getelementptr inbounds i8, ptr %0, i64 59776
  %235 = call i32 @tls_record_get_handshake_certificate(ptr noundef nonnull %40, ptr noundef nonnull %233, ptr noundef nonnull %234) #7
  %.not195 = icmp eq i32 %235, 1
  br i1 %.not195, label %240, label %236

236:                                              ; preds = %232
  %237 = load ptr, ptr @stderr, align 8, !tbaa !19
  %238 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %237, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 882, ptr noundef nonnull @__FUNCTION__.tls12_do_accept) #8
  %239 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 10) #7
  br label %462

240:                                              ; preds = %232
  %241 = load i64, ptr %234, align 8, !tbaa !26
  %242 = getelementptr inbounds i8, ptr %0, i64 59784
  %243 = load i64, ptr %42, align 8, !tbaa !5
  %244 = call i32 @x509_certs_verify(ptr noundef nonnull %233, i64 noundef %241, i32 noundef 1, ptr noundef nonnull %242, i64 noundef %243, i32 noundef 5, ptr noundef nonnull %25) #7
  %.not196 = icmp eq i32 %244, 1
  br i1 %.not196, label %249, label %245

245:                                              ; preds = %240
  %246 = load ptr, ptr @stderr, align 8, !tbaa !19
  %247 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %246, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 888, ptr noundef nonnull @__FUNCTION__.tls12_do_accept) #8
  %248 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 42) #7
  br label %462

249:                                              ; preds = %240
  %250 = load i64, ptr %3, align 8, !tbaa !23
  %251 = add i64 %250, -5
  call void @sm3_update(ptr noundef nonnull %28, ptr noundef nonnull %97, i64 noundef %251) #7
  %252 = load i64, ptr %3, align 8, !tbaa !23
  %253 = add i64 %252, -5
  %254 = call i32 @tls_client_verify_update(ptr noundef nonnull %22, ptr noundef nonnull %97, i64 noundef %253) #7
  br label %255

255:                                              ; preds = %249, %215
  %256 = load i32, ptr %47, align 8, !tbaa !18
  %257 = call i32 @tls_record_recv(ptr noundef nonnull %40, ptr noundef nonnull %3, i32 noundef %256) #7
  %.not197 = icmp eq i32 %257, 1
  br i1 %.not197, label %258, label %266

258:                                              ; preds = %255
  %259 = load i8, ptr %55, align 1, !tbaa !20
  %260 = zext i8 %259 to i32
  %261 = shl nuw nsw i32 %260, 8
  %262 = load i8, ptr %59, align 1, !tbaa !20
  %263 = zext i8 %262 to i32
  %264 = or disjoint i32 %261, %263
  %265 = load i32, ptr %0, align 8, !tbaa !21
  %.not198 = icmp eq i32 %264, %265
  br i1 %.not198, label %270, label %266

266:                                              ; preds = %255, %258
  %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 900, ptr noundef nonnull @__FUNCTION__.tls12_do_accept) #8
  %269 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 10) #7
  br label %462

270:                                              ; preds = %258
  %271 = call i32 @tls_record_get_handshake_client_key_exchange_ecdhe(ptr noundef nonnull %40, ptr noundef nonnull %26)
  %.not199 = icmp eq i32 %271, 1
  br i1 %.not199, 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 906, ptr noundef nonnull @__FUNCTION__.tls12_do_accept) #8
  %275 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 10) #7
  br label %462

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

279:                                              ; preds = %276
  %280 = load i64, ptr %3, align 8, !tbaa !23
  %281 = add i64 %280, -5
  %282 = call i32 @tls_client_verify_update(ptr noundef nonnull %22, ptr noundef nonnull %97, i64 noundef %281) #7
  %283 = load i32, ptr %47, align 8, !tbaa !18
  %284 = call i32 @tls_record_recv(ptr noundef nonnull %40, ptr noundef nonnull %3, i32 noundef %283) #7
  %.not200 = icmp eq i32 %284, 1
  br i1 %.not200, label %285, label %293

285:                                              ; preds = %279
  %286 = load i8, ptr %55, align 1, !tbaa !20
  %287 = zext i8 %286 to i32
  %288 = shl nuw nsw i32 %287, 8
  %289 = load i8, ptr %59, align 1, !tbaa !20
  %290 = zext i8 %289 to i32
  %291 = or disjoint i32 %288, %290
  %292 = load i32, ptr %0, align 8, !tbaa !21
  %.not201 = icmp eq i32 %291, %292
  br i1 %.not201, label %297, label %293

293:                                              ; preds = %285, %279
  %294 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 10) #7
  %295 = load ptr, ptr @stderr, align 8, !tbaa !19
  %296 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %295, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 921, ptr noundef nonnull @__FUNCTION__.tls12_do_accept) #8
  br label %462

297:                                              ; preds = %285
  %298 = call i32 @tls_record_get_handshake_certificate_verify(ptr noundef nonnull %40, ptr noundef nonnull %24, ptr noundef nonnull %21) #7
  %.not202 = icmp eq i32 %298, 1
  br i1 %.not202, label %303, label %299

299:                                              ; preds = %297
  %300 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 10) #7
  %301 = load ptr, ptr @stderr, align 8, !tbaa !19
  %302 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %301, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 927, ptr noundef nonnull @__FUNCTION__.tls12_do_accept) #8
  br label %462

303:                                              ; preds = %297
  %304 = getelementptr inbounds i8, ptr %0, i64 57728
  %305 = getelementptr inbounds i8, ptr %0, i64 59776
  %306 = load i64, ptr %305, align 8, !tbaa !26
  %307 = call i32 @x509_certs_get_cert_by_index(ptr noundef nonnull %304, i64 noundef %306, i32 noundef 0, ptr noundef nonnull %34, ptr noundef nonnull %35) #7
  %.not203 = icmp eq i32 %307, 1
  br i1 %.not203, label %308, label %312

308:                                              ; preds = %303
  %309 = load ptr, ptr %34, align 8, !tbaa !19
  %310 = load i64, ptr %35, align 8, !tbaa !23
  %311 = call i32 @x509_cert_get_subject_public_key(ptr noundef %309, i64 noundef %310, ptr noundef nonnull %23) #7
  %.not204 = icmp eq i32 %311, 1
  br i1 %.not204, label %316, label %312

312:                                              ; preds = %303, %308
  %313 = load ptr, ptr @stderr, align 8, !tbaa !19
  %314 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %313, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 932, ptr noundef nonnull @__FUNCTION__.tls12_do_accept) #8
  %315 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 42) #7
  br label %462

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

320:                                              ; preds = %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 937, ptr noundef nonnull @__FUNCTION__.tls12_do_accept) #8
  %323 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 51) #7
  br label %462

324:                                              ; preds = %316
  %325 = load i64, ptr %3, align 8, !tbaa !23
  %326 = add i64 %325, -5
  call void @sm3_update(ptr noundef nonnull %28, ptr noundef nonnull %97, i64 noundef %326) #7
  br label %.critedge225

.critedge225:                                     ; preds = %276, %324
  %327 = call i32 @sm2_do_ecdh(ptr noundef nonnull %18, ptr noundef nonnull %26, ptr noundef nonnull %26) #7
  %328 = call i32 @sm2_z256_point_to_bytes(ptr noundef nonnull %26, ptr noundef nonnull %39) #7
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) %27, ptr noundef nonnull align 16 dereferenceable(32) %39, i64 32, i1 false)
  %329 = getelementptr inbounds i8, ptr %0, i64 62100
  %330 = call i32 @tls_prf(ptr noundef nonnull %27, i64 noundef 32, ptr noundef nonnull @.str.3, ptr noundef nonnull %6, i64 noundef 32, ptr noundef nonnull %7, i64 noundef 32, i64 noundef 48, ptr noundef nonnull %329) #7
  %331 = getelementptr inbounds i8, ptr %0, i64 62148
  %332 = call i32 @tls_prf(ptr noundef nonnull %329, i64 noundef 48, ptr noundef nonnull @.str.4, ptr noundef nonnull %7, i64 noundef 32, ptr noundef nonnull %6, i64 noundef 32, i64 noundef 96, ptr noundef nonnull %331) #7
  %333 = getelementptr inbounds i8, ptr %0, i64 62248
  call void @sm3_hmac_init(ptr noundef nonnull %333, ptr noundef nonnull %331, i64 noundef 32) #7
  %334 = getelementptr inbounds i8, ptr %0, i64 62424
  %335 = getelementptr inbounds i8, ptr %0, i64 62180
  call void @sm3_hmac_init(ptr noundef nonnull %334, ptr noundef nonnull %335, i64 noundef 32) #7
  %336 = getelementptr inbounds i8, ptr %0, i64 62600
  %337 = getelementptr inbounds i8, ptr %0, i64 62212
  call void @sm4_set_decrypt_key(ptr noundef nonnull %336, ptr noundef nonnull %337) #7
  %338 = getelementptr inbounds i8, ptr %0, i64 62728
  %339 = getelementptr inbounds i8, ptr %0, i64 62228
  call void @sm4_set_encrypt_key(ptr noundef nonnull %338, ptr noundef nonnull %339) #7
  %340 = load ptr, ptr @stderr, align 8, !tbaa !19
  %341 = call i32 @tls_secrets_print(ptr noundef %340, ptr noundef nonnull %27, i64 noundef 48, ptr noundef nonnull %6, ptr noundef nonnull %7, ptr noundef nonnull %329, ptr noundef nonnull %331, i64 noundef 96, i32 noundef 0, i32 noundef 4) #7
  %342 = load i32, ptr %47, align 8, !tbaa !18
  %343 = call i32 @tls_record_recv(ptr noundef nonnull %40, ptr noundef nonnull %3, i32 noundef %342) #7
  %.not206 = icmp eq i32 %343, 1
  br i1 %.not206, label %344, label %352

344:                                              ; preds = %.critedge225
  %345 = load i8, ptr %55, align 1, !tbaa !20
  %346 = zext i8 %345 to i32
  %347 = shl nuw nsw i32 %346, 8
  %348 = load i8, ptr %59, align 1, !tbaa !20
  %349 = zext i8 %348 to i32
  %350 = or disjoint i32 %347, %349
  %351 = load i32, ptr %0, align 8, !tbaa !21
  %.not207 = icmp eq i32 %350, %351
  br i1 %.not207, label %356, label %352

352:                                              ; preds = %.critedge225, %344
  %353 = load ptr, ptr @stderr, align 8, !tbaa !19
  %354 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %353, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 970, ptr noundef nonnull @__FUNCTION__.tls12_do_accept) #8
  %355 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 10) #7
  br label %462

356:                                              ; preds = %344
  %357 = call i32 @tls_record_get_change_cipher_spec(ptr noundef nonnull %40) #7
  %.not208 = icmp eq i32 %357, 1
  br i1 %.not208, label %362, label %358

358:                                              ; preds = %356
  %359 = load ptr, ptr @stderr, align 8, !tbaa !19
  %360 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %359, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 976, ptr noundef nonnull @__FUNCTION__.tls12_do_accept) #8
  %361 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 10) #7
  br label %462

362:                                              ; preds = %356
  %363 = load i32, ptr %47, align 8, !tbaa !18
  %364 = call i32 @tls_record_recv(ptr noundef nonnull %40, ptr noundef nonnull %3, i32 noundef %363) #7
  %.not209 = icmp eq i32 %364, 1
  br i1 %.not209, label %365, label %373

365:                                              ; preds = %362
  %366 = load i8, ptr %55, align 1, !tbaa !20
  %367 = zext i8 %366 to i32
  %368 = shl nuw nsw i32 %367, 8
  %369 = load i8, ptr %59, align 1, !tbaa !20
  %370 = zext i8 %369 to i32
  %371 = or disjoint i32 %368, %370
  %372 = load i32, ptr %0, align 8, !tbaa !21
  %.not210 = icmp eq i32 %371, %372
  br i1 %.not210, label %377, label %373

373:                                              ; preds = %362, %365
  %374 = load ptr, ptr @stderr, align 8, !tbaa !19
  %375 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %374, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 985, ptr noundef nonnull @__FUNCTION__.tls12_do_accept) #8
  %376 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 10) #7
  br label %462

377:                                              ; preds = %365
  %378 = load i64, ptr %3, align 8, !tbaa !23
  %379 = icmp ugt i64 %378, 309
  br i1 %379, label %380, label %384

380:                                              ; preds = %377
  %381 = load ptr, ptr @stderr, align 8, !tbaa !19
  %382 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %381, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 990, ptr noundef nonnull @__FUNCTION__.tls12_do_accept) #8
  %383 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 10) #7
  br label %462

384:                                              ; preds = %377
  %385 = getelementptr inbounds i8, ptr %0, i64 62856
  %386 = call i32 @tls_record_decrypt(ptr noundef nonnull %333, ptr noundef nonnull %336, ptr noundef nonnull %385, ptr noundef nonnull %40, i64 noundef %378, ptr noundef nonnull %2, ptr noundef nonnull %4) #7
  %.not211 = icmp eq i32 %386, 1
  br i1 %.not211, label %391, label %387

387:                                              ; preds = %384
  %388 = load ptr, ptr @stderr, align 8, !tbaa !19
  %389 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %388, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 1000, ptr noundef nonnull @__FUNCTION__.tls12_do_accept) #8
  %390 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 20) #7
  br label %462

391:                                              ; preds = %384
  %392 = call i32 @tls_seq_num_incr(ptr noundef nonnull %385) #7
  %393 = call i32 @tls_record_get_handshake_finished(ptr noundef nonnull %2, ptr noundef nonnull %32, ptr noundef nonnull %33) #7
  %.not212 = icmp eq i32 %393, 1
  br i1 %.not212, label %398, label %394

394:                                              ; preds = %391
  %395 = load ptr, ptr @stderr, align 8, !tbaa !19
  %396 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %395, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 1007, ptr noundef nonnull @__FUNCTION__.tls12_do_accept) #8
  %397 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 20) #7
  br label %462

398:                                              ; preds = %391
  %399 = load i64, ptr %33, align 8, !tbaa !23
  %.not213 = icmp eq i64 %399, 12
  br i1 %.not213, label %404, label %400

400:                                              ; preds = %398
  %401 = load ptr, ptr @stderr, align 8, !tbaa !19
  %402 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %401, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 1012, ptr noundef nonnull @__FUNCTION__.tls12_do_accept) #8
  %403 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 20) #7
  br label %462

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

409:                                              ; preds = %404
  %410 = load ptr, ptr @stderr, align 8, !tbaa !19
  %411 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %410, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 1023, ptr noundef nonnull @__FUNCTION__.tls12_do_accept) #8
  %412 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 80) #7
  br label %462

413:                                              ; preds = %404
  %414 = load ptr, ptr %32, align 8, !tbaa !19
  %bcmp = call i32 @bcmp(ptr noundef nonnull dereferenceable(12) %414, ptr noundef nonnull dereferenceable(12) %31, i64 12)
  %.not215 = icmp eq i32 %bcmp, 0
  br i1 %.not215, label %419, label %415

415:                                              ; preds = %413
  %416 = load ptr, ptr @stderr, align 8, !tbaa !19
  %417 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %416, ptr noundef nonnull @.str.8, ptr noundef nonnull @.str.1, i32 noundef 1028, ptr noundef nonnull @__FUNCTION__.tls12_do_accept, ptr noundef nonnull @.str.9) #8
  %418 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 51) #7
  br label %462

419:                                              ; preds = %413
  %420 = call i32 @tls_record_set_change_cipher_spec(ptr noundef nonnull %40, ptr noundef nonnull %3) #7
  %.not216 = icmp eq i32 %420, 1
  br i1 %.not216, label %425, label %421

421:                                              ; preds = %419
  %422 = load ptr, ptr @stderr, align 8, !tbaa !19
  %423 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %422, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 1036, ptr noundef nonnull @__FUNCTION__.tls12_do_accept) #8
  %424 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 80) #7
  br label %462

425:                                              ; preds = %419
  %426 = load i64, ptr %3, align 8, !tbaa !23
  %427 = load i32, ptr %47, align 8, !tbaa !18
  %428 = call i32 @tls_record_send(ptr noundef nonnull %40, i64 noundef %426, i32 noundef %427) #7
  %.not217 = icmp eq i32 %428, 1
  br i1 %.not217, label %432, label %429

429:                                              ; preds = %425
  %430 = load ptr, ptr @stderr, align 8, !tbaa !19
  %431 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %430, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 1042, ptr noundef nonnull @__FUNCTION__.tls12_do_accept) #8
  br label %462

432:                                              ; preds = %425
  call void @sm3_finish(ptr noundef nonnull %28, ptr noundef nonnull %30) #7
  %433 = call i32 @tls_prf(ptr noundef nonnull %329, i64 noundef 48, ptr noundef nonnull @.str.6, ptr noundef nonnull %30, i64 noundef 32, ptr noundef null, i64 noundef 0, i64 noundef 12, ptr noundef nonnull %31) #7
  %.not218 = icmp eq i32 %433, 1
  br i1 %.not218, label %434, label %436

434:                                              ; preds = %432
  %435 = call i32 @tls_record_set_handshake_finished(ptr noundef nonnull %2, ptr noundef nonnull %4, ptr noundef nonnull %31, i64 noundef 12) #7
  %.not219 = icmp eq i32 %435, 1
  br i1 %.not219, label %440, label %436

436:                                              ; preds = %432, %434
  %437 = load ptr, ptr @stderr, align 8, !tbaa !19
  %438 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %437, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 1053, ptr noundef nonnull @__FUNCTION__.tls12_do_accept) #8
  %439 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 80) #7
  br label %462

440:                                              ; preds = %434
  %441 = getelementptr inbounds i8, ptr %0, i64 62864
  %442 = load i64, ptr %4, align 8, !tbaa !23
  %443 = call i32 @tls_record_encrypt(ptr noundef nonnull %334, ptr noundef nonnull %338, ptr noundef nonnull %441, ptr noundef nonnull %2, i64 noundef %442, ptr noundef nonnull %40, ptr noundef nonnull %3) #7
  %.not220 = icmp eq i32 %443, 1
  br i1 %.not220, label %448, label %444

444:                                              ; preds = %440
  %445 = load ptr, ptr @stderr, align 8, !tbaa !19
  %446 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %445, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 1060, ptr noundef nonnull @__FUNCTION__.tls12_do_accept) #8
  %447 = call i32 @tls_send_alert(ptr noundef nonnull %0, i32 noundef 80) #7
  br label %462

448:                                              ; preds = %440
  %449 = call i32 @tls_seq_num_incr(ptr noundef nonnull %441) #7
  %450 = load i64, ptr %3, align 8, !tbaa !23
  %451 = load i32, ptr %47, align 8, !tbaa !18
  %452 = call i32 @tls_record_send(ptr noundef nonnull %40, i64 noundef %450, i32 noundef %451) #7
  %.not221 = icmp eq i32 %452, 1
  br i1 %.not221, label %456, label %453

453:                                              ; preds = %448
  %454 = load ptr, ptr @stderr, align 8, !tbaa !19
  %455 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %454, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 1068, ptr noundef nonnull @__FUNCTION__.tls12_do_accept) #8
  br label %462

456:                                              ; preds = %448
  %457 = getelementptr inbounds i8, ptr %0, i64 63168
  %458 = load i32, ptr %457, align 8, !tbaa !27
  %.not222 = icmp eq i32 %458, 0
  br i1 %.not222, label %459, label %462

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

462:                                              ; preds = %.thread, %456, %459, %453, %444, %436, %429, %421, %415, %409, %400, %394, %387, %380, %373, %358, %352, %320, %312, %299, %293, %272, %266, %245, %236, %228, %205, %172, %164, %143, %135, %120, %112, %87, %77, %70, %64, %50
  %.0169 = phi i32 [ -1, %50 ], [ -1, %64 ], [ -1, %70 ], [ -1, %77 ], [ -1, %87 ], [ -1, %112 ], [ -1, %120 ], [ -1, %135 ], [ -1, %143 ], [ -1, %164 ], [ -1, %172 ], [ -1, %205 ], [ -1, %228 ], [ -1, %236 ], [ -1, %245 ], [ -1, %266 ], [ -1, %272 ], [ -1, %293 ], [ -1, %299 ], [ -1, %312 ], [ -1, %320 ], [ -1, %352 ], [ -1, %358 ], [ -1, %373 ], [ -1, %380 ], [ -1, %387 ], [ -1, %394 ], [ -1, %400 ], [ -1, %409 ], [ -1, %415 ], [ -1, %421 ], [ -1, %429 ], [ -1, %436 ], [ -1, %444 ], [ -1, %453 ], [ 1, %459 ], [ 1, %456 ], [ -1, %.thread ]
  call void @gmssl_secure_clear(ptr noundef nonnull %19, i64 noundef 3976) #7
  call void @gmssl_secure_clear(ptr noundef nonnull %27, i64 noundef 255) #7
  br i1 %.not, label %464, label %463

463:                                              ; preds = %462
  call void @tls_client_verify_cleanup(ptr noundef nonnull %22) #7
  br label %464

464:                                              ; preds = %462, %463, %157
  %.0167 = phi i32 [ -1, %157 ], [ %.0169, %463 ], [ %.0169, %462 ]
  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 8, ptr nonnull %33) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %32) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %31) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %30) #7
  call void @llvm.lifetime.end.p0(i64 112, ptr nonnull %29) #7
  call void @llvm.lifetime.end.p0(i64 112, ptr nonnull %28) #7
  call void @llvm.lifetime.end.p0(i64 255, ptr nonnull %27) #7
  call void @llvm.lifetime.end.p0(i64 96, 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 128, ptr nonnull %23) #7
  call void @llvm.lifetime.end.p0(i64 136, 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 128, ptr nonnull %18) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %17) #7
  call void @llvm.lifetime.end.p0(i64 512, 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 %.0167
}

declare i32 @tls_client_verify_init(ptr noundef) local_unnamed_addr #3

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_process_client_hello_exts(ptr noundef, i64 noundef, ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #3

declare i32 @tls_client_verify_update(ptr noundef, ptr noundef, i64 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

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

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 @tls_record_get_handshake_certificate_verify(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

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

declare void @tls_client_verify_cleanup(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: write) }
attributes #5 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = !{!6, !7, i64 0}
!22 = !{!7, !7, i64 0}
!23 = !{!10, !10, i64 0}
!24 = !{!6, !7, i64 55624}
!25 = !{!6, !10, i64 57720}
!26 = !{!6, !10, i64 59776}
!27 = !{!6, !7, i64 63168}


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