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

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

@_s2n_debug_info = external thread_local global %struct.s2n_debug_info, align 8
@s2n_errno = external thread_local global i32, align 4
@.str.4 = external hidden unnamed_addr constant [93 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [93 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [93 x i8], align 1
@.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

; Function Attrs: nounwind uwtable
declare dso_local i32 @s2n_calculate_padding(i8 noundef zeroext, 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: inlinehint nounwind uwtable
declare hidden zeroext i1 @s2n_result_is_ok(i32) #5

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(none)
declare i64 @llvm.expect.i64(i64, i64) #6

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

; 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_read_npn_protocol(ptr noundef %0, ptr noundef %1) #0 {
  %3 = alloca %struct.s2n_result, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i8, align 1
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i8, align 1
  %10 = alloca ptr, align 8
  %11 = alloca i8, align 1
  %12 = alloca %struct.s2n_result, align 4
  %13 = alloca i8, align 1
  %14 = alloca ptr, align 8
  %15 = alloca [255 x i8], align 16
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  br label %16

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

19:                                               ; preds = %16
  br label %20

20:                                               ; preds = %19
  br label %21

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

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

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

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

48:                                               ; preds = %42
  %49 = getelementptr inbounds %struct.s2n_result, ptr %3, i32 0, i32 0
  store i32 -1, ptr %49, align 4, !tbaa !14
  br label %384

50:                                               ; No predecessors!
  br label %51

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

52:                                               ; preds = %51
  call void @llvm.lifetime.start.p0(i64 1, ptr %6) #9
  store i8 0, ptr %6, align 1, !tbaa !16
  br label %53

53:                                               ; preds = %52
  %54 = load ptr, ptr %5, align 8, !tbaa !5
  %55 = call i32 @s2n_stuffer_read_uint8(ptr noundef %54, ptr noundef %6)
  %56 = icmp sgt i32 %55, -1
  br i1 %56, label %59, label %57

57:                                               ; preds = %53
  %58 = getelementptr inbounds %struct.s2n_result, ptr %3, i32 0, i32 0
  store i32 -1, ptr %58, align 4, !tbaa !14
  store i32 1, ptr %7, align 4
  br label %383

59:                                               ; preds = %53
  br label %60

60:                                               ; preds = %59
  br label %61

61:                                               ; preds = %60
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #9
  %62 = load ptr, ptr %5, align 8, !tbaa !5
  %63 = load i8, ptr %6, align 1, !tbaa !16
  %64 = zext i8 %63 to i32
  %65 = call ptr @s2n_stuffer_raw_read(ptr noundef %62, i32 noundef %64)
  store ptr %65, ptr %8, align 8, !tbaa !5
  br label %66

66:                                               ; preds = %61
  %67 = load ptr, ptr %8, align 8, !tbaa !5
  %68 = icmp ne ptr %67, null
  br i1 %68, label %103, label %69

69:                                               ; preds = %66
  br label %70

70:                                               ; preds = %69
  br label %71

71:                                               ; preds = %70
  %72 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %73 = getelementptr inbounds %struct.s2n_debug_info, ptr %72, i32 0, i32 0
  store ptr @.str.5, ptr %73, align 8, !tbaa !9
  %74 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %75 = getelementptr inbounds %struct.s2n_debug_info, ptr %74, i32 0, i32 0
  %76 = load ptr, ptr %75, align 8, !tbaa !9
  %77 = getelementptr inbounds i8, ptr %76, i64 21
  %78 = call ptr @strrchr(ptr noundef %77, i32 noundef 47) #8
  %79 = icmp ne ptr %78, null
  br i1 %79, label %80, label %87

80:                                               ; preds = %71
  %81 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %82 = getelementptr inbounds %struct.s2n_debug_info, ptr %81, i32 0, i32 0
  %83 = load ptr, ptr %82, align 8, !tbaa !9
  %84 = getelementptr inbounds i8, ptr %83, i64 21
  %85 = call ptr @strrchr(ptr noundef %84, i32 noundef 47) #8
  %86 = getelementptr inbounds i8, ptr %85, i64 1
  br label %92

87:                                               ; preds = %71
  %88 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %89 = getelementptr inbounds %struct.s2n_debug_info, ptr %88, i32 0, i32 0
  %90 = load ptr, ptr %89, align 8, !tbaa !9
  %91 = getelementptr inbounds i8, ptr %90, i64 21
  br label %92

92:                                               ; preds = %87, %80
  %93 = phi ptr [ %86, %80 ], [ %91, %87 ]
  %94 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %95 = getelementptr inbounds %struct.s2n_debug_info, ptr %94, i32 0, i32 1
  store ptr %93, ptr %95, align 8, !tbaa !11
  %96 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %96, align 4, !tbaa !12
  %97 = call i32 @s2n_calculate_stacktrace()
  br label %98

98:                                               ; preds = %92
  br label %99

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

101:                                              ; No predecessors!
  br label %102

102:                                              ; preds = %101
  br label %103

103:                                              ; preds = %102, %66
  br label %104

104:                                              ; preds = %103
  br label %105

105:                                              ; preds = %104
  br label %106

106:                                              ; preds = %105
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #9
  %107 = load i8, ptr %6, align 1, !tbaa !16
  store i8 %107, ptr %9, align 1, !tbaa !16
  %108 = load i8, ptr %9, align 1, !tbaa !16
  %109 = icmp ne i8 %108, 0
  %110 = xor i1 %109, true
  %111 = xor i1 %110, true
  %112 = zext i1 %111 to i32
  %113 = sext i32 %112 to i64
  %114 = call i64 @llvm.expect.i64(i64 %113, i64 1)
  %115 = icmp ne i64 %114, 0
  br i1 %115, label %116, label %167

116:                                              ; preds = %106
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #9
  %117 = load ptr, ptr %4, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct.s2n_connection, ptr %117, i32 0, i32 64
  %119 = getelementptr inbounds [256 x i8], ptr %118, i64 0, i64 0
  %120 = load ptr, ptr %8, align 8, !tbaa !5
  %121 = load i8, ptr %9, align 1, !tbaa !16
  %122 = zext i8 %121 to i64
  %123 = call ptr @s2n_ensure_memmove_trace(ptr noundef %119, ptr noundef %120, i64 noundef %122)
  store ptr %123, ptr %10, align 8, !tbaa !5
  br label %124

124:                                              ; preds = %116
  %125 = load ptr, ptr %10, align 8, !tbaa !5
  %126 = icmp ne ptr %125, null
  br i1 %126, label %161, label %127

127:                                              ; preds = %124
  br label %128

128:                                              ; preds = %127
  br label %129

129:                                              ; preds = %128
  %130 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %131 = getelementptr inbounds %struct.s2n_debug_info, ptr %130, i32 0, i32 0
  store ptr @.str.6, ptr %131, align 8, !tbaa !9
  %132 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %133 = getelementptr inbounds %struct.s2n_debug_info, ptr %132, i32 0, i32 0
  %134 = load ptr, ptr %133, align 8, !tbaa !9
  %135 = getelementptr inbounds i8, ptr %134, i64 21
  %136 = call ptr @strrchr(ptr noundef %135, i32 noundef 47) #8
  %137 = icmp ne ptr %136, null
  br i1 %137, label %138, label %145

138:                                              ; preds = %129
  %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
  %141 = load ptr, ptr %140, align 8, !tbaa !9
  %142 = getelementptr inbounds i8, ptr %141, i64 21
  %143 = call ptr @strrchr(ptr noundef %142, i32 noundef 47) #8
  %144 = getelementptr inbounds i8, ptr %143, i64 1
  br label %150

145:                                              ; preds = %129
  %146 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %147 = getelementptr inbounds %struct.s2n_debug_info, ptr %146, i32 0, i32 0
  %148 = load ptr, ptr %147, align 8, !tbaa !9
  %149 = getelementptr inbounds i8, ptr %148, i64 21
  br label %150

150:                                              ; preds = %145, %138
  %151 = phi ptr [ %144, %138 ], [ %149, %145 ]
  %152 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %153 = getelementptr inbounds %struct.s2n_debug_info, ptr %152, i32 0, i32 1
  store ptr %151, ptr %153, align 8, !tbaa !11
  %154 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %154, align 4, !tbaa !12
  %155 = call i32 @s2n_calculate_stacktrace()
  br label %156

156:                                              ; preds = %150
  br label %157

157:                                              ; preds = %156
  %158 = getelementptr inbounds %struct.s2n_result, ptr %3, i32 0, i32 0
  store i32 -1, ptr %158, align 4, !tbaa !14
  store i32 1, ptr %7, align 4
  br label %164

159:                                              ; No predecessors!
  br label %160

160:                                              ; preds = %159
  br label %161

161:                                              ; preds = %160, %124
  br label %162

162:                                              ; preds = %161
  br label %163

163:                                              ; preds = %162
  store i32 0, ptr %7, align 4
  br label %164

164:                                              ; preds = %163, %157
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #9
  %165 = load i32, ptr %7, align 4
  switch i32 %165, label %168 [
    i32 0, label %166
  ]

166:                                              ; preds = %164
  br label %167

167:                                              ; preds = %166, %106
  store i32 0, ptr %7, align 4
  br label %168

168:                                              ; preds = %167, %164
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #9
  %169 = load i32, ptr %7, align 4
  switch i32 %169, label %382 [
    i32 0, label %170
  ]

170:                                              ; preds = %168
  br label %171

171:                                              ; preds = %170
  br label %172

172:                                              ; preds = %171
  %173 = load ptr, ptr %4, align 8, !tbaa !5
  %174 = getelementptr inbounds %struct.s2n_connection, ptr %173, i32 0, i32 64
  %175 = load i8, ptr %6, align 1, !tbaa !16
  %176 = zext i8 %175 to i64
  %177 = getelementptr inbounds [256 x i8], ptr %174, i64 0, i64 %176
  store i8 0, ptr %177, align 1, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 1, ptr %11) #9
  store i8 0, ptr %11, align 1, !tbaa !16
  br label %178

178:                                              ; preds = %172
  %179 = load i8, ptr %6, align 1, !tbaa !16
  %180 = call i32 @s2n_calculate_padding(i8 noundef zeroext %179, ptr noundef %11)
  %181 = getelementptr inbounds %struct.s2n_result, ptr %12, i32 0, i32 0
  store i32 %180, ptr %181, align 4
  %182 = getelementptr inbounds %struct.s2n_result, ptr %12, i32 0, i32 0
  %183 = load i32, ptr %182, align 4
  %184 = call zeroext i1 @s2n_result_is_ok(i32 %183)
  br i1 %184, label %187, label %185

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

187:                                              ; preds = %178
  br label %188

188:                                              ; preds = %187
  br label %189

189:                                              ; preds = %188
  call void @llvm.lifetime.start.p0(i64 1, ptr %13) #9
  store i8 0, ptr %13, align 1, !tbaa !16
  br label %190

190:                                              ; preds = %189
  %191 = load ptr, ptr %5, align 8, !tbaa !5
  %192 = call i32 @s2n_stuffer_read_uint8(ptr noundef %191, ptr noundef %13)
  %193 = icmp sgt i32 %192, -1
  br i1 %193, label %196, label %194

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

196:                                              ; preds = %190
  br label %197

197:                                              ; preds = %196
  br label %198

198:                                              ; preds = %197
  br label %199

199:                                              ; preds = %198
  %200 = load i8, ptr %13, align 1, !tbaa !16
  %201 = zext i8 %200 to i32
  %202 = load i8, ptr %11, align 1, !tbaa !16
  %203 = zext i8 %202 to i32
  %204 = icmp eq i32 %201, %203
  br i1 %204, label %239, label %205

205:                                              ; preds = %199
  br label %206

206:                                              ; preds = %205
  br label %207

207:                                              ; preds = %206
  %208 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %209 = getelementptr inbounds %struct.s2n_debug_info, ptr %208, i32 0, i32 0
  store ptr @.str.7, ptr %209, align 8, !tbaa !9
  %210 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %211 = getelementptr inbounds %struct.s2n_debug_info, ptr %210, i32 0, i32 0
  %212 = load ptr, ptr %211, align 8, !tbaa !9
  %213 = getelementptr inbounds i8, ptr %212, i64 21
  %214 = call ptr @strrchr(ptr noundef %213, i32 noundef 47) #8
  %215 = icmp ne ptr %214, null
  br i1 %215, label %216, label %223

216:                                              ; preds = %207
  %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 !9
  %220 = getelementptr inbounds i8, ptr %219, i64 21
  %221 = call ptr @strrchr(ptr noundef %220, i32 noundef 47) #8
  %222 = getelementptr inbounds i8, ptr %221, i64 1
  br label %228

223:                                              ; preds = %207
  %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 !9
  %227 = getelementptr inbounds i8, ptr %226, i64 21
  br label %228

228:                                              ; preds = %223, %216
  %229 = phi ptr [ %222, %216 ], [ %227, %223 ]
  %230 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %231 = getelementptr inbounds %struct.s2n_debug_info, ptr %230, i32 0, i32 1
  store ptr %229, ptr %231, align 8, !tbaa !11
  %232 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653194, ptr %232, align 4, !tbaa !12
  %233 = call i32 @s2n_calculate_stacktrace()
  br label %234

234:                                              ; preds = %228
  br label %235

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

237:                                              ; No predecessors!
  br label %238

238:                                              ; preds = %237
  br label %239

239:                                              ; preds = %238, %199
  br label %240

240:                                              ; preds = %239
  br label %241

241:                                              ; preds = %240
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #9
  %242 = load ptr, ptr %5, align 8, !tbaa !5
  %243 = load i8, ptr %13, align 1, !tbaa !16
  %244 = zext i8 %243 to i32
  %245 = call ptr @s2n_stuffer_raw_read(ptr noundef %242, i32 noundef %244)
  store ptr %245, ptr %14, align 8, !tbaa !5
  br label %246

246:                                              ; preds = %241
  %247 = load ptr, ptr %14, align 8, !tbaa !5
  %248 = icmp ne ptr %247, null
  br i1 %248, label %283, label %249

249:                                              ; preds = %246
  br label %250

250:                                              ; preds = %249
  br label %251

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

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

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

272:                                              ; preds = %267, %260
  %273 = phi ptr [ %266, %260 ], [ %271, %267 ]
  %274 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %275 = getelementptr inbounds %struct.s2n_debug_info, ptr %274, i32 0, i32 1
  store ptr %273, ptr %275, align 8, !tbaa !11
  %276 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %276, align 4, !tbaa !12
  %277 = call i32 @s2n_calculate_stacktrace()
  br label %278

278:                                              ; preds = %272
  br label %279

279:                                              ; preds = %278
  %280 = getelementptr inbounds %struct.s2n_result, ptr %3, i32 0, i32 0
  store i32 -1, ptr %280, align 4, !tbaa !14
  store i32 1, ptr %7, align 4
  br label %379

281:                                              ; No predecessors!
  br label %282

282:                                              ; preds = %281
  br label %283

283:                                              ; preds = %282, %246
  br label %284

284:                                              ; preds = %283
  br label %285

285:                                              ; preds = %284
  call void @llvm.lifetime.start.p0(i64 255, ptr %15) #9
  call void @llvm.memset.p0.i64(ptr align 16 %15, i8 0, i64 255, i1 false)
  br label %286

286:                                              ; preds = %285
  %287 = load ptr, ptr %14, align 8, !tbaa !5
  %288 = getelementptr inbounds [255 x i8], ptr %15, i64 0, i64 0
  %289 = load i8, ptr %13, align 1, !tbaa !16
  %290 = zext i8 %289 to i32
  %291 = call zeroext i1 @s2n_constant_time_equals(ptr noundef %287, ptr noundef %288, i32 noundef %290)
  %292 = zext i1 %291 to i32
  %293 = icmp eq i32 %292, 1
  br i1 %293, label %328, label %294

294:                                              ; preds = %286
  br label %295

295:                                              ; preds = %294
  br label %296

296:                                              ; preds = %295
  %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
  store ptr @.str.9, ptr %298, align 8, !tbaa !9
  %299 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %300 = getelementptr inbounds %struct.s2n_debug_info, ptr %299, i32 0, i32 0
  %301 = load ptr, ptr %300, align 8, !tbaa !9
  %302 = getelementptr inbounds i8, ptr %301, i64 21
  %303 = call ptr @strrchr(ptr noundef %302, i32 noundef 47) #8
  %304 = icmp ne ptr %303, null
  br i1 %304, label %305, label %312

305:                                              ; preds = %296
  %306 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %307 = getelementptr inbounds %struct.s2n_debug_info, ptr %306, i32 0, i32 0
  %308 = load ptr, ptr %307, align 8, !tbaa !9
  %309 = getelementptr inbounds i8, ptr %308, i64 21
  %310 = call ptr @strrchr(ptr noundef %309, i32 noundef 47) #8
  %311 = getelementptr inbounds i8, ptr %310, i64 1
  br label %317

312:                                              ; preds = %296
  %313 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %314 = getelementptr inbounds %struct.s2n_debug_info, ptr %313, i32 0, i32 0
  %315 = load ptr, ptr %314, align 8, !tbaa !9
  %316 = getelementptr inbounds i8, ptr %315, i64 21
  br label %317

317:                                              ; preds = %312, %305
  %318 = phi ptr [ %311, %305 ], [ %316, %312 ]
  %319 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %320 = getelementptr inbounds %struct.s2n_debug_info, ptr %319, i32 0, i32 1
  store ptr %318, ptr %320, align 8, !tbaa !11
  %321 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653194, ptr %321, align 4, !tbaa !12
  %322 = call i32 @s2n_calculate_stacktrace()
  br label %323

323:                                              ; preds = %317
  br label %324

324:                                              ; preds = %323
  %325 = getelementptr inbounds %struct.s2n_result, ptr %3, i32 0, i32 0
  store i32 -1, ptr %325, align 4, !tbaa !14
  store i32 1, ptr %7, align 4
  br label %378

326:                                              ; No predecessors!
  br label %327

327:                                              ; preds = %326
  br label %328

328:                                              ; preds = %327, %286
  br label %329

329:                                              ; preds = %328
  br label %330

330:                                              ; preds = %329
  br label %331

331:                                              ; preds = %330
  %332 = load ptr, ptr %5, align 8, !tbaa !5
  %333 = getelementptr inbounds %struct.s2n_stuffer, ptr %332, i32 0, i32 2
  %334 = load i32, ptr %333, align 4, !tbaa !17
  %335 = load ptr, ptr %5, align 8, !tbaa !5
  %336 = getelementptr inbounds %struct.s2n_stuffer, ptr %335, i32 0, i32 1
  %337 = load i32, ptr %336, align 8, !tbaa !20
  %338 = sub i32 %334, %337
  %339 = icmp eq i32 %338, 0
  br i1 %339, label %374, label %340

340:                                              ; preds = %331
  br label %341

341:                                              ; preds = %340
  br label %342

342:                                              ; preds = %341
  %343 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %344 = getelementptr inbounds %struct.s2n_debug_info, ptr %343, i32 0, i32 0
  store ptr @.str.10, ptr %344, align 8, !tbaa !9
  %345 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %346 = getelementptr inbounds %struct.s2n_debug_info, ptr %345, i32 0, i32 0
  %347 = load ptr, ptr %346, align 8, !tbaa !9
  %348 = getelementptr inbounds i8, ptr %347, i64 21
  %349 = call ptr @strrchr(ptr noundef %348, i32 noundef 47) #8
  %350 = icmp ne ptr %349, null
  br i1 %350, label %351, label %358

351:                                              ; preds = %342
  %352 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %353 = getelementptr inbounds %struct.s2n_debug_info, ptr %352, i32 0, i32 0
  %354 = load ptr, ptr %353, align 8, !tbaa !9
  %355 = getelementptr inbounds i8, ptr %354, i64 21
  %356 = call ptr @strrchr(ptr noundef %355, i32 noundef 47) #8
  %357 = getelementptr inbounds i8, ptr %356, i64 1
  br label %363

358:                                              ; preds = %342
  %359 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %360 = getelementptr inbounds %struct.s2n_debug_info, ptr %359, i32 0, i32 0
  %361 = load ptr, ptr %360, align 8, !tbaa !9
  %362 = getelementptr inbounds i8, ptr %361, i64 21
  br label %363

363:                                              ; preds = %358, %351
  %364 = phi ptr [ %357, %351 ], [ %362, %358 ]
  %365 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %366 = getelementptr inbounds %struct.s2n_debug_info, ptr %365, i32 0, i32 1
  store ptr %364, ptr %366, align 8, !tbaa !11
  %367 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653194, ptr %367, align 4, !tbaa !12
  %368 = call i32 @s2n_calculate_stacktrace()
  br label %369

369:                                              ; preds = %363
  br label %370

370:                                              ; preds = %369
  %371 = getelementptr inbounds %struct.s2n_result, ptr %3, i32 0, i32 0
  store i32 -1, ptr %371, align 4, !tbaa !14
  store i32 1, ptr %7, align 4
  br label %378

372:                                              ; No predecessors!
  br label %373

373:                                              ; preds = %372
  br label %374

374:                                              ; preds = %373, %331
  br label %375

375:                                              ; preds = %374
  br label %376

376:                                              ; preds = %375
  %377 = getelementptr inbounds %struct.s2n_result, ptr %3, i32 0, i32 0
  store i32 0, ptr %377, align 4, !tbaa !14
  store i32 1, ptr %7, align 4
  br label %378

378:                                              ; preds = %376, %370, %324
  call void @llvm.lifetime.end.p0(i64 255, ptr %15) #9
  br label %379

379:                                              ; preds = %378, %279
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #9
  br label %380

380:                                              ; preds = %379, %235, %194
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #9
  br label %381

381:                                              ; preds = %380, %185
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #9
  br label %382

382:                                              ; preds = %381, %168, %99
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #9
  br label %383

383:                                              ; preds = %382, %57
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #9
  br label %384

384:                                              ; preds = %383, %48
  %385 = getelementptr inbounds %struct.s2n_result, ptr %3, i32 0, i32 0
  %386 = load i32, ptr %385, align 4
  ret i32 %386
}

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

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

declare ptr @s2n_ensure_memmove_trace(ptr noundef, ptr noundef, i64 noundef) #3

declare zeroext i1 @s2n_constant_time_equals(ptr noundef, ptr noundef, i32 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 = { 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 #6 = { nocallback nofree nosync nounwind willreturn memory(none) }
attributes #7 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #8 = { nounwind willreturn memory(read) }
attributes #9 = { 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 = !{!7, !7, i64 0}
!17 = !{!18, !13, i64 28}
!18 = !{!"s2n_stuffer", !19, i64 0, !13, i64 24, !13, i64 28, !13, i64 32, !13, i64 36, !13, i64 36, !13, i64 36}
!19 = !{!"s2n_blob", !6, i64 0, !13, i64 8, !13, i64 12, !13, i64 16}
!20 = !{!18, !13, i64 24}


; 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.4 = external hidden unnamed_addr constant [93 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [93 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [93 x i8], align 1
@.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

; Function Attrs: nounwind uwtable
declare dso_local i32 @s2n_calculate_padding(i8 noundef zeroext, 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: inlinehint nounwind uwtable
declare hidden zeroext i1 @s2n_result_is_ok(i32) local_unnamed_addr #5

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

; 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_read_npn_protocol(ptr noundef %0, ptr noundef %1) local_unnamed_addr #0 {
  %3 = alloca i8, align 1
  %4 = alloca i8, align 1
  %5 = alloca i8, align 1
  %6 = alloca [255 x i8], align 16
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %7, label %15

7:                                                ; preds = %2
  %8 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr @.str.4, ptr %8, align 8, !tbaa !5
  %9 = tail call ptr @strrchr(ptr noundef nonnull dereferenceable(1) getelementptr inbounds (i8, ptr @.str.4, i64 21), i32 noundef 47) #7
  %.not31 = icmp eq ptr %9, null
  %10 = getelementptr inbounds i8, ptr %9, i64 1
  %11 = select i1 %.not31, ptr getelementptr inbounds (i8, ptr @.str.4, 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 %97

15:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %3) #8
  store i8 0, ptr %3, align 1, !tbaa !13
  %16 = call i32 @s2n_stuffer_read_uint8(ptr noundef %1, ptr noundef nonnull %3) #8
  %17 = icmp sgt i32 %16, -1
  br i1 %17, label %18, label %96

18:                                               ; preds = %15
  %19 = load i8, ptr %3, align 1, !tbaa !13
  %20 = zext i8 %19 to i32
  %21 = call ptr @s2n_stuffer_raw_read(ptr noundef %1, i32 noundef %20) #8
  %.not32 = icmp eq ptr %21, null
  br i1 %.not32, label %22, label %30

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

30:                                               ; preds = %18
  %31 = load i8, ptr %3, align 1, !tbaa !13
  %.not34 = icmp eq i8 %31, 0
  br i1 %.not34, label %.critedge43, label %32, !prof !14

32:                                               ; preds = %30
  %33 = getelementptr inbounds i8, ptr %0, i64 2528
  %34 = zext i8 %31 to i64
  %35 = call ptr @s2n_ensure_memmove_trace(ptr noundef nonnull %33, ptr noundef nonnull %21, i64 noundef %34) #8
  %.not35.not = icmp eq ptr %35, null
  br i1 %.not35.not, label %36, label %..critedge43_crit_edge

..critedge43_crit_edge:                           ; preds = %32
  %.pre = load i8, ptr %3, align 1, !tbaa !13
  br label %.critedge43

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

.critedge43:                                      ; preds = %..critedge43_crit_edge, %30
  %44 = phi i8 [ %.pre, %..critedge43_crit_edge ], [ 0, %30 ]
  %45 = getelementptr inbounds i8, ptr %0, i64 2528
  %46 = zext i8 %44 to i64
  %47 = getelementptr inbounds [256 x i8], ptr %45, i64 0, i64 %46
  store i8 0, ptr %47, align 1, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %4) #8
  store i8 0, ptr %4, align 1, !tbaa !13
  %48 = call i32 @s2n_calculate_padding(i8 noundef zeroext %44, ptr noundef nonnull %4)
  %49 = call zeroext i1 @s2n_result_is_ok(i32 %48)
  br i1 %49, label %50, label %95

50:                                               ; preds = %.critedge43
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %5) #8
  store i8 0, ptr %5, align 1, !tbaa !13
  %51 = call i32 @s2n_stuffer_read_uint8(ptr noundef %1, ptr noundef nonnull %5) #8
  %52 = icmp sgt i32 %51, -1
  br i1 %52, label %53, label %94

53:                                               ; preds = %50
  %54 = load i8, ptr %5, align 1, !tbaa !13
  %55 = load i8, ptr %4, align 1, !tbaa !13
  %56 = icmp eq i8 %54, %55
  br i1 %56, label %65, label %57

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

65:                                               ; preds = %53
  %66 = zext i8 %54 to i32
  %67 = call ptr @s2n_stuffer_raw_read(ptr noundef %1, i32 noundef %66) #8
  %.not38 = icmp eq ptr %67, null
  br i1 %.not38, label %68, label %76

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

76:                                               ; preds = %65
  call void @llvm.lifetime.start.p0(i64 255, ptr nonnull %6) #8
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(255) %6, i8 0, i64 255, i1 false)
  %77 = load i8, ptr %5, align 1, !tbaa !13
  %78 = zext i8 %77 to i32
  %79 = call zeroext i1 @s2n_constant_time_equals(ptr noundef nonnull %67, ptr noundef nonnull %6, i32 noundef %78) #8
  br i1 %79, label %80, label %.sink.split

80:                                               ; preds = %76
  %81 = getelementptr inbounds i8, ptr %1, i64 28
  %82 = load i32, ptr %81, align 4, !tbaa !15
  %83 = getelementptr inbounds i8, ptr %1, i64 24
  %84 = load i32, ptr %83, align 8, !tbaa !18
  %85 = icmp eq i32 %82, %84
  br i1 %85, label %93, label %.sink.split

.sink.split:                                      ; preds = %80, %76
  %.str.10.sink = phi ptr [ @.str.9, %76 ], [ @.str.10, %80 ]
  %.sink49 = phi ptr [ getelementptr inbounds (i8, ptr @.str.9, i64 21), %76 ], [ getelementptr inbounds (i8, ptr @.str.10, i64 21), %80 ]
  %86 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr %.str.10.sink, ptr %86, align 8, !tbaa !5
  %87 = call ptr @strrchr(ptr noundef nonnull dereferenceable(1) %.sink49, i32 noundef 47) #7
  %.not41 = icmp eq ptr %87, null
  %88 = getelementptr inbounds i8, ptr %87, i64 1
  %89 = select i1 %.not41, ptr %.sink49, ptr %88
  %90 = getelementptr inbounds i8, ptr %86, i64 8
  store ptr %89, ptr %90, align 8, !tbaa !10
  %91 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653194, ptr %91, align 4, !tbaa !11
  %92 = call i32 @s2n_calculate_stacktrace() #8
  br label %93

93:                                               ; preds = %.sink.split, %80
  %.sroa.018.3 = phi i32 [ 0, %80 ], [ -1, %.sink.split ]
  call void @llvm.lifetime.end.p0(i64 255, ptr nonnull %6) #8
  br label %94

94:                                               ; preds = %68, %93, %50, %57
  %.sroa.018.5 = phi i32 [ -1, %57 ], [ -1, %50 ], [ %.sroa.018.3, %93 ], [ -1, %68 ]
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #8
  br label %95

95:                                               ; preds = %.critedge43, %94
  %.sroa.018.6 = phi i32 [ %.sroa.018.5, %94 ], [ -1, %.critedge43 ]
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #8
  br label %96

96:                                               ; preds = %36, %22, %95, %15
  %.sroa.018.8 = phi i32 [ -1, %15 ], [ %.sroa.018.6, %95 ], [ -1, %22 ], [ -1, %36 ]
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %3) #8
  br label %97

97:                                               ; preds = %96, %7
  %.sroa.018.9 = phi i32 [ %.sroa.018.8, %96 ], [ -1, %7 ]
  ret i32 %.sroa.018.9
}

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

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

declare ptr @s2n_ensure_memmove_trace(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #3

declare zeroext i1 @s2n_constant_time_equals(ptr noundef, ptr noundef, i32 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 = { 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 #6 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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 = !{!8, !8, i64 0}
!14 = !{!"branch_weights", !"expected", i32 1, i32 2000}
!15 = !{!16, !12, i64 28}
!16 = !{!"s2n_stuffer", !17, i64 0, !12, i64 24, !12, i64 28, !12, i64 32, !12, i64 36, !12, i64 36, !12, i64 36}
!17 = !{!"s2n_blob", !7, i64 0, !12, i64 8, !12, i64 12, !12, i64 16}
!18 = !{!16, !12, i64 24}


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