; LLVM IR from aws/s2n-tls :: tls (s2n_connection_serialize)

; 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.s2n_debug_info = type { ptr, ptr }
%struct.s2n_blob = type { ptr, i32, i32, i8 }
%struct.s2n_stuffer = type { %struct.s2n_blob, i32, i32, i32, i8 }
%struct.s2n_result = type { i32 }
%struct.s2n_connection = type { i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, [22 x i8], [22 x i8], [22 x i8], i32, i32, %struct.s2n_timer, i64, i64, [32 x i8], i8, i8, i8, i8, i8, i8, i8, ptr, ptr, %struct.s2n_secrets, ptr, ptr, %struct.s2n_kex_parameters, %struct.s2n_handshake_parameters, %struct.s2n_psk_parameters, ptr, i8, i32, [5 x i8], %struct.s2n_stuffer, %struct.s2n_stuffer, %struct.s2n_stuffer, %struct.s2n_stuffer, i32, i64, [2 x i8], %struct.s2n_stuffer, i8, i8, i8, i8, %struct.s2n_atomic_flag, %struct.s2n_atomic_flag, %struct.s2n_handshake, i16, i32, i16, i64, i8, i64, i64, i64, %struct.s2n_atomic_flag, %struct.s2n_atomic_flag, [256 x i8], [256 x i8], i32, %struct.s2n_blob, i32, %struct.s2n_blob, %struct.s2n_blob, %struct.s2n_blob, %struct.s2n_client_hello, %struct.s2n_x509_validator, ptr, ptr, i8, i32, %struct.s2n_blob, i32, %struct.s2n_ticket_fields, [138 x i8], %struct.s2n_stuffer, %struct.s2n_blob, %struct.s2n_blob, i8, i8, i8, i16, i16, i32, i32, %struct.s2n_blob, i32, %struct.s2n_post_handshake, %struct.s2n_atomic_flag, i8, i8 }
%struct.s2n_timer = type { i64 }
%struct.s2n_secrets = type { %union.anon, i32 }
%union.anon = type { %struct.s2n_tls13_secrets }
%struct.s2n_tls13_secrets = type { [48 x i8], [48 x i8], [48 x i8], [48 x i8], [48 x i8], [48 x i8], [48 x i8], [48 x i8], i32 }
%struct.s2n_kex_parameters = type { %struct.s2n_dh_params, %struct.s2n_ecc_evp_params, [4 x ptr], %struct.s2n_ecc_evp_params, %struct.s2n_kem_group_params, %struct.s2n_kem_group_params, [8 x ptr], %struct.s2n_kem_params, %struct.s2n_blob, %struct.s2n_blob }
%struct.s2n_dh_params = type { ptr }
%struct.s2n_ecc_evp_params = type { ptr, ptr }
%struct.s2n_kem_group_params = type { ptr, %struct.s2n_kem_params, %struct.s2n_ecc_evp_params }
%struct.s2n_kem_params = type { ptr, %struct.s2n_blob, %struct.s2n_blob, %struct.s2n_blob, i8 }
%struct.s2n_handshake_parameters = type { %struct.s2n_pkey, %struct.s2n_pkey, %struct.s2n_blob, i32, %struct.s2n_sig_scheme_list, ptr, ptr, ptr, [4 x ptr], [4 x ptr], i8, i8, [32 x i8], [32 x i8] }
%struct.s2n_pkey = type { ptr, ptr, ptr, ptr, ptr, ptr }
%struct.s2n_sig_scheme_list = type { [128 x i16], i8 }
%struct.s2n_psk_parameters = type { i32, %struct.s2n_array, i16, i16, ptr, i32 }
%struct.s2n_array = type { %struct.s2n_blob, i32, i32 }
%struct.s2n_handshake = type { %struct.s2n_stuffer, ptr, [8 x i8], [48 x i8], [48 x i8], i8, i32, i32, i32, i32, %struct.s2n_offered_early_data, i8, i32 }
%struct.s2n_offered_early_data = type { ptr }
%struct.s2n_client_hello = type { %struct.s2n_blob, %struct.s2n_parsed_extensions_list, %struct.s2n_blob, %struct.s2n_blob, %struct.s2n_blob, i8, i8, i8 }
%struct.s2n_parsed_extensions_list = type { [21 x %struct.s2n_parsed_extension], %struct.s2n_blob, i16 }
%struct.s2n_parsed_extension = type { %struct.s2n_blob, i16, i16, i8 }
%struct.s2n_x509_validator = type { ptr, ptr, i8, i8, i16, ptr, i32, ptr, %struct.s2n_cert_validation_info, i8 }
%struct.s2n_cert_validation_info = type { i8, [3 x i8] }
%struct.s2n_ticket_fields = type { %struct.s2n_blob, i32 }
%struct.s2n_post_handshake = type { %struct.s2n_stuffer, [4 x i8] }
%struct.s2n_atomic_flag = type { i32 }
%struct.s2n_crypto_parameters = type { ptr, %struct.s2n_session_key, %struct.s2n_session_key, %struct.s2n_hmac_state, %struct.s2n_hmac_state, [16 x i8], [16 x i8], [8 x i8], [8 x i8] }
%struct.s2n_session_key = type { ptr }
%struct.s2n_hmac_state = type { i32, i16, i32, i16, i8, %struct.s2n_hash_state, %struct.s2n_hash_state, %struct.s2n_hash_state, %struct.s2n_hash_state, [128 x i8], [64 x i8] }
%struct.s2n_hash_state = type { ptr, i32, i8, i64, %union.anon.0 }
%union.anon.0 = type { %struct.s2n_hash_evp_digest }
%struct.s2n_hash_evp_digest = type { %struct.s2n_evp_digest, %struct.s2n_evp_digest }
%struct.s2n_evp_digest = type { ptr, ptr }
%struct.s2n_config = type { i32, ptr, ptr, %struct.certs_by_type, %struct.s2n_blob, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, ptr, i64, ptr, i64, i64, ptr, ptr, ptr, ptr, ptr, ptr, i32, i8, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i8, i8, %struct.s2n_x509_trust_store, i16, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i32, ptr, i32, i32, ptr, ptr, i32, %struct.s2n_blob }
%struct.certs_by_type = type { [4 x ptr] }
%struct.s2n_x509_trust_store = type { ptr, i8 }
%struct.s2n_cipher_suite = type { i8, ptr, ptr, [2 x i8], ptr, i32, ptr, [2 x ptr], i8, ptr, ptr, i32, i8 }

@_s2n_debug_info = external thread_local global %struct.s2n_debug_info, align 8
@s2n_errno = external thread_local global i32, align 4
@.str.6 = external hidden unnamed_addr constant [100 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [100 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [100 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [100 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [100 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [100 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [100 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [101 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [101 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [101 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [101 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [101 x i8], align 1

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare nonnull ptr @llvm.threadlocal.address.p0(ptr nonnull) #1

; Function Attrs: nounwind willreturn memory(read)
declare ptr @strrchr(ptr noundef, i32 noundef) #2

declare i32 @s2n_calculate_stacktrace() #3

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

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

; Function Attrs: nounwind uwtable
define dso_local i32 @s2n_connection_serialize(ptr noundef %0, ptr noundef %1, i32 noundef %2) #0 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca %struct.s2n_blob, align 8
  %12 = alloca %struct.s2n_stuffer, align 8
  %13 = alloca %struct.s2n_result, align 4
  %14 = alloca %struct.s2n_result, align 4
  %15 = alloca %struct.s2n_result, align 4
  %16 = alloca %struct.s2n_result, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store i32 %2, ptr %7, align 4, !tbaa !9
  br label %17

17:                                               ; preds = %3
  %18 = load ptr, ptr %5, align 8, !tbaa !5
  %19 = icmp ne ptr %18, null
  br i1 %19, label %51, label %20

20:                                               ; preds = %17
  br label %21

21:                                               ; preds = %20
  br label %22

22:                                               ; preds = %21
  %23 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %24 = getelementptr inbounds %struct.s2n_debug_info, ptr %23, i32 0, i32 0
  store ptr @.str.6, ptr %24, align 8, !tbaa !11
  %25 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %26 = getelementptr inbounds %struct.s2n_debug_info, ptr %25, i32 0, i32 0
  %27 = load ptr, ptr %26, align 8, !tbaa !11
  %28 = getelementptr inbounds i8, ptr %27, i64 21
  %29 = call ptr @strrchr(ptr noundef %28, i32 noundef 47) #7
  %30 = icmp ne ptr %29, null
  br i1 %30, label %31, label %38

31:                                               ; preds = %22
  %32 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %33 = getelementptr inbounds %struct.s2n_debug_info, ptr %32, i32 0, i32 0
  %34 = load ptr, ptr %33, align 8, !tbaa !11
  %35 = getelementptr inbounds i8, ptr %34, i64 21
  %36 = call ptr @strrchr(ptr noundef %35, i32 noundef 47) #7
  %37 = getelementptr inbounds i8, ptr %36, i64 1
  br label %43

38:                                               ; preds = %22
  %39 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %40 = getelementptr inbounds %struct.s2n_debug_info, ptr %39, i32 0, i32 0
  %41 = load ptr, ptr %40, align 8, !tbaa !11
  %42 = getelementptr inbounds i8, ptr %41, i64 21
  br label %43

43:                                               ; preds = %38, %31
  %44 = phi ptr [ %37, %31 ], [ %42, %38 ]
  %45 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %46 = getelementptr inbounds %struct.s2n_debug_info, ptr %45, i32 0, i32 1
  store ptr %44, ptr %46, align 8, !tbaa !13
  %47 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %47, align 4, !tbaa !9
  %48 = call i32 @s2n_calculate_stacktrace()
  br label %49

49:                                               ; preds = %43
  store i32 -1, ptr %4, align 4
  br label %665

50:                                               ; No predecessors!
  br label %51

51:                                               ; preds = %50, %17
  br label %52

52:                                               ; preds = %51
  br label %53

53:                                               ; preds = %52
  %54 = load ptr, ptr %5, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.s2n_connection, ptr %54, i32 0, i32 27
  %56 = load ptr, ptr %55, align 8, !tbaa !14
  %57 = icmp ne ptr %56, null
  br i1 %57, label %89, label %58

58:                                               ; preds = %53
  br label %59

59:                                               ; preds = %58
  br label %60

60:                                               ; preds = %59
  %61 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %62 = getelementptr inbounds %struct.s2n_debug_info, ptr %61, i32 0, i32 0
  store ptr @.str.7, ptr %62, align 8, !tbaa !11
  %63 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %64 = getelementptr inbounds %struct.s2n_debug_info, ptr %63, i32 0, i32 0
  %65 = load ptr, ptr %64, align 8, !tbaa !11
  %66 = getelementptr inbounds i8, ptr %65, i64 21
  %67 = call ptr @strrchr(ptr noundef %66, i32 noundef 47) #7
  %68 = icmp ne ptr %67, null
  br i1 %68, label %69, label %76

69:                                               ; preds = %60
  %70 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %71 = getelementptr inbounds %struct.s2n_debug_info, ptr %70, i32 0, i32 0
  %72 = load ptr, ptr %71, align 8, !tbaa !11
  %73 = getelementptr inbounds i8, ptr %72, i64 21
  %74 = call ptr @strrchr(ptr noundef %73, i32 noundef 47) #7
  %75 = getelementptr inbounds i8, ptr %74, i64 1
  br label %81

76:                                               ; preds = %60
  %77 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %78 = getelementptr inbounds %struct.s2n_debug_info, ptr %77, i32 0, i32 0
  %79 = load ptr, ptr %78, align 8, !tbaa !11
  %80 = getelementptr inbounds i8, ptr %79, i64 21
  br label %81

81:                                               ; preds = %76, %69
  %82 = phi ptr [ %75, %69 ], [ %80, %76 ]
  %83 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %84 = getelementptr inbounds %struct.s2n_debug_info, ptr %83, i32 0, i32 1
  store ptr %82, ptr %84, align 8, !tbaa !13
  %85 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %85, align 4, !tbaa !9
  %86 = call i32 @s2n_calculate_stacktrace()
  br label %87

87:                                               ; preds = %81
  store i32 -1, ptr %4, align 4
  br label %665

88:                                               ; No predecessors!
  br label %89

89:                                               ; preds = %88, %53
  br label %90

90:                                               ; preds = %89
  br label %91

91:                                               ; preds = %90
  %92 = load ptr, ptr %5, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.s2n_connection, ptr %92, i32 0, i32 27
  %94 = load ptr, ptr %93, align 8, !tbaa !14
  %95 = getelementptr inbounds %struct.s2n_crypto_parameters, ptr %94, i32 0, i32 0
  %96 = load ptr, ptr %95, align 8, !tbaa !42
  %97 = icmp ne ptr %96, null
  br i1 %97, label %129, label %98

98:                                               ; preds = %91
  br label %99

99:                                               ; preds = %98
  br label %100

100:                                              ; preds = %99
  %101 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %102 = getelementptr inbounds %struct.s2n_debug_info, ptr %101, i32 0, i32 0
  store ptr @.str.8, ptr %102, align 8, !tbaa !11
  %103 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %104 = getelementptr inbounds %struct.s2n_debug_info, ptr %103, i32 0, i32 0
  %105 = load ptr, ptr %104, align 8, !tbaa !11
  %106 = getelementptr inbounds i8, ptr %105, i64 21
  %107 = call ptr @strrchr(ptr noundef %106, i32 noundef 47) #7
  %108 = icmp ne ptr %107, null
  br i1 %108, label %109, label %116

109:                                              ; preds = %100
  %110 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %111 = getelementptr inbounds %struct.s2n_debug_info, ptr %110, i32 0, i32 0
  %112 = load ptr, ptr %111, align 8, !tbaa !11
  %113 = getelementptr inbounds i8, ptr %112, i64 21
  %114 = call ptr @strrchr(ptr noundef %113, i32 noundef 47) #7
  %115 = getelementptr inbounds i8, ptr %114, i64 1
  br label %121

116:                                              ; preds = %100
  %117 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %118 = getelementptr inbounds %struct.s2n_debug_info, ptr %117, i32 0, i32 0
  %119 = load ptr, ptr %118, align 8, !tbaa !11
  %120 = getelementptr inbounds i8, ptr %119, i64 21
  br label %121

121:                                              ; preds = %116, %109
  %122 = phi ptr [ %115, %109 ], [ %120, %116 ]
  %123 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %124 = getelementptr inbounds %struct.s2n_debug_info, ptr %123, i32 0, i32 1
  store ptr %122, ptr %124, align 8, !tbaa !13
  %125 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %125, align 4, !tbaa !9
  %126 = call i32 @s2n_calculate_stacktrace()
  br label %127

127:                                              ; preds = %121
  store i32 -1, ptr %4, align 4
  br label %665

128:                                              ; No predecessors!
  br label %129

129:                                              ; preds = %128, %91
  br label %130

130:                                              ; preds = %129
  br label %131

131:                                              ; preds = %130
  %132 = load ptr, ptr %5, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.s2n_connection, ptr %132, i32 0, i32 1
  %134 = load ptr, ptr %133, align 8, !tbaa !47
  %135 = icmp ne ptr %134, null
  br i1 %135, label %167, label %136

136:                                              ; preds = %131
  br label %137

137:                                              ; preds = %136
  br label %138

138:                                              ; preds = %137
  %139 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %140 = getelementptr inbounds %struct.s2n_debug_info, ptr %139, i32 0, i32 0
  store ptr @.str.9, ptr %140, align 8, !tbaa !11
  %141 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %142 = getelementptr inbounds %struct.s2n_debug_info, ptr %141, i32 0, i32 0
  %143 = load ptr, ptr %142, align 8, !tbaa !11
  %144 = getelementptr inbounds i8, ptr %143, i64 21
  %145 = call ptr @strrchr(ptr noundef %144, i32 noundef 47) #7
  %146 = icmp ne ptr %145, null
  br i1 %146, label %147, label %154

147:                                              ; preds = %138
  %148 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %149 = getelementptr inbounds %struct.s2n_debug_info, ptr %148, i32 0, i32 0
  %150 = load ptr, ptr %149, align 8, !tbaa !11
  %151 = getelementptr inbounds i8, ptr %150, i64 21
  %152 = call ptr @strrchr(ptr noundef %151, i32 noundef 47) #7
  %153 = getelementptr inbounds i8, ptr %152, i64 1
  br label %159

154:                                              ; preds = %138
  %155 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %156 = getelementptr inbounds %struct.s2n_debug_info, ptr %155, i32 0, i32 0
  %157 = load ptr, ptr %156, align 8, !tbaa !11
  %158 = getelementptr inbounds i8, ptr %157, i64 21
  br label %159

159:                                              ; preds = %154, %147
  %160 = phi ptr [ %153, %147 ], [ %158, %154 ]
  %161 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %162 = getelementptr inbounds %struct.s2n_debug_info, ptr %161, i32 0, i32 1
  store ptr %160, ptr %162, align 8, !tbaa !13
  %163 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %163, align 4, !tbaa !9
  %164 = call i32 @s2n_calculate_stacktrace()
  br label %165

165:                                              ; preds = %159
  store i32 -1, ptr %4, align 4
  br label %665

166:                                              ; No predecessors!
  br label %167

167:                                              ; preds = %166, %131
  br label %168

168:                                              ; preds = %167
  br label %169

169:                                              ; preds = %168
  %170 = load ptr, ptr %6, align 8, !tbaa !5
  %171 = icmp ne ptr %170, null
  br i1 %171, label %203, label %172

172:                                              ; preds = %169
  br label %173

173:                                              ; preds = %172
  br label %174

174:                                              ; preds = %173
  %175 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %176 = getelementptr inbounds %struct.s2n_debug_info, ptr %175, i32 0, i32 0
  store ptr @.str.10, ptr %176, align 8, !tbaa !11
  %177 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %178 = getelementptr inbounds %struct.s2n_debug_info, ptr %177, i32 0, i32 0
  %179 = load ptr, ptr %178, align 8, !tbaa !11
  %180 = getelementptr inbounds i8, ptr %179, i64 21
  %181 = call ptr @strrchr(ptr noundef %180, i32 noundef 47) #7
  %182 = icmp ne ptr %181, null
  br i1 %182, label %183, label %190

183:                                              ; preds = %174
  %184 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %185 = getelementptr inbounds %struct.s2n_debug_info, ptr %184, i32 0, i32 0
  %186 = load ptr, ptr %185, align 8, !tbaa !11
  %187 = getelementptr inbounds i8, ptr %186, i64 21
  %188 = call ptr @strrchr(ptr noundef %187, i32 noundef 47) #7
  %189 = getelementptr inbounds i8, ptr %188, i64 1
  br label %195

190:                                              ; preds = %174
  %191 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %192 = getelementptr inbounds %struct.s2n_debug_info, ptr %191, i32 0, i32 0
  %193 = load ptr, ptr %192, align 8, !tbaa !11
  %194 = getelementptr inbounds i8, ptr %193, i64 21
  br label %195

195:                                              ; preds = %190, %183
  %196 = phi ptr [ %189, %183 ], [ %194, %190 ]
  %197 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %198 = getelementptr inbounds %struct.s2n_debug_info, ptr %197, i32 0, i32 1
  store ptr %196, ptr %198, align 8, !tbaa !13
  %199 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %199, align 4, !tbaa !9
  %200 = call i32 @s2n_calculate_stacktrace()
  br label %201

201:                                              ; preds = %195
  store i32 -1, ptr %4, align 4
  br label %665

202:                                              ; No predecessors!
  br label %203

203:                                              ; preds = %202, %169
  br label %204

204:                                              ; preds = %203
  br label %205

205:                                              ; preds = %204
  %206 = load ptr, ptr %5, align 8, !tbaa !5
  %207 = getelementptr inbounds %struct.s2n_connection, ptr %206, i32 0, i32 1
  %208 = load ptr, ptr %207, align 8, !tbaa !47
  %209 = getelementptr inbounds %struct.s2n_config, ptr %208, i32 0, i32 55
  %210 = load i32, ptr %209, align 8, !tbaa !48
  %211 = icmp ne i32 %210, 0
  br i1 %211, label %243, label %212

212:                                              ; preds = %205
  br label %213

213:                                              ; preds = %212
  br label %214

214:                                              ; preds = %213
  %215 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %216 = getelementptr inbounds %struct.s2n_debug_info, ptr %215, i32 0, i32 0
  store ptr @.str.11, ptr %216, align 8, !tbaa !11
  %217 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %218 = getelementptr inbounds %struct.s2n_debug_info, ptr %217, i32 0, i32 0
  %219 = load ptr, ptr %218, align 8, !tbaa !11
  %220 = getelementptr inbounds i8, ptr %219, i64 21
  %221 = call ptr @strrchr(ptr noundef %220, i32 noundef 47) #7
  %222 = icmp ne ptr %221, null
  br i1 %222, label %223, label %230

223:                                              ; preds = %214
  %224 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %225 = getelementptr inbounds %struct.s2n_debug_info, ptr %224, i32 0, i32 0
  %226 = load ptr, ptr %225, align 8, !tbaa !11
  %227 = getelementptr inbounds i8, ptr %226, i64 21
  %228 = call ptr @strrchr(ptr noundef %227, i32 noundef 47) #7
  %229 = getelementptr inbounds i8, ptr %228, i64 1
  br label %235

230:                                              ; preds = %214
  %231 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %232 = getelementptr inbounds %struct.s2n_debug_info, ptr %231, i32 0, i32 0
  %233 = load ptr, ptr %232, align 8, !tbaa !11
  %234 = getelementptr inbounds i8, ptr %233, i64 21
  br label %235

235:                                              ; preds = %230, %223
  %236 = phi ptr [ %229, %223 ], [ %234, %230 ]
  %237 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %238 = getelementptr inbounds %struct.s2n_debug_info, ptr %237, i32 0, i32 1
  store ptr %236, ptr %238, align 8, !tbaa !13
  %239 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 469762112, ptr %239, align 4, !tbaa !9
  %240 = call i32 @s2n_calculate_stacktrace()
  br label %241

241:                                              ; preds = %235
  store i32 -1, ptr %4, align 4
  br label %665

242:                                              ; No predecessors!
  br label %243

243:                                              ; preds = %242, %205
  br label %244

244:                                              ; preds = %243
  br label %245

245:                                              ; preds = %244
  %246 = load ptr, ptr %5, align 8, !tbaa !5
  %247 = call zeroext i1 @s2n_handshake_is_complete(ptr noundef %246)
  br i1 %247, label %279, label %248

248:                                              ; preds = %245
  br label %249

249:                                              ; preds = %248
  br label %250

250:                                              ; preds = %249
  %251 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %252 = getelementptr inbounds %struct.s2n_debug_info, ptr %251, i32 0, i32 0
  store ptr @.str.12, ptr %252, align 8, !tbaa !11
  %253 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %254 = getelementptr inbounds %struct.s2n_debug_info, ptr %253, i32 0, i32 0
  %255 = load ptr, ptr %254, align 8, !tbaa !11
  %256 = getelementptr inbounds i8, ptr %255, i64 21
  %257 = call ptr @strrchr(ptr noundef %256, i32 noundef 47) #7
  %258 = icmp ne ptr %257, null
  br i1 %258, label %259, label %266

259:                                              ; preds = %250
  %260 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %261 = getelementptr inbounds %struct.s2n_debug_info, ptr %260, i32 0, i32 0
  %262 = load ptr, ptr %261, align 8, !tbaa !11
  %263 = getelementptr inbounds i8, ptr %262, i64 21
  %264 = call ptr @strrchr(ptr noundef %263, i32 noundef 47) #7
  %265 = getelementptr inbounds i8, ptr %264, i64 1
  br label %271

266:                                              ; preds = %250
  %267 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %268 = getelementptr inbounds %struct.s2n_debug_info, ptr %267, i32 0, i32 0
  %269 = load ptr, ptr %268, align 8, !tbaa !11
  %270 = getelementptr inbounds i8, ptr %269, i64 21
  br label %271

271:                                              ; preds = %266, %259
  %272 = phi ptr [ %265, %259 ], [ %270, %266 ]
  %273 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %274 = getelementptr inbounds %struct.s2n_debug_info, ptr %273, i32 0, i32 1
  store ptr %272, ptr %274, align 8, !tbaa !13
  %275 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 469762124, ptr %275, align 4, !tbaa !9
  %276 = call i32 @s2n_calculate_stacktrace()
  br label %277

277:                                              ; preds = %271
  store i32 -1, ptr %4, align 4
  br label %665

278:                                              ; No predecessors!
  br label %279

279:                                              ; preds = %278, %245
  br label %280

280:                                              ; preds = %279
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #8
  store i32 2, ptr %8, align 4, !tbaa !9
  br label %281

281:                                              ; preds = %280
  %282 = load ptr, ptr %5, align 8, !tbaa !5
  %283 = load i32, ptr %8, align 4, !tbaa !9
  %284 = call zeroext i1 @s2n_connection_check_io_status(ptr noundef %282, i32 noundef %283)
  br i1 %284, label %318, label %285

285:                                              ; preds = %281
  br label %286

286:                                              ; preds = %285
  br label %287

287:                                              ; preds = %286
  %288 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %289 = getelementptr inbounds %struct.s2n_debug_info, ptr %288, i32 0, i32 0
  store ptr @.str.13, ptr %289, align 8, !tbaa !11
  %290 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %291 = getelementptr inbounds %struct.s2n_debug_info, ptr %290, i32 0, i32 0
  %292 = load ptr, ptr %291, align 8, !tbaa !11
  %293 = getelementptr inbounds i8, ptr %292, i64 21
  %294 = call ptr @strrchr(ptr noundef %293, i32 noundef 47) #7
  %295 = icmp ne ptr %294, null
  br i1 %295, label %296, label %303

296:                                              ; preds = %287
  %297 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %298 = getelementptr inbounds %struct.s2n_debug_info, ptr %297, i32 0, i32 0
  %299 = load ptr, ptr %298, align 8, !tbaa !11
  %300 = getelementptr inbounds i8, ptr %299, i64 21
  %301 = call ptr @strrchr(ptr noundef %300, i32 noundef 47) #7
  %302 = getelementptr inbounds i8, ptr %301, i64 1
  br label %308

303:                                              ; preds = %287
  %304 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %305 = getelementptr inbounds %struct.s2n_debug_info, ptr %304, i32 0, i32 0
  %306 = load ptr, ptr %305, align 8, !tbaa !11
  %307 = getelementptr inbounds i8, ptr %306, i64 21
  br label %308

308:                                              ; preds = %303, %296
  %309 = phi ptr [ %302, %296 ], [ %307, %303 ]
  %310 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %311 = getelementptr inbounds %struct.s2n_debug_info, ptr %310, i32 0, i32 1
  store ptr %309, ptr %311, align 8, !tbaa !13
  %312 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 134217728, ptr %312, align 4, !tbaa !9
  %313 = call i32 @s2n_calculate_stacktrace()
  br label %314

314:                                              ; preds = %308
  br label %315

315:                                              ; preds = %314
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %664

316:                                              ; No predecessors!
  br label %317

317:                                              ; preds = %316
  br label %318

318:                                              ; preds = %317, %281
  br label %319

319:                                              ; preds = %318
  br label %320

320:                                              ; preds = %319
  br label %321

321:                                              ; preds = %320
  %322 = load ptr, ptr %5, align 8, !tbaa !5
  %323 = getelementptr inbounds %struct.s2n_connection, ptr %322, i32 0, i32 38
  %324 = getelementptr inbounds %struct.s2n_stuffer, ptr %323, i32 0, i32 2
  %325 = load i32, ptr %324, align 4, !tbaa !52
  %326 = load ptr, ptr %5, align 8, !tbaa !5
  %327 = getelementptr inbounds %struct.s2n_connection, ptr %326, i32 0, i32 38
  %328 = getelementptr inbounds %struct.s2n_stuffer, ptr %327, i32 0, i32 1
  %329 = load i32, ptr %328, align 8, !tbaa !53
  %330 = sub i32 %325, %329
  %331 = icmp eq i32 %330, 0
  br i1 %331, label %365, label %332

332:                                              ; preds = %321
  br label %333

333:                                              ; preds = %332
  br label %334

334:                                              ; preds = %333
  %335 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %336 = getelementptr inbounds %struct.s2n_debug_info, ptr %335, i32 0, i32 0
  store ptr @.str.14, ptr %336, align 8, !tbaa !11
  %337 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %338 = getelementptr inbounds %struct.s2n_debug_info, ptr %337, i32 0, i32 0
  %339 = load ptr, ptr %338, align 8, !tbaa !11
  %340 = getelementptr inbounds i8, ptr %339, i64 21
  %341 = call ptr @strrchr(ptr noundef %340, i32 noundef 47) #7
  %342 = icmp ne ptr %341, null
  br i1 %342, label %343, label %350

343:                                              ; preds = %334
  %344 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %345 = getelementptr inbounds %struct.s2n_debug_info, ptr %344, i32 0, i32 0
  %346 = load ptr, ptr %345, align 8, !tbaa !11
  %347 = getelementptr inbounds i8, ptr %346, i64 21
  %348 = call ptr @strrchr(ptr noundef %347, i32 noundef 47) #7
  %349 = getelementptr inbounds i8, ptr %348, i64 1
  br label %355

350:                                              ; preds = %334
  %351 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %352 = getelementptr inbounds %struct.s2n_debug_info, ptr %351, i32 0, i32 0
  %353 = load ptr, ptr %352, align 8, !tbaa !11
  %354 = getelementptr inbounds i8, ptr %353, i64 21
  br label %355

355:                                              ; preds = %350, %343
  %356 = phi ptr [ %349, %343 ], [ %354, %350 ]
  %357 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %358 = getelementptr inbounds %struct.s2n_debug_info, ptr %357, i32 0, i32 1
  store ptr %356, ptr %358, align 8, !tbaa !13
  %359 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 469762112, ptr %359, align 4, !tbaa !9
  %360 = call i32 @s2n_calculate_stacktrace()
  br label %361

361:                                              ; preds = %355
  br label %362

362:                                              ; preds = %361
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %664

363:                                              ; No predecessors!
  br label %364

364:                                              ; preds = %363
  br label %365

365:                                              ; preds = %364, %321
  br label %366

366:                                              ; preds = %365
  br label %367

367:                                              ; preds = %366
  br label %368

368:                                              ; preds = %367
  %369 = load ptr, ptr %5, align 8, !tbaa !5
  %370 = getelementptr inbounds %struct.s2n_connection, ptr %369, i32 0, i32 40
  %371 = getelementptr inbounds %struct.s2n_stuffer, ptr %370, i32 0, i32 2
  %372 = load i32, ptr %371, align 4, !tbaa !54
  %373 = load ptr, ptr %5, align 8, !tbaa !5
  %374 = getelementptr inbounds %struct.s2n_connection, ptr %373, i32 0, i32 40
  %375 = getelementptr inbounds %struct.s2n_stuffer, ptr %374, i32 0, i32 1
  %376 = load i32, ptr %375, align 8, !tbaa !55
  %377 = sub i32 %372, %376
  %378 = icmp eq i32 %377, 0
  br i1 %378, label %412, label %379

379:                                              ; preds = %368
  br label %380

380:                                              ; preds = %379
  br label %381

381:                                              ; preds = %380
  %382 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %383 = getelementptr inbounds %struct.s2n_debug_info, ptr %382, i32 0, i32 0
  store ptr @.str.15, ptr %383, align 8, !tbaa !11
  %384 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %385 = getelementptr inbounds %struct.s2n_debug_info, ptr %384, i32 0, i32 0
  %386 = load ptr, ptr %385, align 8, !tbaa !11
  %387 = getelementptr inbounds i8, ptr %386, i64 21
  %388 = call ptr @strrchr(ptr noundef %387, i32 noundef 47) #7
  %389 = icmp ne ptr %388, null
  br i1 %389, label %390, label %397

390:                                              ; preds = %381
  %391 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %392 = getelementptr inbounds %struct.s2n_debug_info, ptr %391, i32 0, i32 0
  %393 = load ptr, ptr %392, align 8, !tbaa !11
  %394 = getelementptr inbounds i8, ptr %393, i64 21
  %395 = call ptr @strrchr(ptr noundef %394, i32 noundef 47) #7
  %396 = getelementptr inbounds i8, ptr %395, i64 1
  br label %402

397:                                              ; preds = %381
  %398 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %399 = getelementptr inbounds %struct.s2n_debug_info, ptr %398, i32 0, i32 0
  %400 = load ptr, ptr %399, align 8, !tbaa !11
  %401 = getelementptr inbounds i8, ptr %400, i64 21
  br label %402

402:                                              ; preds = %397, %390
  %403 = phi ptr [ %396, %390 ], [ %401, %397 ]
  %404 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %405 = getelementptr inbounds %struct.s2n_debug_info, ptr %404, i32 0, i32 1
  store ptr %403, ptr %405, align 8, !tbaa !13
  %406 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 469762112, ptr %406, align 4, !tbaa !9
  %407 = call i32 @s2n_calculate_stacktrace()
  br label %408

408:                                              ; preds = %402
  br label %409

409:                                              ; preds = %408
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %664

410:                                              ; No predecessors!
  br label %411

411:                                              ; preds = %410
  br label %412

412:                                              ; preds = %411, %368
  br label %413

413:                                              ; preds = %412
  br label %414

414:                                              ; preds = %413
  br label %415

415:                                              ; preds = %414
  %416 = load ptr, ptr %5, align 8, !tbaa !5
  %417 = getelementptr inbounds %struct.s2n_connection, ptr %416, i32 0, i32 41
  %418 = getelementptr inbounds %struct.s2n_stuffer, ptr %417, i32 0, i32 2
  %419 = load i32, ptr %418, align 4, !tbaa !56
  %420 = load ptr, ptr %5, align 8, !tbaa !5
  %421 = getelementptr inbounds %struct.s2n_connection, ptr %420, i32 0, i32 41
  %422 = getelementptr inbounds %struct.s2n_stuffer, ptr %421, i32 0, i32 1
  %423 = load i32, ptr %422, align 8, !tbaa !57
  %424 = sub i32 %419, %423
  %425 = icmp eq i32 %424, 0
  br i1 %425, label %459, label %426

426:                                              ; preds = %415
  br label %427

427:                                              ; preds = %426
  br label %428

428:                                              ; preds = %427
  %429 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %430 = getelementptr inbounds %struct.s2n_debug_info, ptr %429, i32 0, i32 0
  store ptr @.str.16, ptr %430, align 8, !tbaa !11
  %431 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %432 = getelementptr inbounds %struct.s2n_debug_info, ptr %431, i32 0, i32 0
  %433 = load ptr, ptr %432, align 8, !tbaa !11
  %434 = getelementptr inbounds i8, ptr %433, i64 21
  %435 = call ptr @strrchr(ptr noundef %434, i32 noundef 47) #7
  %436 = icmp ne ptr %435, null
  br i1 %436, label %437, label %444

437:                                              ; preds = %428
  %438 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %439 = getelementptr inbounds %struct.s2n_debug_info, ptr %438, i32 0, i32 0
  %440 = load ptr, ptr %439, align 8, !tbaa !11
  %441 = getelementptr inbounds i8, ptr %440, i64 21
  %442 = call ptr @strrchr(ptr noundef %441, i32 noundef 47) #7
  %443 = getelementptr inbounds i8, ptr %442, i64 1
  br label %449

444:                                              ; preds = %428
  %445 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %446 = getelementptr inbounds %struct.s2n_debug_info, ptr %445, i32 0, i32 0
  %447 = load ptr, ptr %446, align 8, !tbaa !11
  %448 = getelementptr inbounds i8, ptr %447, i64 21
  br label %449

449:                                              ; preds = %444, %437
  %450 = phi ptr [ %443, %437 ], [ %448, %444 ]
  %451 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %452 = getelementptr inbounds %struct.s2n_debug_info, ptr %451, i32 0, i32 1
  store ptr %450, ptr %452, align 8, !tbaa !13
  %453 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 469762112, ptr %453, align 4, !tbaa !9
  %454 = call i32 @s2n_calculate_stacktrace()
  br label %455

455:                                              ; preds = %449
  br label %456

456:                                              ; preds = %455
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %664

457:                                              ; No predecessors!
  br label %458

458:                                              ; preds = %457
  br label %459

459:                                              ; preds = %458, %415
  br label %460

460:                                              ; preds = %459
  br label %461

461:                                              ; preds = %460
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #8
  store i32 0, ptr %10, align 4, !tbaa !9
  br label %462

462:                                              ; preds = %461
  %463 = load ptr, ptr %5, align 8, !tbaa !5
  %464 = call i32 @s2n_connection_serialization_length(ptr noundef %463, ptr noundef %10)
  %465 = icmp sgt i32 %464, -1
  br i1 %465, label %467, label %466

466:                                              ; preds = %462
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %663

467:                                              ; preds = %462
  br label %468

468:                                              ; preds = %467
  br label %469

469:                                              ; preds = %468
  br label %470

470:                                              ; preds = %469
  %471 = load i32, ptr %7, align 4, !tbaa !9
  %472 = load i32, ptr %10, align 4, !tbaa !9
  %473 = icmp uge i32 %471, %472
  br i1 %473, label %507, label %474

474:                                              ; preds = %470
  br label %475

475:                                              ; preds = %474
  br label %476

476:                                              ; preds = %475
  %477 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %478 = getelementptr inbounds %struct.s2n_debug_info, ptr %477, i32 0, i32 0
  store ptr @.str.17, ptr %478, align 8, !tbaa !11
  %479 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %480 = getelementptr inbounds %struct.s2n_debug_info, ptr %479, i32 0, i32 0
  %481 = load ptr, ptr %480, align 8, !tbaa !11
  %482 = getelementptr inbounds i8, ptr %481, i64 21
  %483 = call ptr @strrchr(ptr noundef %482, i32 noundef 47) #7
  %484 = icmp ne ptr %483, null
  br i1 %484, label %485, label %492

485:                                              ; preds = %476
  %486 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %487 = getelementptr inbounds %struct.s2n_debug_info, ptr %486, i32 0, i32 0
  %488 = load ptr, ptr %487, align 8, !tbaa !11
  %489 = getelementptr inbounds i8, ptr %488, i64 21
  %490 = call ptr @strrchr(ptr noundef %489, i32 noundef 47) #7
  %491 = getelementptr inbounds i8, ptr %490, i64 1
  br label %497

492:                                              ; preds = %476
  %493 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %494 = getelementptr inbounds %struct.s2n_debug_info, ptr %493, i32 0, i32 0
  %495 = load ptr, ptr %494, align 8, !tbaa !11
  %496 = getelementptr inbounds i8, ptr %495, i64 21
  br label %497

497:                                              ; preds = %492, %485
  %498 = phi ptr [ %491, %485 ], [ %496, %492 ]
  %499 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %500 = getelementptr inbounds %struct.s2n_debug_info, ptr %499, i32 0, i32 1
  store ptr %498, ptr %500, align 8, !tbaa !13
  %501 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 469762120, ptr %501, align 4, !tbaa !9
  %502 = call i32 @s2n_calculate_stacktrace()
  br label %503

503:                                              ; preds = %497
  br label %504

504:                                              ; preds = %503
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %663

505:                                              ; No predecessors!
  br label %506

506:                                              ; preds = %505
  br label %507

507:                                              ; preds = %506, %470
  br label %508

508:                                              ; preds = %507
  br label %509

509:                                              ; preds = %508
  call void @llvm.lifetime.start.p0(i64 24, ptr %11) #8
  call void @llvm.memset.p0.i64(ptr align 8 %11, i8 0, i64 24, i1 false)
  br label %510

510:                                              ; preds = %509
  %511 = load ptr, ptr %6, align 8, !tbaa !5
  %512 = load i32, ptr %7, align 4, !tbaa !9
  %513 = call i32 @s2n_blob_init(ptr noundef %11, ptr noundef %511, i32 noundef %512)
  %514 = icmp sgt i32 %513, -1
  br i1 %514, label %516, label %515

515:                                              ; preds = %510
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %662

516:                                              ; preds = %510
  br label %517

517:                                              ; preds = %516
  br label %518

518:                                              ; preds = %517
  call void @llvm.lifetime.start.p0(i64 40, ptr %12) #8
  call void @llvm.memset.p0.i64(ptr align 8 %12, i8 0, i64 40, i1 false)
  br label %519

519:                                              ; preds = %518
  %520 = call i32 @s2n_stuffer_init(ptr noundef %12, ptr noundef %11)
  %521 = icmp sgt i32 %520, -1
  br i1 %521, label %523, label %522

522:                                              ; preds = %519
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %661

523:                                              ; preds = %519
  br label %524

524:                                              ; preds = %523
  br label %525

525:                                              ; preds = %524
  br label %526

526:                                              ; preds = %525
  %527 = call i32 @s2n_stuffer_write_uint64(ptr noundef %12, i64 noundef 1)
  %528 = icmp sgt i32 %527, -1
  br i1 %528, label %530, label %529

529:                                              ; preds = %526
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %661

530:                                              ; preds = %526
  br label %531

531:                                              ; preds = %530
  br label %532

532:                                              ; preds = %531
  br label %533

533:                                              ; preds = %532
  %534 = load ptr, ptr %5, align 8, !tbaa !5
  %535 = getelementptr inbounds %struct.s2n_connection, ptr %534, i32 0, i32 23
  %536 = load i8, ptr %535, align 4, !tbaa !58
  %537 = zext i8 %536 to i32
  %538 = sdiv i32 %537, 10
  %539 = trunc i32 %538 to i8
  %540 = call i32 @s2n_stuffer_write_uint8(ptr noundef %12, i8 noundef zeroext %539)
  %541 = icmp sgt i32 %540, -1
  br i1 %541, label %543, label %542

542:                                              ; preds = %533
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %661

543:                                              ; preds = %533
  br label %544

544:                                              ; preds = %543
  br label %545

545:                                              ; preds = %544
  br label %546

546:                                              ; preds = %545
  %547 = load ptr, ptr %5, align 8, !tbaa !5
  %548 = getelementptr inbounds %struct.s2n_connection, ptr %547, i32 0, i32 23
  %549 = load i8, ptr %548, align 4, !tbaa !58
  %550 = zext i8 %549 to i32
  %551 = srem i32 %550, 10
  %552 = trunc i32 %551 to i8
  %553 = call i32 @s2n_stuffer_write_uint8(ptr noundef %12, i8 noundef zeroext %552)
  %554 = icmp sgt i32 %553, -1
  br i1 %554, label %556, label %555

555:                                              ; preds = %546
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %661

556:                                              ; preds = %546
  br label %557

557:                                              ; preds = %556
  br label %558

558:                                              ; preds = %557
  br label %559

559:                                              ; preds = %558
  %560 = load ptr, ptr %5, align 8, !tbaa !5
  %561 = getelementptr inbounds %struct.s2n_connection, ptr %560, i32 0, i32 27
  %562 = load ptr, ptr %561, align 8, !tbaa !14
  %563 = getelementptr inbounds %struct.s2n_crypto_parameters, ptr %562, i32 0, i32 0
  %564 = load ptr, ptr %563, align 8, !tbaa !42
  %565 = getelementptr inbounds %struct.s2n_cipher_suite, ptr %564, i32 0, i32 3
  %566 = getelementptr inbounds [2 x i8], ptr %565, i64 0, i64 0
  %567 = call i32 @s2n_stuffer_write_bytes(ptr noundef %12, ptr noundef %566, i32 noundef 2)
  %568 = icmp sgt i32 %567, -1
  br i1 %568, label %570, label %569

569:                                              ; preds = %559
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %661

570:                                              ; preds = %559
  br label %571

571:                                              ; preds = %570
  br label %572

572:                                              ; preds = %571
  br label %573

573:                                              ; preds = %572
  %574 = load ptr, ptr %5, align 8, !tbaa !5
  %575 = getelementptr inbounds %struct.s2n_connection, ptr %574, i32 0, i32 27
  %576 = load ptr, ptr %575, align 8, !tbaa !14
  %577 = getelementptr inbounds %struct.s2n_crypto_parameters, ptr %576, i32 0, i32 7
  %578 = getelementptr inbounds [8 x i8], ptr %577, i64 0, i64 0
  %579 = call i32 @s2n_stuffer_write_bytes(ptr noundef %12, ptr noundef %578, i32 noundef 8)
  %580 = icmp sgt i32 %579, -1
  br i1 %580, label %582, label %581

581:                                              ; preds = %573
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %661

582:                                              ; preds = %573
  br label %583

583:                                              ; preds = %582
  br label %584

584:                                              ; preds = %583
  br label %585

585:                                              ; preds = %584
  %586 = load ptr, ptr %5, align 8, !tbaa !5
  %587 = getelementptr inbounds %struct.s2n_connection, ptr %586, i32 0, i32 27
  %588 = load ptr, ptr %587, align 8, !tbaa !14
  %589 = getelementptr inbounds %struct.s2n_crypto_parameters, ptr %588, i32 0, i32 8
  %590 = getelementptr inbounds [8 x i8], ptr %589, i64 0, i64 0
  %591 = call i32 @s2n_stuffer_write_bytes(ptr noundef %12, ptr noundef %590, i32 noundef 8)
  %592 = icmp sgt i32 %591, -1
  br i1 %592, label %594, label %593

593:                                              ; preds = %585
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %661

594:                                              ; preds = %585
  br label %595

595:                                              ; preds = %594
  br label %596

596:                                              ; preds = %595
  br label %597

597:                                              ; preds = %596
  %598 = load ptr, ptr %5, align 8, !tbaa !5
  %599 = getelementptr inbounds %struct.s2n_connection, ptr %598, i32 0, i32 53
  %600 = load i16, ptr %599, align 8, !tbaa !59
  %601 = call i32 @s2n_stuffer_write_uint16(ptr noundef %12, i16 noundef zeroext %600)
  %602 = icmp sgt i32 %601, -1
  br i1 %602, label %604, label %603

603:                                              ; preds = %597
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %661

604:                                              ; preds = %597
  br label %605

605:                                              ; preds = %604
  br label %606

606:                                              ; preds = %605
  %607 = load ptr, ptr %5, align 8, !tbaa !5
  %608 = getelementptr inbounds %struct.s2n_connection, ptr %607, i32 0, i32 23
  %609 = load i8, ptr %608, align 4, !tbaa !58
  %610 = zext i8 %609 to i32
  %611 = icmp sge i32 %610, 34
  br i1 %611, label %612, label %624

612:                                              ; preds = %606
  br label %613

613:                                              ; preds = %612
  %614 = load ptr, ptr %5, align 8, !tbaa !5
  %615 = call i32 @s2n_connection_serialize_tls13_secrets(ptr noundef %614, ptr noundef %12)
  %616 = getelementptr inbounds %struct.s2n_result, ptr %13, i32 0, i32 0
  store i32 %615, ptr %616, align 4
  %617 = getelementptr inbounds %struct.s2n_result, ptr %13, i32 0, i32 0
  %618 = load i32, ptr %617, align 4
  %619 = call zeroext i1 @s2n_result_is_ok(i32 %618)
  br i1 %619, label %621, label %620

620:                                              ; preds = %613
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %661

621:                                              ; preds = %613
  br label %622

622:                                              ; preds = %621
  br label %623

623:                                              ; preds = %622
  br label %636

624:                                              ; preds = %606
  br label %625

625:                                              ; preds = %624
  %626 = load ptr, ptr %5, align 8, !tbaa !5
  %627 = call i32 @s2n_connection_serialize_secrets(ptr noundef %626, ptr noundef %12)
  %628 = getelementptr inbounds %struct.s2n_result, ptr %14, i32 0, i32 0
  store i32 %627, ptr %628, align 4
  %629 = getelementptr inbounds %struct.s2n_result, ptr %14, i32 0, i32 0
  %630 = load i32, ptr %629, align 4
  %631 = call zeroext i1 @s2n_result_is_ok(i32 %630)
  br i1 %631, label %633, label %632

632:                                              ; preds = %625
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %661

633:                                              ; preds = %625
  br label %634

634:                                              ; preds = %633
  br label %635

635:                                              ; preds = %634
  br label %636

636:                                              ; preds = %635, %623
  br label %637

637:                                              ; preds = %636
  %638 = load ptr, ptr %5, align 8, !tbaa !5
  %639 = call i32 @s2n_connection_set_closed(ptr noundef %638)
  %640 = getelementptr inbounds %struct.s2n_result, ptr %15, i32 0, i32 0
  store i32 %639, ptr %640, align 4
  %641 = getelementptr inbounds %struct.s2n_result, ptr %15, i32 0, i32 0
  %642 = load i32, ptr %641, align 4
  %643 = call zeroext i1 @s2n_result_is_ok(i32 %642)
  br i1 %643, label %645, label %644

644:                                              ; preds = %637
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %661

645:                                              ; preds = %637
  br label %646

646:                                              ; preds = %645
  br label %647

647:                                              ; preds = %646
  br label %648

648:                                              ; preds = %647
  %649 = load ptr, ptr %5, align 8, !tbaa !5
  %650 = getelementptr inbounds %struct.s2n_connection, ptr %649, i32 0, i32 27
  %651 = load ptr, ptr %650, align 8, !tbaa !14
  %652 = call i32 @s2n_crypto_parameters_wipe(ptr noundef %651)
  %653 = getelementptr inbounds %struct.s2n_result, ptr %16, i32 0, i32 0
  store i32 %652, ptr %653, align 4
  %654 = getelementptr inbounds %struct.s2n_result, ptr %16, i32 0, i32 0
  %655 = load i32, ptr %654, align 4
  %656 = call zeroext i1 @s2n_result_is_ok(i32 %655)
  br i1 %656, label %658, label %657

657:                                              ; preds = %648
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %661

658:                                              ; preds = %648
  br label %659

659:                                              ; preds = %658
  br label %660

660:                                              ; preds = %659
  store i32 0, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %661

661:                                              ; preds = %660, %657, %644, %632, %620, %603, %593, %581, %569, %555, %542, %529, %522
  call void @llvm.lifetime.end.p0(i64 40, ptr %12) #8
  br label %662

662:                                              ; preds = %661, %515
  call void @llvm.lifetime.end.p0(i64 24, ptr %11) #8
  br label %663

663:                                              ; preds = %662, %504, %466
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #8
  br label %664

664:                                              ; preds = %663, %456, %409, %362, %315
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #8
  br label %665

665:                                              ; preds = %664, %277, %241, %201, %165, %127, %87, %49
  %666 = load i32, ptr %4, align 4
  ret i32 %666
}

declare zeroext i1 @s2n_handshake_is_complete(ptr noundef) #3

declare zeroext i1 @s2n_connection_check_io_status(ptr noundef, i32 noundef) #3

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

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

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

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

declare i32 @s2n_stuffer_write_uint8(ptr noundef, i8 noundef zeroext) #3

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

declare i32 @s2n_stuffer_write_uint16(ptr noundef, i16 noundef zeroext) #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden zeroext i1 @s2n_result_is_ok(i32) #6

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

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

declare i32 @s2n_connection_set_closed(ptr noundef) #3

declare i32 @s2n_crypto_parameters_wipe(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 speculatable willreturn memory(none) }
attributes #2 = { 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 #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 nosync nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { inlinehint 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 #7 = { nounwind willreturn memory(read) }
attributes #8 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 0}
!12 = !{!"s2n_debug_info", !6, i64 0, !6, i64 8}
!13 = !{!12, !6, i64 8}
!14 = !{!15, !6, i64 232}
!15 = !{!"s2n_connection", !10, i64 0, !10, i64 0, !10, i64 0, !10, i64 0, !10, i64 0, !10, i64 0, !10, i64 0, !10, i64 0, !10, i64 1, !10, i64 1, !10, i64 1, !10, i64 1, !10, i64 1, !10, i64 1, !10, i64 1, !10, i64 1, !10, i64 2, !10, i64 2, !10, i64 2, !10, i64 2, !10, i64 2, !10, i64 2, !10, i64 2, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !7, i64 80, !7, i64 102, !7, i64 124, !10, i64 148, !10, i64 152, !16, i64 160, !17, i64 168, !17, i64 176, !7, i64 184, !7, i64 216, !7, i64 217, !7, i64 218, !7, i64 219, !7, i64 220, !7, i64 221, !7, i64 222, !6, i64 224, !6, i64 232, !18, i64 240, !6, i64 632, !6, i64 640, !19, i64 648, !26, i64 1144, !29, i64 1688, !6, i64 1752, !7, i64 1760, !10, i64 1764, !7, i64 1768, !32, i64 1776, !32, i64 1816, !32, i64 1856, !32, i64 1896, !10, i64 1936, !17, i64 1944, !7, i64 1952, !32, i64 1960, !7, i64 2000, !7, i64 2001, !7, i64 2002, !25, i64 2003, !33, i64 2004, !33, i64 2008, !34, i64 2016, !31, i64 2208, !10, i64 2212, !31, i64 2216, !17, i64 2224, !7, i64 2232, !17, i64 2240, !17, i64 2248, !17, i64 2256, !33, i64 2264, !33, i64 2268, !7, i64 2272, !7, i64 2528, !10, i64 2784, !24, i64 2792, !10, i64 2816, !24, i64 2824, !24, i64 2848, !24, i64 2872, !36, i64 2896, !38, i64 3704, !6, i64 3760, !6, i64 3768, !7, i64 3776, !10, i64 3780, !24, i64 3784, !10, i64 3808, !40, i64 3816, !7, i64 3848, !32, i64 3992, !24, i64 4032, !24, i64 4056, !25, i64 4080, !25, i64 4081, !25, i64 4082, !31, i64 4084, !31, i64 4086, !10, i64 4088, !10, i64 4092, !24, i64 4096, !10, i64 4120, !41, i64 4128, !33, i64 4176, !7, i64 4180, !7, i64 4181}
!16 = !{!"s2n_timer", !17, i64 0}
!17 = !{!"long", !7, i64 0}
!18 = !{!"s2n_secrets", !7, i64 0, !10, i64 388}
!19 = !{!"s2n_kex_parameters", !20, i64 0, !21, i64 8, !7, i64 24, !21, i64 56, !22, i64 72, !22, i64 184, !7, i64 296, !23, i64 360, !24, i64 448, !24, i64 472}
!20 = !{!"s2n_dh_params", !6, i64 0}
!21 = !{!"s2n_ecc_evp_params", !6, i64 0, !6, i64 8}
!22 = !{!"s2n_kem_group_params", !6, i64 0, !23, i64 8, !21, i64 96}
!23 = !{!"s2n_kem_params", !6, i64 0, !24, i64 8, !24, i64 32, !24, i64 56, !25, i64 80}
!24 = !{!"s2n_blob", !6, i64 0, !10, i64 8, !10, i64 12, !10, i64 16}
!25 = !{!"_Bool", !7, i64 0}
!26 = !{!"s2n_handshake_parameters", !27, i64 0, !27, i64 48, !24, i64 96, !10, i64 120, !28, i64 124, !6, i64 384, !6, i64 392, !6, i64 400, !7, i64 408, !7, i64 440, !7, i64 472, !7, i64 473, !7, i64 474, !7, i64 506}
!27 = !{!"s2n_pkey", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40}
!28 = !{!"s2n_sig_scheme_list", !7, i64 0, !7, i64 256}
!29 = !{!"s2n_psk_parameters", !10, i64 0, !30, i64 8, !31, i64 40, !31, i64 42, !6, i64 48, !10, i64 56}
!30 = !{!"s2n_array", !24, i64 0, !10, i64 24, !10, i64 28}
!31 = !{!"short", !7, i64 0}
!32 = !{!"s2n_stuffer", !24, i64 0, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !10, i64 36, !10, i64 36}
!33 = !{!"", !10, i64 0}
!34 = !{!"s2n_handshake", !32, i64 0, !6, i64 40, !7, i64 48, !7, i64 56, !7, i64 104, !7, i64 152, !10, i64 156, !10, i64 160, !10, i64 164, !10, i64 168, !35, i64 176, !10, i64 184, !10, i64 184, !10, i64 184, !10, i64 184, !10, i64 188}
!35 = !{!"s2n_offered_early_data", !6, i64 0}
!36 = !{!"s2n_client_hello", !24, i64 0, !37, i64 24, !24, i64 728, !24, i64 752, !24, i64 776, !7, i64 800, !7, i64 801, !10, i64 802, !10, i64 802, !10, i64 802, !10, i64 802, !10, i64 802, !10, i64 802, !10, i64 802}
!37 = !{!"", !7, i64 0, !24, i64 672, !31, i64 696}
!38 = !{!"s2n_x509_validator", !6, i64 0, !6, i64 8, !7, i64 16, !7, i64 17, !31, i64 18, !6, i64 24, !10, i64 32, !6, i64 40, !39, i64 48, !25, i64 52}
!39 = !{!"s2n_cert_validation_info", !10, i64 0, !10, i64 0}
!40 = !{!"s2n_ticket_fields", !24, i64 0, !10, i64 24}
!41 = !{!"s2n_post_handshake", !32, i64 0, !7, i64 40}
!42 = !{!43, !6, i64 0}
!43 = !{!"s2n_crypto_parameters", !6, i64 0, !44, i64 8, !44, i64 16, !45, i64 24, !45, i64 456, !7, i64 888, !7, i64 904, !7, i64 920, !7, i64 928}
!44 = !{!"s2n_session_key", !6, i64 0}
!45 = !{!"s2n_hmac_state", !10, i64 0, !31, i64 4, !10, i64 8, !31, i64 12, !7, i64 14, !46, i64 16, !46, i64 72, !46, i64 128, !46, i64 184, !7, i64 240, !7, i64 368}
!46 = !{!"s2n_hash_state", !6, i64 0, !10, i64 8, !7, i64 12, !17, i64 16, !7, i64 24}
!47 = !{!15, !6, i64 8}
!48 = !{!49, !10, i64 440}
!49 = !{!"s2n_config", !10, i64 0, !10, i64 0, !10, i64 0, !10, i64 0, !10, i64 0, !10, i64 0, !10, i64 0, !10, i64 0, !10, i64 1, !10, i64 1, !10, i64 1, !10, i64 1, !10, i64 1, !10, i64 1, !10, i64 1, !10, i64 1, !10, i64 2, !10, i64 2, !10, i64 2, !10, i64 2, !6, i64 8, !6, i64 16, !50, i64 24, !24, i64 56, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !10, i64 128, !10, i64 132, !6, i64 136, !17, i64 144, !6, i64 152, !17, i64 160, !17, i64 168, !6, i64 176, !6, i64 184, !6, i64 192, !6, i64 200, !6, i64 208, !6, i64 216, !10, i64 224, !7, i64 228, !10, i64 232, !10, i64 236, !6, i64 240, !6, i64 248, !6, i64 256, !6, i64 264, !6, i64 272, !6, i64 280, !6, i64 288, !7, i64 296, !7, i64 297, !51, i64 304, !31, i64 320, !6, i64 328, !6, i64 336, !6, i64 344, !6, i64 352, !6, i64 360, !6, i64 368, !6, i64 376, !6, i64 384, !10, i64 392, !10, i64 396, !10, i64 400, !6, i64 408, !10, i64 416, !10, i64 420, !6, i64 424, !6, i64 432, !10, i64 440, !24, i64 448}
!50 = !{!"certs_by_type", !7, i64 0}
!51 = !{!"s2n_x509_trust_store", !6, i64 0, !10, i64 8}
!52 = !{!15, !10, i64 1804}
!53 = !{!15, !10, i64 1800}
!54 = !{!15, !10, i64 1884}
!55 = !{!15, !10, i64 1880}
!56 = !{!15, !10, i64 1924}
!57 = !{!15, !10, i64 1920}
!58 = !{!15, !7, i64 220}
!59 = !{!15, !31, i64 2208}


; 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.s2n_debug_info = type { ptr, ptr }
%struct.s2n_blob = type { ptr, i32, i32, i8 }
%struct.s2n_stuffer = type { %struct.s2n_blob, i32, i32, i32, i8 }

@_s2n_debug_info = external thread_local local_unnamed_addr global %struct.s2n_debug_info, align 8
@s2n_errno = external thread_local local_unnamed_addr global i32, align 4
@.str.6 = external hidden unnamed_addr constant [100 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [100 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [100 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [100 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [100 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [100 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [100 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [101 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [101 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [101 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [101 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [101 x i8], align 1

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare nonnull ptr @llvm.threadlocal.address.p0(ptr nonnull) #1

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare ptr @strrchr(ptr noundef, i32 noundef) local_unnamed_addr #2

declare i32 @s2n_calculate_stacktrace() local_unnamed_addr #3

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

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

; Function Attrs: nounwind uwtable
define dso_local range(i32 -1, 1) i32 @s2n_connection_serialize(ptr noundef %0, ptr noundef %1, i32 noundef %2) local_unnamed_addr #0 {
  %4 = alloca i32, align 4
  %5 = alloca %struct.s2n_blob, align 8
  %6 = alloca %struct.s2n_stuffer, align 8
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %7, label %15

7:                                                ; preds = %3
  %8 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr @.str.6, ptr %8, align 8, !tbaa !5
  %9 = tail call ptr @strrchr(ptr noundef nonnull dereferenceable(1) getelementptr inbounds (i8, ptr @.str.6, i64 21), i32 noundef 47) #7
  %.not50 = icmp eq ptr %9, null
  %10 = getelementptr inbounds i8, ptr %9, i64 1
  %11 = select i1 %.not50, ptr getelementptr inbounds (i8, ptr @.str.6, i64 21), ptr %10
  %12 = getelementptr inbounds i8, ptr %8, i64 8
  store ptr %11, ptr %12, align 8, !tbaa !10
  %13 = tail call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %13, align 4, !tbaa !11
  %14 = tail call i32 @s2n_calculate_stacktrace() #8
  br label %202

15:                                               ; preds = %3
  %16 = getelementptr inbounds i8, ptr %0, i64 232
  %17 = load ptr, ptr %16, align 8, !tbaa !13
  %.not51 = icmp eq ptr %17, null
  br i1 %.not51, label %18, label %26

18:                                               ; preds = %15
  %19 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr @.str.7, ptr %19, align 8, !tbaa !5
  %20 = tail call ptr @strrchr(ptr noundef nonnull dereferenceable(1) getelementptr inbounds (i8, ptr @.str.7, i64 21), i32 noundef 47) #7
  %.not52 = icmp eq ptr %20, null
  %21 = getelementptr inbounds i8, ptr %20, i64 1
  %22 = select i1 %.not52, ptr getelementptr inbounds (i8, ptr @.str.7, i64 21), ptr %21
  %23 = getelementptr inbounds i8, ptr %19, i64 8
  store ptr %22, ptr %23, align 8, !tbaa !10
  %24 = tail call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %24, align 4, !tbaa !11
  %25 = tail call i32 @s2n_calculate_stacktrace() #8
  br label %202

26:                                               ; preds = %15
  %27 = load ptr, ptr %17, align 8, !tbaa !41
  %.not53 = icmp eq ptr %27, null
  br i1 %.not53, label %28, label %36

28:                                               ; preds = %26
  %29 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr @.str.8, ptr %29, align 8, !tbaa !5
  %30 = tail call ptr @strrchr(ptr noundef nonnull dereferenceable(1) getelementptr inbounds (i8, ptr @.str.8, i64 21), i32 noundef 47) #7
  %.not54 = icmp eq ptr %30, null
  %31 = getelementptr inbounds i8, ptr %30, i64 1
  %32 = select i1 %.not54, ptr getelementptr inbounds (i8, ptr @.str.8, i64 21), ptr %31
  %33 = getelementptr inbounds i8, ptr %29, i64 8
  store ptr %32, ptr %33, align 8, !tbaa !10
  %34 = tail call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %34, align 4, !tbaa !11
  %35 = tail call i32 @s2n_calculate_stacktrace() #8
  br label %202

36:                                               ; preds = %26
  %37 = getelementptr inbounds i8, ptr %0, i64 8
  %38 = load ptr, ptr %37, align 8, !tbaa !46
  %.not55 = icmp eq ptr %38, null
  br i1 %.not55, label %39, label %47

39:                                               ; preds = %36
  %40 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr @.str.9, ptr %40, align 8, !tbaa !5
  %41 = tail call ptr @strrchr(ptr noundef nonnull dereferenceable(1) getelementptr inbounds (i8, ptr @.str.9, i64 21), i32 noundef 47) #7
  %.not56 = icmp eq ptr %41, null
  %42 = getelementptr inbounds i8, ptr %41, i64 1
  %43 = select i1 %.not56, ptr getelementptr inbounds (i8, ptr @.str.9, i64 21), ptr %42
  %44 = getelementptr inbounds i8, ptr %40, i64 8
  store ptr %43, ptr %44, align 8, !tbaa !10
  %45 = tail call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %45, align 4, !tbaa !11
  %46 = tail call i32 @s2n_calculate_stacktrace() #8
  br label %202

47:                                               ; preds = %36
  %.not57 = icmp eq ptr %1, null
  br i1 %.not57, label %48, label %56

48:                                               ; preds = %47
  %49 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr @.str.10, ptr %49, align 8, !tbaa !5
  %50 = tail call ptr @strrchr(ptr noundef nonnull dereferenceable(1) getelementptr inbounds (i8, ptr @.str.10, i64 21), i32 noundef 47) #7
  %.not58 = icmp eq ptr %50, null
  %51 = getelementptr inbounds i8, ptr %50, i64 1
  %52 = select i1 %.not58, ptr getelementptr inbounds (i8, ptr @.str.10, i64 21), ptr %51
  %53 = getelementptr inbounds i8, ptr %49, i64 8
  store ptr %52, ptr %53, align 8, !tbaa !10
  %54 = tail call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %54, align 4, !tbaa !11
  %55 = tail call i32 @s2n_calculate_stacktrace() #8
  br label %202

56:                                               ; preds = %47
  %57 = getelementptr inbounds i8, ptr %38, i64 440
  %58 = load i32, ptr %57, align 8, !tbaa !47
  %.not59 = icmp eq i32 %58, 0
  br i1 %.not59, label %59, label %67

59:                                               ; preds = %56
  %60 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr @.str.11, ptr %60, align 8, !tbaa !5
  %61 = tail call ptr @strrchr(ptr noundef nonnull dereferenceable(1) getelementptr inbounds (i8, ptr @.str.11, i64 21), i32 noundef 47) #7
  %.not60 = icmp eq ptr %61, null
  %62 = getelementptr inbounds i8, ptr %61, i64 1
  %63 = select i1 %.not60, ptr getelementptr inbounds (i8, ptr @.str.11, i64 21), ptr %62
  %64 = getelementptr inbounds i8, ptr %60, i64 8
  store ptr %63, ptr %64, align 8, !tbaa !10
  %65 = tail call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 469762112, ptr %65, align 4, !tbaa !11
  %66 = tail call i32 @s2n_calculate_stacktrace() #8
  br label %202

67:                                               ; preds = %56
  %68 = tail call zeroext i1 @s2n_handshake_is_complete(ptr noundef nonnull %0) #8
  br i1 %68, label %77, label %69

69:                                               ; preds = %67
  %70 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr @.str.12, ptr %70, align 8, !tbaa !5
  %71 = tail call ptr @strrchr(ptr noundef nonnull dereferenceable(1) getelementptr inbounds (i8, ptr @.str.12, i64 21), i32 noundef 47) #7
  %.not61 = icmp eq ptr %71, null
  %72 = getelementptr inbounds i8, ptr %71, i64 1
  %73 = select i1 %.not61, ptr getelementptr inbounds (i8, ptr @.str.12, i64 21), ptr %72
  %74 = getelementptr inbounds i8, ptr %70, i64 8
  store ptr %73, ptr %74, align 8, !tbaa !10
  %75 = tail call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 469762124, ptr %75, align 4, !tbaa !11
  %76 = tail call i32 @s2n_calculate_stacktrace() #8
  br label %202

77:                                               ; preds = %67
  %78 = tail call zeroext i1 @s2n_connection_check_io_status(ptr noundef nonnull %0, i32 noundef 2) #8
  br i1 %78, label %87, label %79

79:                                               ; preds = %77
  %80 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr @.str.13, ptr %80, align 8, !tbaa !5
  %81 = tail call ptr @strrchr(ptr noundef nonnull dereferenceable(1) getelementptr inbounds (i8, ptr @.str.13, i64 21), i32 noundef 47) #7
  %.not62 = icmp eq ptr %81, null
  %82 = getelementptr inbounds i8, ptr %81, i64 1
  %83 = select i1 %.not62, ptr getelementptr inbounds (i8, ptr @.str.13, i64 21), ptr %82
  %84 = getelementptr inbounds i8, ptr %80, i64 8
  store ptr %83, ptr %84, align 8, !tbaa !10
  %85 = tail call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 134217728, ptr %85, align 4, !tbaa !11
  %86 = tail call i32 @s2n_calculate_stacktrace() #8
  br label %202

87:                                               ; preds = %77
  %88 = getelementptr inbounds i8, ptr %0, i64 1804
  %89 = load i32, ptr %88, align 4, !tbaa !51
  %90 = getelementptr inbounds i8, ptr %0, i64 1800
  %91 = load i32, ptr %90, align 8, !tbaa !52
  %92 = icmp eq i32 %89, %91
  br i1 %92, label %101, label %93

93:                                               ; preds = %87
  %94 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr @.str.14, ptr %94, align 8, !tbaa !5
  %95 = tail call ptr @strrchr(ptr noundef nonnull dereferenceable(1) getelementptr inbounds (i8, ptr @.str.14, i64 21), i32 noundef 47) #7
  %.not63 = icmp eq ptr %95, null
  %96 = getelementptr inbounds i8, ptr %95, i64 1
  %97 = select i1 %.not63, ptr getelementptr inbounds (i8, ptr @.str.14, i64 21), ptr %96
  %98 = getelementptr inbounds i8, ptr %94, i64 8
  store ptr %97, ptr %98, align 8, !tbaa !10
  %99 = tail call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 469762112, ptr %99, align 4, !tbaa !11
  %100 = tail call i32 @s2n_calculate_stacktrace() #8
  br label %202

101:                                              ; preds = %87
  %102 = getelementptr inbounds i8, ptr %0, i64 1884
  %103 = load i32, ptr %102, align 4, !tbaa !53
  %104 = getelementptr inbounds i8, ptr %0, i64 1880
  %105 = load i32, ptr %104, align 8, !tbaa !54
  %106 = icmp eq i32 %103, %105
  br i1 %106, label %115, label %107

107:                                              ; preds = %101
  %108 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr @.str.15, ptr %108, align 8, !tbaa !5
  %109 = tail call ptr @strrchr(ptr noundef nonnull dereferenceable(1) getelementptr inbounds (i8, ptr @.str.15, i64 21), i32 noundef 47) #7
  %.not64 = icmp eq ptr %109, null
  %110 = getelementptr inbounds i8, ptr %109, i64 1
  %111 = select i1 %.not64, ptr getelementptr inbounds (i8, ptr @.str.15, i64 21), ptr %110
  %112 = getelementptr inbounds i8, ptr %108, i64 8
  store ptr %111, ptr %112, align 8, !tbaa !10
  %113 = tail call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 469762112, ptr %113, align 4, !tbaa !11
  %114 = tail call i32 @s2n_calculate_stacktrace() #8
  br label %202

115:                                              ; preds = %101
  %116 = getelementptr inbounds i8, ptr %0, i64 1924
  %117 = load i32, ptr %116, align 4, !tbaa !55
  %118 = getelementptr inbounds i8, ptr %0, i64 1920
  %119 = load i32, ptr %118, align 8, !tbaa !56
  %120 = icmp eq i32 %117, %119
  br i1 %120, label %129, label %121

121:                                              ; preds = %115
  %122 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr @.str.16, ptr %122, align 8, !tbaa !5
  %123 = tail call ptr @strrchr(ptr noundef nonnull dereferenceable(1) getelementptr inbounds (i8, ptr @.str.16, i64 21), i32 noundef 47) #7
  %.not65 = icmp eq ptr %123, null
  %124 = getelementptr inbounds i8, ptr %123, i64 1
  %125 = select i1 %.not65, ptr getelementptr inbounds (i8, ptr @.str.16, i64 21), ptr %124
  %126 = getelementptr inbounds i8, ptr %122, i64 8
  store ptr %125, ptr %126, align 8, !tbaa !10
  %127 = tail call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 469762112, ptr %127, align 4, !tbaa !11
  %128 = tail call i32 @s2n_calculate_stacktrace() #8
  br label %202

129:                                              ; preds = %115
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #8
  store i32 0, ptr %4, align 4, !tbaa !11
  %130 = call i32 @s2n_connection_serialization_length(ptr noundef nonnull %0, ptr noundef nonnull %4)
  %131 = icmp sgt i32 %130, -1
  br i1 %131, label %132, label %201

132:                                              ; preds = %129
  %133 = load i32, ptr %4, align 4, !tbaa !11
  %.not66 = icmp ugt i32 %133, %2
  br i1 %.not66, label %134, label %142

134:                                              ; preds = %132
  %135 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr @.str.17, ptr %135, align 8, !tbaa !5
  %136 = call ptr @strrchr(ptr noundef nonnull dereferenceable(1) getelementptr inbounds (i8, ptr @.str.17, i64 21), i32 noundef 47) #7
  %.not67 = icmp eq ptr %136, null
  %137 = getelementptr inbounds i8, ptr %136, i64 1
  %138 = select i1 %.not67, ptr getelementptr inbounds (i8, ptr @.str.17, i64 21), ptr %137
  %139 = getelementptr inbounds i8, ptr %135, i64 8
  store ptr %138, ptr %139, align 8, !tbaa !10
  %140 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 469762120, ptr %140, align 4, !tbaa !11
  %141 = call i32 @s2n_calculate_stacktrace() #8
  br label %201

142:                                              ; preds = %132
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #8
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %5, i8 0, i64 24, i1 false)
  %143 = call i32 @s2n_blob_init(ptr noundef nonnull %5, ptr noundef nonnull %1, i32 noundef %2) #8
  %144 = icmp sgt i32 %143, -1
  br i1 %144, label %145, label %200

145:                                              ; preds = %142
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %6) #8
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(40) %6, i8 0, i64 40, i1 false)
  %146 = call i32 @s2n_stuffer_init(ptr noundef nonnull %6, ptr noundef nonnull %5) #8
  %147 = icmp sgt i32 %146, -1
  br i1 %147, label %148, label %199

148:                                              ; preds = %145
  %149 = call i32 @s2n_stuffer_write_uint64(ptr noundef nonnull %6, i64 noundef 1) #8
  %150 = icmp sgt i32 %149, -1
  br i1 %150, label %151, label %199

151:                                              ; preds = %148
  %152 = getelementptr inbounds i8, ptr %0, i64 220
  %153 = load i8, ptr %152, align 4, !tbaa !57
  %154 = udiv i8 %153, 10
  %155 = call i32 @s2n_stuffer_write_uint8(ptr noundef nonnull %6, i8 noundef zeroext %154) #8
  %156 = icmp sgt i32 %155, -1
  br i1 %156, label %157, label %199

157:                                              ; preds = %151
  %158 = load i8, ptr %152, align 4, !tbaa !57
  %159 = urem i8 %158, 10
  %160 = call i32 @s2n_stuffer_write_uint8(ptr noundef nonnull %6, i8 noundef zeroext %159) #8
  %161 = icmp sgt i32 %160, -1
  br i1 %161, label %162, label %199

162:                                              ; preds = %157
  %163 = load ptr, ptr %16, align 8, !tbaa !13
  %164 = load ptr, ptr %163, align 8, !tbaa !41
  %165 = getelementptr inbounds i8, ptr %164, i64 24
  %166 = call i32 @s2n_stuffer_write_bytes(ptr noundef nonnull %6, ptr noundef nonnull %165, i32 noundef 2) #8
  %167 = icmp sgt i32 %166, -1
  br i1 %167, label %168, label %199

168:                                              ; preds = %162
  %169 = load ptr, ptr %16, align 8, !tbaa !13
  %170 = getelementptr inbounds i8, ptr %169, i64 920
  %171 = call i32 @s2n_stuffer_write_bytes(ptr noundef nonnull %6, ptr noundef nonnull %170, i32 noundef 8) #8
  %172 = icmp sgt i32 %171, -1
  br i1 %172, label %173, label %199

173:                                              ; preds = %168
  %174 = load ptr, ptr %16, align 8, !tbaa !13
  %175 = getelementptr inbounds i8, ptr %174, i64 928
  %176 = call i32 @s2n_stuffer_write_bytes(ptr noundef nonnull %6, ptr noundef nonnull %175, i32 noundef 8) #8
  %177 = icmp sgt i32 %176, -1
  br i1 %177, label %178, label %199

178:                                              ; preds = %173
  %179 = getelementptr inbounds i8, ptr %0, i64 2208
  %180 = load i16, ptr %179, align 8, !tbaa !58
  %181 = call i32 @s2n_stuffer_write_uint16(ptr noundef nonnull %6, i16 noundef zeroext %180) #8
  %182 = icmp sgt i32 %181, -1
  br i1 %182, label %183, label %199

183:                                              ; preds = %178
  %184 = load i8, ptr %152, align 4, !tbaa !57
  %185 = icmp ugt i8 %184, 33
  br i1 %185, label %186, label %189

186:                                              ; preds = %183
  %187 = call i32 @s2n_connection_serialize_tls13_secrets(ptr noundef nonnull %0, ptr noundef nonnull %6)
  %188 = call zeroext i1 @s2n_result_is_ok(i32 %187)
  br i1 %188, label %192, label %199

189:                                              ; preds = %183
  %190 = call i32 @s2n_connection_serialize_secrets(ptr noundef nonnull %0, ptr noundef nonnull %6)
  %191 = call zeroext i1 @s2n_result_is_ok(i32 %190)
  br i1 %191, label %192, label %199

192:                                              ; preds = %186, %189
  %193 = call i32 @s2n_connection_set_closed(ptr noundef nonnull %0) #8
  %194 = call zeroext i1 @s2n_result_is_ok(i32 %193)
  br i1 %194, label %195, label %199

195:                                              ; preds = %192
  %196 = load ptr, ptr %16, align 8, !tbaa !13
  %197 = call i32 @s2n_crypto_parameters_wipe(ptr noundef %196) #8
  %198 = call zeroext i1 @s2n_result_is_ok(i32 %197)
  %not. = xor i1 %198, true
  %. = sext i1 %not. to i32
  br label %199

199:                                              ; preds = %195, %192, %189, %186, %178, %173, %168, %162, %157, %151, %148, %145
  %.0 = phi i32 [ -1, %145 ], [ -1, %148 ], [ -1, %151 ], [ -1, %157 ], [ -1, %162 ], [ -1, %168 ], [ -1, %173 ], [ -1, %178 ], [ -1, %186 ], [ -1, %189 ], [ -1, %192 ], [ %., %195 ]
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %6) #8
  br label %200

200:                                              ; preds = %142, %199
  %.1 = phi i32 [ %.0, %199 ], [ -1, %142 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #8
  br label %201

201:                                              ; preds = %129, %200, %134
  %.2 = phi i32 [ %.1, %200 ], [ -1, %134 ], [ -1, %129 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #8
  br label %202

202:                                              ; preds = %79, %93, %107, %121, %201, %69, %59, %48, %39, %28, %18, %7
  %.4 = phi i32 [ -1, %69 ], [ -1, %59 ], [ -1, %48 ], [ -1, %39 ], [ -1, %28 ], [ -1, %18 ], [ -1, %7 ], [ %.2, %201 ], [ -1, %121 ], [ -1, %107 ], [ -1, %93 ], [ -1, %79 ]
  ret i32 %.4
}

declare zeroext i1 @s2n_handshake_is_complete(ptr noundef) local_unnamed_addr #3

declare zeroext i1 @s2n_connection_check_io_status(ptr noundef, i32 noundef) local_unnamed_addr #3

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

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

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

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

declare i32 @s2n_stuffer_write_uint8(ptr noundef, i8 noundef zeroext) local_unnamed_addr #3

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

declare i32 @s2n_stuffer_write_uint16(ptr noundef, i16 noundef zeroext) local_unnamed_addr #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden zeroext i1 @s2n_result_is_ok(i32) local_unnamed_addr #6

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

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

declare i32 @s2n_connection_set_closed(ptr noundef) local_unnamed_addr #3

declare i32 @s2n_crypto_parameters_wipe(ptr noundef) local_unnamed_addr #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 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { mustprogress nofree nounwind willreturn memory(argmem: 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 #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 nosync nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { inlinehint 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 #7 = { nounwind willreturn memory(read) }
attributes #8 = { 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, !7, i64 0}
!6 = !{!"s2n_debug_info", !7, i64 0, !7, i64 8}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!6, !7, i64 8}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !8, i64 0}
!13 = !{!14, !7, i64 232}
!14 = !{!"s2n_connection", !12, i64 0, !12, i64 0, !12, i64 0, !12, i64 0, !12, i64 0, !12, i64 0, !12, i64 0, !12, i64 0, !12, i64 1, !12, i64 1, !12, i64 1, !12, i64 1, !12, i64 1, !12, i64 1, !12, i64 1, !12, i64 1, !12, i64 2, !12, i64 2, !12, i64 2, !12, i64 2, !12, i64 2, !12, i64 2, !12, i64 2, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !7, i64 56, !7, i64 64, !7, i64 72, !8, i64 80, !8, i64 102, !8, i64 124, !12, i64 148, !12, i64 152, !15, i64 160, !16, i64 168, !16, i64 176, !8, i64 184, !8, i64 216, !8, i64 217, !8, i64 218, !8, i64 219, !8, i64 220, !8, i64 221, !8, i64 222, !7, i64 224, !7, i64 232, !17, i64 240, !7, i64 632, !7, i64 640, !18, i64 648, !25, i64 1144, !28, i64 1688, !7, i64 1752, !8, i64 1760, !12, i64 1764, !8, i64 1768, !31, i64 1776, !31, i64 1816, !31, i64 1856, !31, i64 1896, !12, i64 1936, !16, i64 1944, !8, i64 1952, !31, i64 1960, !8, i64 2000, !8, i64 2001, !8, i64 2002, !24, i64 2003, !32, i64 2004, !32, i64 2008, !33, i64 2016, !30, i64 2208, !12, i64 2212, !30, i64 2216, !16, i64 2224, !8, i64 2232, !16, i64 2240, !16, i64 2248, !16, i64 2256, !32, i64 2264, !32, i64 2268, !8, i64 2272, !8, i64 2528, !12, i64 2784, !23, i64 2792, !12, i64 2816, !23, i64 2824, !23, i64 2848, !23, i64 2872, !35, i64 2896, !37, i64 3704, !7, i64 3760, !7, i64 3768, !8, i64 3776, !12, i64 3780, !23, i64 3784, !12, i64 3808, !39, i64 3816, !8, i64 3848, !31, i64 3992, !23, i64 4032, !23, i64 4056, !24, i64 4080, !24, i64 4081, !24, i64 4082, !30, i64 4084, !30, i64 4086, !12, i64 4088, !12, i64 4092, !23, i64 4096, !12, i64 4120, !40, i64 4128, !32, i64 4176, !8, i64 4180, !8, i64 4181}
!15 = !{!"s2n_timer", !16, i64 0}
!16 = !{!"long", !8, i64 0}
!17 = !{!"s2n_secrets", !8, i64 0, !12, i64 388}
!18 = !{!"s2n_kex_parameters", !19, i64 0, !20, i64 8, !8, i64 24, !20, i64 56, !21, i64 72, !21, i64 184, !8, i64 296, !22, i64 360, !23, i64 448, !23, i64 472}
!19 = !{!"s2n_dh_params", !7, i64 0}
!20 = !{!"s2n_ecc_evp_params", !7, i64 0, !7, i64 8}
!21 = !{!"s2n_kem_group_params", !7, i64 0, !22, i64 8, !20, i64 96}
!22 = !{!"s2n_kem_params", !7, i64 0, !23, i64 8, !23, i64 32, !23, i64 56, !24, i64 80}
!23 = !{!"s2n_blob", !7, i64 0, !12, i64 8, !12, i64 12, !12, i64 16}
!24 = !{!"_Bool", !8, i64 0}
!25 = !{!"s2n_handshake_parameters", !26, i64 0, !26, i64 48, !23, i64 96, !12, i64 120, !27, i64 124, !7, i64 384, !7, i64 392, !7, i64 400, !8, i64 408, !8, i64 440, !8, i64 472, !8, i64 473, !8, i64 474, !8, i64 506}
!26 = !{!"s2n_pkey", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40}
!27 = !{!"s2n_sig_scheme_list", !8, i64 0, !8, i64 256}
!28 = !{!"s2n_psk_parameters", !12, i64 0, !29, i64 8, !30, i64 40, !30, i64 42, !7, i64 48, !12, i64 56}
!29 = !{!"s2n_array", !23, i64 0, !12, i64 24, !12, i64 28}
!30 = !{!"short", !8, i64 0}
!31 = !{!"s2n_stuffer", !23, i64 0, !12, i64 24, !12, i64 28, !12, i64 32, !12, i64 36, !12, i64 36, !12, i64 36}
!32 = !{!"", !12, i64 0}
!33 = !{!"s2n_handshake", !31, i64 0, !7, i64 40, !8, i64 48, !8, i64 56, !8, i64 104, !8, i64 152, !12, i64 156, !12, i64 160, !12, i64 164, !12, i64 168, !34, i64 176, !12, i64 184, !12, i64 184, !12, i64 184, !12, i64 184, !12, i64 188}
!34 = !{!"s2n_offered_early_data", !7, i64 0}
!35 = !{!"s2n_client_hello", !23, i64 0, !36, i64 24, !23, i64 728, !23, i64 752, !23, i64 776, !8, i64 800, !8, i64 801, !12, i64 802, !12, i64 802, !12, i64 802, !12, i64 802, !12, i64 802, !12, i64 802, !12, i64 802}
!36 = !{!"", !8, i64 0, !23, i64 672, !30, i64 696}
!37 = !{!"s2n_x509_validator", !7, i64 0, !7, i64 8, !8, i64 16, !8, i64 17, !30, i64 18, !7, i64 24, !12, i64 32, !7, i64 40, !38, i64 48, !24, i64 52}
!38 = !{!"s2n_cert_validation_info", !12, i64 0, !12, i64 0}
!39 = !{!"s2n_ticket_fields", !23, i64 0, !12, i64 24}
!40 = !{!"s2n_post_handshake", !31, i64 0, !8, i64 40}
!41 = !{!42, !7, i64 0}
!42 = !{!"s2n_crypto_parameters", !7, i64 0, !43, i64 8, !43, i64 16, !44, i64 24, !44, i64 456, !8, i64 888, !8, i64 904, !8, i64 920, !8, i64 928}
!43 = !{!"s2n_session_key", !7, i64 0}
!44 = !{!"s2n_hmac_state", !12, i64 0, !30, i64 4, !12, i64 8, !30, i64 12, !8, i64 14, !45, i64 16, !45, i64 72, !45, i64 128, !45, i64 184, !8, i64 240, !8, i64 368}
!45 = !{!"s2n_hash_state", !7, i64 0, !12, i64 8, !8, i64 12, !16, i64 16, !8, i64 24}
!46 = !{!14, !7, i64 8}
!47 = !{!48, !12, i64 440}
!48 = !{!"s2n_config", !12, i64 0, !12, i64 0, !12, i64 0, !12, i64 0, !12, i64 0, !12, i64 0, !12, i64 0, !12, i64 0, !12, i64 1, !12, i64 1, !12, i64 1, !12, i64 1, !12, i64 1, !12, i64 1, !12, i64 1, !12, i64 1, !12, i64 2, !12, i64 2, !12, i64 2, !12, i64 2, !7, i64 8, !7, i64 16, !49, i64 24, !23, i64 56, !7, i64 80, !7, i64 88, !7, i64 96, !7, i64 104, !7, i64 112, !7, i64 120, !12, i64 128, !12, i64 132, !7, i64 136, !16, i64 144, !7, i64 152, !16, i64 160, !16, i64 168, !7, i64 176, !7, i64 184, !7, i64 192, !7, i64 200, !7, i64 208, !7, i64 216, !12, i64 224, !8, i64 228, !12, i64 232, !12, i64 236, !7, i64 240, !7, i64 248, !7, i64 256, !7, i64 264, !7, i64 272, !7, i64 280, !7, i64 288, !8, i64 296, !8, i64 297, !50, i64 304, !30, i64 320, !7, i64 328, !7, i64 336, !7, i64 344, !7, i64 352, !7, i64 360, !7, i64 368, !7, i64 376, !7, i64 384, !12, i64 392, !12, i64 396, !12, i64 400, !7, i64 408, !12, i64 416, !12, i64 420, !7, i64 424, !7, i64 432, !12, i64 440, !23, i64 448}
!49 = !{!"certs_by_type", !8, i64 0}
!50 = !{!"s2n_x509_trust_store", !7, i64 0, !12, i64 8}
!51 = !{!14, !12, i64 1804}
!52 = !{!14, !12, i64 1800}
!53 = !{!14, !12, i64 1884}
!54 = !{!14, !12, i64 1880}
!55 = !{!14, !12, i64 1924}
!56 = !{!14, !12, i64 1920}
!57 = !{!14, !8, i64 220}
!58 = !{!14, !30, i64 2208}


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