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

; 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_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_stuffer = type { %struct.s2n_blob, i32, i32, i32, i8 }
%struct.s2n_blob = type { ptr, i32, i32, i8 }
%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_cipher_suite = type { i8, ptr, ptr, [2 x i8], ptr, i32, ptr, [2 x ptr], i8, ptr, ptr, i32, i8 }
%struct.s2n_record_algorithm = type { ptr, i32, i32, i64 }
%struct.s2n_cipher = type { i32, %union.anon.1, i8, ptr, ptr, ptr, ptr, ptr, ptr }
%union.anon.1 = type { %struct.s2n_composite_cipher }
%struct.s2n_composite_cipher = type { i8, i8, i8, ptr, ptr, ptr, ptr }
%struct.s2n_cbc_cipher = type { i8, i8, ptr, ptr }

@_s2n_debug_info = external thread_local global %struct.s2n_debug_info, align 8
@s2n_errno = external thread_local global i32, align 4
@.str.7 = external hidden unnamed_addr constant [93 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [93 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [93 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [93 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [93 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [93 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [93 x i8], align 1

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

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

declare i32 @s2n_calculate_stacktrace() #2

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

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

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

; Function Attrs: nounwind uwtable
define dso_local i32 @s2n_record_min_write_payload_size(ptr noundef %0, ptr noundef %1) #5 {
  %3 = alloca %struct.s2n_result, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i16, align 2
  %7 = alloca i32, align 4
  %8 = alloca i16, align 2
  %9 = alloca ptr, align 8
  %10 = alloca i16, align 2
  %11 = alloca %struct.s2n_result, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  br label %12

12:                                               ; preds = %2
  %13 = load ptr, ptr %4, align 8, !tbaa !5
  %14 = icmp ne ptr %13, null
  br i1 %14, label %47, label %15

15:                                               ; preds = %12
  br label %16

16:                                               ; preds = %15
  br label %17

17:                                               ; preds = %16
  %18 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %19 = getelementptr inbounds %struct.s2n_debug_info, ptr %18, i32 0, i32 0
  store ptr @.str.7, ptr %19, align 8, !tbaa !9
  %20 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %21 = getelementptr inbounds %struct.s2n_debug_info, ptr %20, i32 0, i32 0
  %22 = load ptr, ptr %21, align 8, !tbaa !9
  %23 = getelementptr inbounds i8, ptr %22, i64 21
  %24 = call ptr @strrchr(ptr noundef %23, i32 noundef 47) #6
  %25 = icmp ne ptr %24, null
  br i1 %25, label %26, label %33

26:                                               ; preds = %17
  %27 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %28 = getelementptr inbounds %struct.s2n_debug_info, ptr %27, i32 0, i32 0
  %29 = load ptr, ptr %28, align 8, !tbaa !9
  %30 = getelementptr inbounds i8, ptr %29, i64 21
  %31 = call ptr @strrchr(ptr noundef %30, i32 noundef 47) #6
  %32 = getelementptr inbounds i8, ptr %31, i64 1
  br label %38

33:                                               ; preds = %17
  %34 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %35 = getelementptr inbounds %struct.s2n_debug_info, ptr %34, i32 0, i32 0
  %36 = load ptr, ptr %35, align 8, !tbaa !9
  %37 = getelementptr inbounds i8, ptr %36, i64 21
  br label %38

38:                                               ; preds = %33, %26
  %39 = phi ptr [ %32, %26 ], [ %37, %33 ]
  %40 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %41 = getelementptr inbounds %struct.s2n_debug_info, ptr %40, i32 0, i32 1
  store ptr %39, ptr %41, align 8, !tbaa !11
  %42 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %42, align 4, !tbaa !12
  %43 = call i32 @s2n_calculate_stacktrace()
  br label %44

44:                                               ; preds = %38
  %45 = getelementptr inbounds %struct.s2n_result, ptr %3, i32 0, i32 0
  store i32 -1, ptr %45, align 4, !tbaa !14
  br label %435

46:                                               ; No predecessors!
  br label %47

47:                                               ; preds = %46, %12
  br label %48

48:                                               ; preds = %47
  br label %49

49:                                               ; preds = %48
  %50 = load ptr, ptr %5, align 8, !tbaa !5
  %51 = icmp ne ptr %50, null
  br i1 %51, label %84, label %52

52:                                               ; preds = %49
  br label %53

53:                                               ; preds = %52
  br label %54

54:                                               ; preds = %53
  %55 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %56 = getelementptr inbounds %struct.s2n_debug_info, ptr %55, i32 0, i32 0
  store ptr @.str.8, ptr %56, align 8, !tbaa !9
  %57 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %58 = getelementptr inbounds %struct.s2n_debug_info, ptr %57, i32 0, i32 0
  %59 = load ptr, ptr %58, align 8, !tbaa !9
  %60 = getelementptr inbounds i8, ptr %59, i64 21
  %61 = call ptr @strrchr(ptr noundef %60, i32 noundef 47) #6
  %62 = icmp ne ptr %61, null
  br i1 %62, label %63, label %70

63:                                               ; preds = %54
  %64 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %65 = getelementptr inbounds %struct.s2n_debug_info, ptr %64, i32 0, i32 0
  %66 = load ptr, ptr %65, align 8, !tbaa !9
  %67 = getelementptr inbounds i8, ptr %66, i64 21
  %68 = call ptr @strrchr(ptr noundef %67, i32 noundef 47) #6
  %69 = getelementptr inbounds i8, ptr %68, i64 1
  br label %75

70:                                               ; preds = %54
  %71 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %72 = getelementptr inbounds %struct.s2n_debug_info, ptr %71, i32 0, i32 0
  %73 = load ptr, ptr %72, align 8, !tbaa !9
  %74 = getelementptr inbounds i8, ptr %73, i64 21
  br label %75

75:                                               ; preds = %70, %63
  %76 = phi ptr [ %69, %63 ], [ %74, %70 ]
  %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 1
  store ptr %76, ptr %78, align 8, !tbaa !11
  %79 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %79, align 4, !tbaa !12
  %80 = call i32 @s2n_calculate_stacktrace()
  br label %81

81:                                               ; preds = %75
  %82 = getelementptr inbounds %struct.s2n_result, ptr %3, i32 0, i32 0
  store i32 -1, ptr %82, align 4, !tbaa !14
  br label %435

83:                                               ; No predecessors!
  br label %84

84:                                               ; preds = %83, %49
  br label %85

85:                                               ; preds = %84
  call void @llvm.lifetime.start.p0(i64 2, ptr %6) #7
  %86 = load ptr, ptr %4, align 8, !tbaa !5
  %87 = load i32, ptr %86, align 8
  %88 = lshr i32 %87, 5
  %89 = and i32 %88, 1
  %90 = icmp ne i32 %89, 0
  %91 = zext i1 %90 to i64
  %92 = select i1 %90, i32 40, i32 20
  %93 = sub nsw i32 1500, %92
  %94 = sub nsw i32 %93, 20
  %95 = sub nsw i32 %94, 40
  %96 = sub nsw i32 %95, 5
  %97 = trunc i32 %96 to i16
  store i16 %97, ptr %6, align 2, !tbaa !16
  br label %98

98:                                               ; preds = %85
  %99 = load i16, ptr %6, align 2, !tbaa !16
  %100 = zext i16 %99 to i32
  %101 = icmp sle i32 %100, 16384
  br i1 %101, label %136, label %102

102:                                              ; preds = %98
  br label %103

103:                                              ; preds = %102
  br label %104

104:                                              ; preds = %103
  %105 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %106 = getelementptr inbounds %struct.s2n_debug_info, ptr %105, i32 0, i32 0
  store ptr @.str.9, ptr %106, align 8, !tbaa !9
  %107 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %108 = getelementptr inbounds %struct.s2n_debug_info, ptr %107, i32 0, i32 0
  %109 = load ptr, ptr %108, align 8, !tbaa !9
  %110 = getelementptr inbounds i8, ptr %109, i64 21
  %111 = call ptr @strrchr(ptr noundef %110, i32 noundef 47) #6
  %112 = icmp ne ptr %111, null
  br i1 %112, label %113, label %120

113:                                              ; preds = %104
  %114 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %115 = getelementptr inbounds %struct.s2n_debug_info, ptr %114, i32 0, i32 0
  %116 = load ptr, ptr %115, align 8, !tbaa !9
  %117 = getelementptr inbounds i8, ptr %116, i64 21
  %118 = call ptr @strrchr(ptr noundef %117, i32 noundef 47) #6
  %119 = getelementptr inbounds i8, ptr %118, i64 1
  br label %125

120:                                              ; preds = %104
  %121 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %122 = getelementptr inbounds %struct.s2n_debug_info, ptr %121, i32 0, i32 0
  %123 = load ptr, ptr %122, align 8, !tbaa !9
  %124 = getelementptr inbounds i8, ptr %123, i64 21
  br label %125

125:                                              ; preds = %120, %113
  %126 = phi ptr [ %119, %113 ], [ %124, %120 ]
  %127 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %128 = getelementptr inbounds %struct.s2n_debug_info, ptr %127, i32 0, i32 1
  store ptr %126, ptr %128, align 8, !tbaa !11
  %129 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 335544390, ptr %129, align 4, !tbaa !12
  %130 = call i32 @s2n_calculate_stacktrace()
  br label %131

131:                                              ; preds = %125
  br label %132

132:                                              ; preds = %131
  %133 = getelementptr inbounds %struct.s2n_result, ptr %3, i32 0, i32 0
  store i32 -1, ptr %133, align 4, !tbaa !14
  store i32 1, ptr %7, align 4
  br label %434

134:                                              ; No predecessors!
  br label %135

135:                                              ; preds = %134
  br label %136

136:                                              ; preds = %135, %98
  br label %137

137:                                              ; preds = %136
  br label %138

138:                                              ; preds = %137
  call void @llvm.lifetime.start.p0(i64 2, ptr %8) #7
  %139 = load i16, ptr %6, align 2, !tbaa !16
  store i16 %139, ptr %8, align 2, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  %140 = load ptr, ptr %4, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct.s2n_connection, ptr %140, i32 0, i32 13
  %142 = load i32, ptr %141, align 4, !tbaa !18
  %143 = icmp eq i32 %142, 1
  br i1 %143, label %144, label %148

144:                                              ; preds = %138
  %145 = load ptr, ptr %4, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct.s2n_connection, ptr %145, i32 0, i32 29
  %147 = load ptr, ptr %146, align 8, !tbaa !44
  br label %152

148:                                              ; preds = %138
  %149 = load ptr, ptr %4, align 8, !tbaa !5
  %150 = getelementptr inbounds %struct.s2n_connection, ptr %149, i32 0, i32 30
  %151 = load ptr, ptr %150, align 8, !tbaa !45
  br label %152

152:                                              ; preds = %148, %144
  %153 = phi ptr [ %147, %144 ], [ %151, %148 ]
  store ptr %153, ptr %9, align 8, !tbaa !5
  %154 = load ptr, ptr %9, align 8, !tbaa !5
  %155 = getelementptr inbounds %struct.s2n_crypto_parameters, ptr %154, i32 0, i32 0
  %156 = load ptr, ptr %155, align 8, !tbaa !46
  %157 = getelementptr inbounds %struct.s2n_cipher_suite, ptr %156, i32 0, i32 6
  %158 = load ptr, ptr %157, align 8, !tbaa !51
  %159 = getelementptr inbounds %struct.s2n_record_algorithm, ptr %158, i32 0, i32 0
  %160 = load ptr, ptr %159, align 8, !tbaa !53
  %161 = getelementptr inbounds %struct.s2n_cipher, ptr %160, i32 0, i32 0
  %162 = load i32, ptr %161, align 8, !tbaa !55
  %163 = icmp eq i32 %162, 1
  br i1 %163, label %164, label %183

164:                                              ; preds = %152
  %165 = load i16, ptr %8, align 2, !tbaa !16
  %166 = zext i16 %165 to i32
  %167 = load ptr, ptr %9, align 8, !tbaa !5
  %168 = getelementptr inbounds %struct.s2n_crypto_parameters, ptr %167, i32 0, i32 0
  %169 = load ptr, ptr %168, align 8, !tbaa !46
  %170 = getelementptr inbounds %struct.s2n_cipher_suite, ptr %169, i32 0, i32 6
  %171 = load ptr, ptr %170, align 8, !tbaa !51
  %172 = getelementptr inbounds %struct.s2n_record_algorithm, ptr %171, i32 0, i32 0
  %173 = load ptr, ptr %172, align 8, !tbaa !53
  %174 = getelementptr inbounds %struct.s2n_cipher, ptr %173, i32 0, i32 1
  %175 = getelementptr inbounds %struct.s2n_cbc_cipher, ptr %174, i32 0, i32 0
  %176 = load i8, ptr %175, align 8, !tbaa !57
  %177 = zext i8 %176 to i32
  %178 = srem i32 %166, %177
  %179 = load i16, ptr %8, align 2, !tbaa !16
  %180 = zext i16 %179 to i32
  %181 = sub nsw i32 %180, %178
  %182 = trunc i32 %181 to i16
  store i16 %182, ptr %8, align 2, !tbaa !16
  br label %233

183:                                              ; preds = %152
  %184 = load ptr, ptr %9, align 8, !tbaa !5
  %185 = getelementptr inbounds %struct.s2n_crypto_parameters, ptr %184, i32 0, i32 0
  %186 = load ptr, ptr %185, align 8, !tbaa !46
  %187 = getelementptr inbounds %struct.s2n_cipher_suite, ptr %186, i32 0, i32 6
  %188 = load ptr, ptr %187, align 8, !tbaa !51
  %189 = getelementptr inbounds %struct.s2n_record_algorithm, ptr %188, i32 0, i32 0
  %190 = load ptr, ptr %189, align 8, !tbaa !53
  %191 = getelementptr inbounds %struct.s2n_cipher, ptr %190, i32 0, i32 0
  %192 = load i32, ptr %191, align 8, !tbaa !55
  %193 = icmp eq i32 %192, 3
  br i1 %193, label %194, label %232

194:                                              ; preds = %183
  %195 = load i16, ptr %8, align 2, !tbaa !16
  %196 = zext i16 %195 to i32
  %197 = load ptr, ptr %9, align 8, !tbaa !5
  %198 = getelementptr inbounds %struct.s2n_crypto_parameters, ptr %197, i32 0, i32 0
  %199 = load ptr, ptr %198, align 8, !tbaa !46
  %200 = getelementptr inbounds %struct.s2n_cipher_suite, ptr %199, i32 0, i32 6
  %201 = load ptr, ptr %200, align 8, !tbaa !51
  %202 = getelementptr inbounds %struct.s2n_record_algorithm, ptr %201, i32 0, i32 0
  %203 = load ptr, ptr %202, align 8, !tbaa !53
  %204 = getelementptr inbounds %struct.s2n_cipher, ptr %203, i32 0, i32 1
  %205 = getelementptr inbounds %struct.s2n_composite_cipher, ptr %204, i32 0, i32 0
  %206 = load i8, ptr %205, align 8, !tbaa !57
  %207 = zext i8 %206 to i32
  %208 = srem i32 %196, %207
  %209 = load i16, ptr %8, align 2, !tbaa !16
  %210 = zext i16 %209 to i32
  %211 = sub nsw i32 %210, %208
  %212 = trunc i32 %211 to i16
  store i16 %212, ptr %8, align 2, !tbaa !16
  %213 = load ptr, ptr %9, align 8, !tbaa !5
  %214 = getelementptr inbounds %struct.s2n_crypto_parameters, ptr %213, i32 0, i32 0
  %215 = load ptr, ptr %214, align 8, !tbaa !46
  %216 = getelementptr inbounds %struct.s2n_cipher_suite, ptr %215, i32 0, i32 6
  %217 = load ptr, ptr %216, align 8, !tbaa !51
  %218 = getelementptr inbounds %struct.s2n_record_algorithm, ptr %217, i32 0, i32 0
  %219 = load ptr, ptr %218, align 8, !tbaa !53
  %220 = getelementptr inbounds %struct.s2n_cipher, ptr %219, i32 0, i32 1
  %221 = getelementptr inbounds %struct.s2n_composite_cipher, ptr %220, i32 0, i32 2
  %222 = load i8, ptr %221, align 2, !tbaa !57
  %223 = zext i8 %222 to i32
  %224 = load i16, ptr %8, align 2, !tbaa !16
  %225 = zext i16 %224 to i32
  %226 = sub nsw i32 %225, %223
  %227 = trunc i32 %226 to i16
  store i16 %227, ptr %8, align 2, !tbaa !16
  %228 = load i16, ptr %8, align 2, !tbaa !16
  %229 = zext i16 %228 to i32
  %230 = sub nsw i32 %229, 1
  %231 = trunc i32 %230 to i16
  store i16 %231, ptr %8, align 2, !tbaa !16
  br label %232

232:                                              ; preds = %194, %183
  br label %233

233:                                              ; preds = %232, %164
  %234 = load ptr, ptr %4, align 8, !tbaa !5
  %235 = getelementptr inbounds %struct.s2n_connection, ptr %234, i32 0, i32 23
  %236 = load i8, ptr %235, align 4, !tbaa !58
  %237 = zext i8 %236 to i32
  %238 = icmp sge i32 %237, 34
  br i1 %238, label %239, label %285

239:                                              ; preds = %233
  br label %240

240:                                              ; preds = %239
  %241 = load i16, ptr %8, align 2, !tbaa !16
  %242 = zext i16 %241 to i32
  %243 = icmp sgt i32 %242, 1
  br i1 %243, label %278, label %244

244:                                              ; preds = %240
  br label %245

245:                                              ; preds = %244
  br label %246

246:                                              ; preds = %245
  %247 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %248 = getelementptr inbounds %struct.s2n_debug_info, ptr %247, i32 0, i32 0
  store ptr @.str.10, ptr %248, align 8, !tbaa !9
  %249 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %250 = getelementptr inbounds %struct.s2n_debug_info, ptr %249, i32 0, i32 0
  %251 = load ptr, ptr %250, align 8, !tbaa !9
  %252 = getelementptr inbounds i8, ptr %251, i64 21
  %253 = call ptr @strrchr(ptr noundef %252, i32 noundef 47) #6
  %254 = icmp ne ptr %253, null
  br i1 %254, label %255, label %262

255:                                              ; preds = %246
  %256 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %257 = getelementptr inbounds %struct.s2n_debug_info, ptr %256, i32 0, i32 0
  %258 = load ptr, ptr %257, align 8, !tbaa !9
  %259 = getelementptr inbounds i8, ptr %258, i64 21
  %260 = call ptr @strrchr(ptr noundef %259, i32 noundef 47) #6
  %261 = getelementptr inbounds i8, ptr %260, i64 1
  br label %267

262:                                              ; preds = %246
  %263 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %264 = getelementptr inbounds %struct.s2n_debug_info, ptr %263, i32 0, i32 0
  %265 = load ptr, ptr %264, align 8, !tbaa !9
  %266 = getelementptr inbounds i8, ptr %265, i64 21
  br label %267

267:                                              ; preds = %262, %255
  %268 = phi ptr [ %261, %255 ], [ %266, %262 ]
  %269 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %270 = getelementptr inbounds %struct.s2n_debug_info, ptr %269, i32 0, i32 1
  store ptr %268, ptr %270, align 8, !tbaa !11
  %271 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 335544391, ptr %271, align 4, !tbaa !12
  %272 = call i32 @s2n_calculate_stacktrace()
  br label %273

273:                                              ; preds = %267
  br label %274

274:                                              ; preds = %273
  %275 = getelementptr inbounds %struct.s2n_result, ptr %3, i32 0, i32 0
  store i32 -1, ptr %275, align 4, !tbaa !14
  store i32 1, ptr %7, align 4
  br label %433

276:                                              ; No predecessors!
  br label %277

277:                                              ; preds = %276
  br label %278

278:                                              ; preds = %277, %240
  br label %279

279:                                              ; preds = %278
  br label %280

280:                                              ; preds = %279
  %281 = load i16, ptr %8, align 2, !tbaa !16
  %282 = zext i16 %281 to i32
  %283 = sub nsw i32 %282, 1
  %284 = trunc i32 %283 to i16
  store i16 %284, ptr %8, align 2, !tbaa !16
  br label %285

285:                                              ; preds = %280, %233
  call void @llvm.lifetime.start.p0(i64 2, ptr %10) #7
  store i16 0, ptr %10, align 2, !tbaa !16
  br label %286

286:                                              ; preds = %285
  %287 = load ptr, ptr %4, align 8, !tbaa !5
  %288 = call i32 @s2n_tls_record_overhead(ptr noundef %287, ptr noundef %10)
  %289 = getelementptr inbounds %struct.s2n_result, ptr %11, i32 0, i32 0
  store i32 %288, ptr %289, align 4
  %290 = getelementptr inbounds %struct.s2n_result, ptr %11, i32 0, i32 0
  %291 = load i32, ptr %290, align 4
  %292 = call zeroext i1 @s2n_result_is_ok(i32 %291)
  br i1 %292, label %295, label %293

293:                                              ; preds = %286
  %294 = getelementptr inbounds %struct.s2n_result, ptr %3, i32 0, i32 0
  store i32 -1, ptr %294, align 4, !tbaa !14
  store i32 1, ptr %7, align 4
  br label %432

295:                                              ; preds = %286
  br label %296

296:                                              ; preds = %295
  br label %297

297:                                              ; preds = %296
  br label %298

298:                                              ; preds = %297
  %299 = load i16, ptr %8, align 2, !tbaa !16
  %300 = zext i16 %299 to i32
  %301 = load i16, ptr %10, align 2, !tbaa !16
  %302 = zext i16 %301 to i32
  %303 = icmp sgt i32 %300, %302
  br i1 %303, label %338, label %304

304:                                              ; preds = %298
  br label %305

305:                                              ; preds = %304
  br label %306

306:                                              ; preds = %305
  %307 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %308 = getelementptr inbounds %struct.s2n_debug_info, ptr %307, i32 0, i32 0
  store ptr @.str.11, ptr %308, align 8, !tbaa !9
  %309 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %310 = getelementptr inbounds %struct.s2n_debug_info, ptr %309, i32 0, i32 0
  %311 = load ptr, ptr %310, align 8, !tbaa !9
  %312 = getelementptr inbounds i8, ptr %311, i64 21
  %313 = call ptr @strrchr(ptr noundef %312, i32 noundef 47) #6
  %314 = icmp ne ptr %313, null
  br i1 %314, label %315, label %322

315:                                              ; preds = %306
  %316 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %317 = getelementptr inbounds %struct.s2n_debug_info, ptr %316, i32 0, i32 0
  %318 = load ptr, ptr %317, align 8, !tbaa !9
  %319 = getelementptr inbounds i8, ptr %318, i64 21
  %320 = call ptr @strrchr(ptr noundef %319, i32 noundef 47) #6
  %321 = getelementptr inbounds i8, ptr %320, i64 1
  br label %327

322:                                              ; preds = %306
  %323 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %324 = getelementptr inbounds %struct.s2n_debug_info, ptr %323, i32 0, i32 0
  %325 = load ptr, ptr %324, align 8, !tbaa !9
  %326 = getelementptr inbounds i8, ptr %325, i64 21
  br label %327

327:                                              ; preds = %322, %315
  %328 = phi ptr [ %321, %315 ], [ %326, %322 ]
  %329 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %330 = getelementptr inbounds %struct.s2n_debug_info, ptr %329, i32 0, i32 1
  store ptr %328, ptr %330, align 8, !tbaa !11
  %331 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 335544391, ptr %331, align 4, !tbaa !12
  %332 = call i32 @s2n_calculate_stacktrace()
  br label %333

333:                                              ; preds = %327
  br label %334

334:                                              ; preds = %333
  %335 = getelementptr inbounds %struct.s2n_result, ptr %3, i32 0, i32 0
  store i32 -1, ptr %335, align 4, !tbaa !14
  store i32 1, ptr %7, align 4
  br label %432

336:                                              ; No predecessors!
  br label %337

337:                                              ; preds = %336
  br label %338

338:                                              ; preds = %337, %298
  br label %339

339:                                              ; preds = %338
  br label %340

340:                                              ; preds = %339
  %341 = load i16, ptr %10, align 2, !tbaa !16
  %342 = zext i16 %341 to i32
  %343 = load i16, ptr %8, align 2, !tbaa !16
  %344 = zext i16 %343 to i32
  %345 = sub nsw i32 %344, %342
  %346 = trunc i32 %345 to i16
  store i16 %346, ptr %8, align 2, !tbaa !16
  br label %347

347:                                              ; preds = %340
  %348 = load i16, ptr %8, align 2, !tbaa !16
  %349 = zext i16 %348 to i32
  %350 = icmp sgt i32 %349, 0
  br i1 %350, label %385, label %351

351:                                              ; preds = %347
  br label %352

352:                                              ; preds = %351
  br label %353

353:                                              ; preds = %352
  %354 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %355 = getelementptr inbounds %struct.s2n_debug_info, ptr %354, i32 0, i32 0
  store ptr @.str.12, ptr %355, align 8, !tbaa !9
  %356 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %357 = getelementptr inbounds %struct.s2n_debug_info, ptr %356, i32 0, i32 0
  %358 = load ptr, ptr %357, align 8, !tbaa !9
  %359 = getelementptr inbounds i8, ptr %358, i64 21
  %360 = call ptr @strrchr(ptr noundef %359, i32 noundef 47) #6
  %361 = icmp ne ptr %360, null
  br i1 %361, label %362, label %369

362:                                              ; preds = %353
  %363 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %364 = getelementptr inbounds %struct.s2n_debug_info, ptr %363, i32 0, i32 0
  %365 = load ptr, ptr %364, align 8, !tbaa !9
  %366 = getelementptr inbounds i8, ptr %365, i64 21
  %367 = call ptr @strrchr(ptr noundef %366, i32 noundef 47) #6
  %368 = getelementptr inbounds i8, ptr %367, i64 1
  br label %374

369:                                              ; preds = %353
  %370 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %371 = getelementptr inbounds %struct.s2n_debug_info, ptr %370, i32 0, i32 0
  %372 = load ptr, ptr %371, align 8, !tbaa !9
  %373 = getelementptr inbounds i8, ptr %372, i64 21
  br label %374

374:                                              ; preds = %369, %362
  %375 = phi ptr [ %368, %362 ], [ %373, %369 ]
  %376 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %377 = getelementptr inbounds %struct.s2n_debug_info, ptr %376, i32 0, i32 1
  store ptr %375, ptr %377, align 8, !tbaa !11
  %378 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 335544391, ptr %378, align 4, !tbaa !12
  %379 = call i32 @s2n_calculate_stacktrace()
  br label %380

380:                                              ; preds = %374
  br label %381

381:                                              ; preds = %380
  %382 = getelementptr inbounds %struct.s2n_result, ptr %3, i32 0, i32 0
  store i32 -1, ptr %382, align 4, !tbaa !14
  store i32 1, ptr %7, align 4
  br label %432

383:                                              ; No predecessors!
  br label %384

384:                                              ; preds = %383
  br label %385

385:                                              ; preds = %384, %347
  br label %386

386:                                              ; preds = %385
  br label %387

387:                                              ; preds = %386
  br label %388

388:                                              ; preds = %387
  %389 = load i16, ptr %8, align 2, !tbaa !16
  %390 = zext i16 %389 to i32
  %391 = icmp sle i32 %390, 1500
  br i1 %391, label %426, label %392

392:                                              ; preds = %388
  br label %393

393:                                              ; preds = %392
  br label %394

394:                                              ; preds = %393
  %395 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %396 = getelementptr inbounds %struct.s2n_debug_info, ptr %395, i32 0, i32 0
  store ptr @.str.13, ptr %396, align 8, !tbaa !9
  %397 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %398 = getelementptr inbounds %struct.s2n_debug_info, ptr %397, i32 0, i32 0
  %399 = load ptr, ptr %398, align 8, !tbaa !9
  %400 = getelementptr inbounds i8, ptr %399, i64 21
  %401 = call ptr @strrchr(ptr noundef %400, i32 noundef 47) #6
  %402 = icmp ne ptr %401, null
  br i1 %402, label %403, label %410

403:                                              ; preds = %394
  %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 0
  %406 = load ptr, ptr %405, align 8, !tbaa !9
  %407 = getelementptr inbounds i8, ptr %406, i64 21
  %408 = call ptr @strrchr(ptr noundef %407, i32 noundef 47) #6
  %409 = getelementptr inbounds i8, ptr %408, i64 1
  br label %415

410:                                              ; preds = %394
  %411 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %412 = getelementptr inbounds %struct.s2n_debug_info, ptr %411, i32 0, i32 0
  %413 = load ptr, ptr %412, align 8, !tbaa !9
  %414 = getelementptr inbounds i8, ptr %413, i64 21
  br label %415

415:                                              ; preds = %410, %403
  %416 = phi ptr [ %409, %403 ], [ %414, %410 ]
  %417 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %418 = getelementptr inbounds %struct.s2n_debug_info, ptr %417, i32 0, i32 1
  store ptr %416, ptr %418, align 8, !tbaa !11
  %419 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 335544390, ptr %419, align 4, !tbaa !12
  %420 = call i32 @s2n_calculate_stacktrace()
  br label %421

421:                                              ; preds = %415
  br label %422

422:                                              ; preds = %421
  %423 = getelementptr inbounds %struct.s2n_result, ptr %3, i32 0, i32 0
  store i32 -1, ptr %423, align 4, !tbaa !14
  store i32 1, ptr %7, align 4
  br label %432

424:                                              ; No predecessors!
  br label %425

425:                                              ; preds = %424
  br label %426

426:                                              ; preds = %425, %388
  br label %427

427:                                              ; preds = %426
  br label %428

428:                                              ; preds = %427
  %429 = load i16, ptr %8, align 2, !tbaa !16
  %430 = load ptr, ptr %5, align 8, !tbaa !5
  store i16 %429, ptr %430, align 2, !tbaa !16
  %431 = getelementptr inbounds %struct.s2n_result, ptr %3, i32 0, i32 0
  store i32 0, ptr %431, align 4, !tbaa !14
  store i32 1, ptr %7, align 4
  br label %432

432:                                              ; preds = %428, %422, %381, %334, %293
  call void @llvm.lifetime.end.p0(i64 2, ptr %10) #7
  br label %433

433:                                              ; preds = %432, %274
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 2, ptr %8) #7
  br label %434

434:                                              ; preds = %433, %132
  call void @llvm.lifetime.end.p0(i64 2, ptr %6) #7
  br label %435

435:                                              ; preds = %434, %81, %44
  %436 = getelementptr inbounds %struct.s2n_result, ptr %3, i32 0, i32 0
  %437 = load i32, ptr %436, align 4
  ret i32 %437
}

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

attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #1 = { 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 #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { 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 #6 = { nounwind willreturn memory(read) }
attributes #7 = { 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, !6, i64 0}
!10 = !{!"s2n_debug_info", !6, i64 0, !6, i64 8}
!11 = !{!10, !6, i64 8}
!12 = !{!13, !13, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = !{!15, !13, i64 0}
!15 = !{!"", !13, i64 0}
!16 = !{!17, !17, i64 0}
!17 = !{!"short", !7, i64 0}
!18 = !{!19, !13, i64 148}
!19 = !{!"s2n_connection", !13, i64 0, !13, i64 0, !13, i64 0, !13, i64 0, !13, i64 0, !13, i64 0, !13, i64 0, !13, i64 0, !13, i64 1, !13, i64 1, !13, i64 1, !13, i64 1, !13, i64 1, !13, i64 1, !13, i64 1, !13, i64 1, !13, i64 2, !13, i64 2, !13, i64 2, !13, i64 2, !13, i64 2, !13, i64 2, !13, 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, !13, i64 148, !13, i64 152, !20, i64 160, !21, i64 168, !21, 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, !22, i64 240, !6, i64 632, !6, i64 640, !23, i64 648, !30, i64 1144, !33, i64 1688, !6, i64 1752, !7, i64 1760, !13, i64 1764, !7, i64 1768, !35, i64 1776, !35, i64 1816, !35, i64 1856, !35, i64 1896, !13, i64 1936, !21, i64 1944, !7, i64 1952, !35, i64 1960, !7, i64 2000, !7, i64 2001, !7, i64 2002, !29, i64 2003, !15, i64 2004, !15, i64 2008, !36, i64 2016, !17, i64 2208, !13, i64 2212, !17, i64 2216, !21, i64 2224, !7, i64 2232, !21, i64 2240, !21, i64 2248, !21, i64 2256, !15, i64 2264, !15, i64 2268, !7, i64 2272, !7, i64 2528, !13, i64 2784, !28, i64 2792, !13, i64 2816, !28, i64 2824, !28, i64 2848, !28, i64 2872, !38, i64 2896, !40, i64 3704, !6, i64 3760, !6, i64 3768, !7, i64 3776, !13, i64 3780, !28, i64 3784, !13, i64 3808, !42, i64 3816, !7, i64 3848, !35, i64 3992, !28, i64 4032, !28, i64 4056, !29, i64 4080, !29, i64 4081, !29, i64 4082, !17, i64 4084, !17, i64 4086, !13, i64 4088, !13, i64 4092, !28, i64 4096, !13, i64 4120, !43, i64 4128, !15, i64 4176, !7, i64 4180, !7, i64 4181}
!20 = !{!"s2n_timer", !21, i64 0}
!21 = !{!"long", !7, i64 0}
!22 = !{!"s2n_secrets", !7, i64 0, !13, i64 388}
!23 = !{!"s2n_kex_parameters", !24, i64 0, !25, i64 8, !7, i64 24, !25, i64 56, !26, i64 72, !26, i64 184, !7, i64 296, !27, i64 360, !28, i64 448, !28, i64 472}
!24 = !{!"s2n_dh_params", !6, i64 0}
!25 = !{!"s2n_ecc_evp_params", !6, i64 0, !6, i64 8}
!26 = !{!"s2n_kem_group_params", !6, i64 0, !27, i64 8, !25, i64 96}
!27 = !{!"s2n_kem_params", !6, i64 0, !28, i64 8, !28, i64 32, !28, i64 56, !29, i64 80}
!28 = !{!"s2n_blob", !6, i64 0, !13, i64 8, !13, i64 12, !13, i64 16}
!29 = !{!"_Bool", !7, i64 0}
!30 = !{!"s2n_handshake_parameters", !31, i64 0, !31, i64 48, !28, i64 96, !13, i64 120, !32, 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}
!31 = !{!"s2n_pkey", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40}
!32 = !{!"s2n_sig_scheme_list", !7, i64 0, !7, i64 256}
!33 = !{!"s2n_psk_parameters", !13, i64 0, !34, i64 8, !17, i64 40, !17, i64 42, !6, i64 48, !13, i64 56}
!34 = !{!"s2n_array", !28, i64 0, !13, i64 24, !13, i64 28}
!35 = !{!"s2n_stuffer", !28, i64 0, !13, i64 24, !13, i64 28, !13, i64 32, !13, i64 36, !13, i64 36, !13, i64 36}
!36 = !{!"s2n_handshake", !35, i64 0, !6, i64 40, !7, i64 48, !7, i64 56, !7, i64 104, !7, i64 152, !13, i64 156, !13, i64 160, !13, i64 164, !13, i64 168, !37, i64 176, !13, i64 184, !13, i64 184, !13, i64 184, !13, i64 184, !13, i64 188}
!37 = !{!"s2n_offered_early_data", !6, i64 0}
!38 = !{!"s2n_client_hello", !28, i64 0, !39, i64 24, !28, i64 728, !28, i64 752, !28, i64 776, !7, i64 800, !7, i64 801, !13, i64 802, !13, i64 802, !13, i64 802, !13, i64 802, !13, i64 802, !13, i64 802, !13, i64 802}
!39 = !{!"", !7, i64 0, !28, i64 672, !17, i64 696}
!40 = !{!"s2n_x509_validator", !6, i64 0, !6, i64 8, !7, i64 16, !7, i64 17, !17, i64 18, !6, i64 24, !13, i64 32, !6, i64 40, !41, i64 48, !29, i64 52}
!41 = !{!"s2n_cert_validation_info", !13, i64 0, !13, i64 0}
!42 = !{!"s2n_ticket_fields", !28, i64 0, !13, i64 24}
!43 = !{!"s2n_post_handshake", !35, i64 0, !7, i64 40}
!44 = !{!19, !6, i64 632}
!45 = !{!19, !6, i64 640}
!46 = !{!47, !6, i64 0}
!47 = !{!"s2n_crypto_parameters", !6, i64 0, !48, i64 8, !48, i64 16, !49, i64 24, !49, i64 456, !7, i64 888, !7, i64 904, !7, i64 920, !7, i64 928}
!48 = !{!"s2n_session_key", !6, i64 0}
!49 = !{!"s2n_hmac_state", !13, i64 0, !17, i64 4, !13, i64 8, !17, i64 12, !7, i64 14, !50, i64 16, !50, i64 72, !50, i64 128, !50, i64 184, !7, i64 240, !7, i64 368}
!50 = !{!"s2n_hash_state", !6, i64 0, !13, i64 8, !7, i64 12, !21, i64 16, !7, i64 24}
!51 = !{!52, !6, i64 48}
!52 = !{!"s2n_cipher_suite", !13, i64 0, !6, i64 8, !6, i64 16, !7, i64 24, !6, i64 32, !13, i64 40, !6, i64 48, !7, i64 56, !7, i64 72, !6, i64 80, !6, i64 88, !13, i64 96, !7, i64 100}
!53 = !{!54, !6, i64 0}
!54 = !{!"s2n_record_algorithm", !6, i64 0, !13, i64 8, !13, i64 12, !21, i64 16}
!55 = !{!56, !13, i64 0}
!56 = !{!"s2n_cipher", !13, i64 0, !7, i64 8, !7, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96}
!57 = !{!7, !7, i64 0}
!58 = !{!19, !7, i64 220}


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

@_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.7 = external hidden unnamed_addr constant [93 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [93 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [93 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [93 x i8], align 1

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

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

declare i32 @s2n_calculate_stacktrace() local_unnamed_addr #2

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

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

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

; Function Attrs: nounwind uwtable
define dso_local range(i32 -1, 1) i32 @s2n_record_min_write_payload_size(ptr noundef %0, ptr noundef writeonly %1) local_unnamed_addr #5 {
  %3 = alloca i16, align 2
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %4, label %12

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

12:                                               ; preds = %2
  %.not45 = icmp eq ptr %1, null
  br i1 %.not45, label %13, label %21

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

21:                                               ; preds = %12
  %22 = load i32, ptr %0, align 8
  %23 = and i32 %22, 32
  %.not47 = icmp eq i32 %23, 0
  %24 = select i1 %.not47, i16 1415, i16 1395
  %25 = getelementptr inbounds i8, ptr %0, i64 148
  %26 = load i32, ptr %25, align 4, !tbaa !13
  %27 = icmp eq i32 %26, 1
  %.in.v = select i1 %27, i64 632, i64 640
  %.in = getelementptr inbounds i8, ptr %0, i64 %.in.v
  %28 = load ptr, ptr %.in, align 8, !tbaa !41
  %29 = load ptr, ptr %28, align 8, !tbaa !42
  %30 = getelementptr inbounds i8, ptr %29, i64 48
  %31 = load ptr, ptr %30, align 8, !tbaa !47
  %32 = load ptr, ptr %31, align 8, !tbaa !49
  %33 = load i32, ptr %32, align 8, !tbaa !51
  switch i32 %33, label %51 [
    i32 1, label %34
    i32 3, label %40
  ]

34:                                               ; preds = %21
  %35 = getelementptr inbounds i8, ptr %32, i64 8
  %36 = load i8, ptr %35, align 8, !tbaa !53
  %37 = zext i8 %36 to i16
  %38 = urem i16 %24, %37
  %39 = sub nuw nsw i16 %24, %38
  br label %51

40:                                               ; preds = %21
  %41 = getelementptr inbounds i8, ptr %32, i64 8
  %42 = load i8, ptr %41, align 8, !tbaa !53
  %43 = zext i8 %42 to i16
  %44 = urem i16 %24, %43
  %45 = getelementptr inbounds i8, ptr %32, i64 10
  %46 = load i8, ptr %45, align 2, !tbaa !53
  %47 = zext i8 %46 to i16
  %48 = add nuw nsw i16 %44, %47
  %49 = xor i16 %48, -1
  %50 = add nsw i16 %24, %49
  br label %51

51:                                               ; preds = %21, %40, %34
  %.0 = phi i16 [ %39, %34 ], [ %50, %40 ], [ %24, %21 ]
  %52 = getelementptr inbounds i8, ptr %0, i64 220
  %53 = load i8, ptr %52, align 4, !tbaa !54
  %54 = icmp ugt i8 %53, 33
  %55 = sext i1 %54 to i16
  %.1 = add nsw i16 %.0, %55
  call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %3) #7
  store i16 0, ptr %3, align 2, !tbaa !55
  %56 = call i32 @s2n_tls_record_overhead(ptr noundef nonnull %0, ptr noundef nonnull %3)
  %57 = call zeroext i1 @s2n_result_is_ok(i32 %56)
  br i1 %57, label %58, label %81

58:                                               ; preds = %51
  %59 = load i16, ptr %3, align 2, !tbaa !55
  %60 = icmp ugt i16 %.1, %59
  br i1 %60, label %69, label %61

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

69:                                               ; preds = %58
  %70 = sub nsw i16 %.1, %59
  %71 = icmp ult i16 %70, 1501
  br i1 %71, label %80, label %72

72:                                               ; preds = %69
  %73 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr @.str.13, ptr %73, align 8, !tbaa !5
  %74 = call ptr @strrchr(ptr noundef nonnull dereferenceable(1) getelementptr inbounds (i8, ptr @.str.13, i64 21), i32 noundef 47) #6
  %.not50 = icmp eq ptr %74, null
  %75 = getelementptr inbounds i8, ptr %74, i64 1
  %76 = select i1 %.not50, ptr getelementptr inbounds (i8, ptr @.str.13, i64 21), ptr %75
  %77 = getelementptr inbounds i8, ptr %73, i64 8
  store ptr %76, ptr %77, align 8, !tbaa !10
  %78 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 335544390, ptr %78, align 4, !tbaa !11
  %79 = call i32 @s2n_calculate_stacktrace() #7
  br label %81

80:                                               ; preds = %69
  store i16 %70, ptr %1, align 2, !tbaa !55
  br label %81

81:                                               ; preds = %51, %80, %72, %61
  %.sroa.028.0 = phi i32 [ 0, %80 ], [ -1, %72 ], [ -1, %61 ], [ -1, %51 ]
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %3) #7
  br label %82

82:                                               ; preds = %81, %13, %4
  %.sroa.028.3 = phi i32 [ %.sroa.028.0, %81 ], [ -1, %13 ], [ -1, %4 ]
  ret i32 %.sroa.028.3
}

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #1 = { 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 #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { 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 #6 = { nounwind willreturn memory(read) }
attributes #7 = { 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, !12, i64 148}
!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 = !{!7, !7, i64 0}
!42 = !{!43, !7, i64 0}
!43 = !{!"s2n_crypto_parameters", !7, i64 0, !44, i64 8, !44, i64 16, !45, i64 24, !45, i64 456, !8, i64 888, !8, i64 904, !8, i64 920, !8, i64 928}
!44 = !{!"s2n_session_key", !7, i64 0}
!45 = !{!"s2n_hmac_state", !12, i64 0, !30, i64 4, !12, i64 8, !30, i64 12, !8, i64 14, !46, i64 16, !46, i64 72, !46, i64 128, !46, i64 184, !8, i64 240, !8, i64 368}
!46 = !{!"s2n_hash_state", !7, i64 0, !12, i64 8, !8, i64 12, !16, i64 16, !8, i64 24}
!47 = !{!48, !7, i64 48}
!48 = !{!"s2n_cipher_suite", !12, i64 0, !7, i64 8, !7, i64 16, !8, i64 24, !7, i64 32, !12, i64 40, !7, i64 48, !8, i64 56, !8, i64 72, !7, i64 80, !7, i64 88, !12, i64 96, !8, i64 100}
!49 = !{!50, !7, i64 0}
!50 = !{!"s2n_record_algorithm", !7, i64 0, !12, i64 8, !12, i64 12, !16, i64 16}
!51 = !{!52, !12, i64 0}
!52 = !{!"s2n_cipher", !12, i64 0, !8, i64 8, !8, i64 48, !7, i64 56, !7, i64 64, !7, i64 72, !7, i64 80, !7, i64 88, !7, i64 96}
!53 = !{!8, !8, i64 0}
!54 = !{!14, !8, i64 220}
!55 = !{!30, !30, i64 0}


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