; LLVM IR from aws/s2n-tls :: tests/unit (s2n_tls13_pq_handshake_test)

; 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_security_policy = type { i8, ptr, ptr, ptr, ptr, ptr, ptr, i8, [2 x i8] }
%struct.s2n_ecc_preferences = type { i8, ptr }
%struct.s2n_ecc_named_curve = type { i16, i32, ptr, i8, ptr }

@_s2n_debug_info = external thread_local global %struct.s2n_debug_info, align 8
@s2n_errno = external thread_local global i32, align 4
@.str.26 = external hidden unnamed_addr constant [110 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [110 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [110 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [110 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [111 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [111 x i8], align 1

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

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #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: nounwind uwtable
define dso_local ptr @s2n_get_predicted_negotiated_ecdhe_curve(ptr noundef %0, ptr noundef %1) #4 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  br label %14

14:                                               ; preds = %2
  %15 = load ptr, ptr %4, align 8, !tbaa !5
  %16 = icmp ne ptr %15, null
  br i1 %16, label %48, label %17

17:                                               ; preds = %14
  br label %18

18:                                               ; preds = %17
  br label %19

19:                                               ; preds = %18
  %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
  store ptr @.str.26, ptr %21, align 8, !tbaa !9
  %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
  %24 = load ptr, ptr %23, align 8, !tbaa !9
  %25 = getelementptr inbounds i8, ptr %24, i64 21
  %26 = call ptr @strrchr(ptr noundef %25, i32 noundef 47) #5
  %27 = icmp ne ptr %26, null
  br i1 %27, label %28, label %35

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

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

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

46:                                               ; preds = %40
  store ptr null, ptr %3, align 8
  br label %361

47:                                               ; No predecessors!
  br label %48

48:                                               ; preds = %47, %14
  br label %49

49:                                               ; preds = %48
  br label %50

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

53:                                               ; preds = %50
  br label %54

54:                                               ; preds = %53
  br label %55

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

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

71:                                               ; preds = %55
  %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
  %74 = load ptr, ptr %73, align 8, !tbaa !9
  %75 = getelementptr inbounds i8, ptr %74, i64 21
  br label %76

76:                                               ; preds = %71, %64
  %77 = phi ptr [ %70, %64 ], [ %75, %71 ]
  %78 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %79 = getelementptr inbounds %struct.s2n_debug_info, ptr %78, i32 0, i32 1
  store ptr %77, ptr %79, align 8, !tbaa !11
  %80 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %80, align 4, !tbaa !12
  %81 = call i32 @s2n_calculate_stacktrace()
  br label %82

82:                                               ; preds = %76
  store ptr null, ptr %3, align 8
  br label %361

83:                                               ; No predecessors!
  br label %84

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

85:                                               ; preds = %84
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  %86 = load ptr, ptr %4, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.s2n_security_policy, ptr %86, i32 0, i32 5
  %88 = load ptr, ptr %87, align 8, !tbaa !14
  %89 = getelementptr inbounds %struct.s2n_ecc_preferences, ptr %88, i32 0, i32 1
  %90 = load ptr, ptr %89, align 8, !tbaa !17
  %91 = getelementptr inbounds ptr, ptr %90, i64 0
  %92 = load ptr, ptr %91, align 8, !tbaa !5
  store ptr %92, ptr %6, align 8, !tbaa !5
  br label %93

93:                                               ; preds = %85
  %94 = load ptr, ptr %6, align 8, !tbaa !5
  %95 = icmp ne ptr %94, null
  br i1 %95, label %129, label %96

96:                                               ; preds = %93
  br label %97

97:                                               ; preds = %96
  br label %98

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

107:                                              ; preds = %98
  %108 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %109 = getelementptr inbounds %struct.s2n_debug_info, ptr %108, i32 0, i32 0
  %110 = load ptr, ptr %109, align 8, !tbaa !9
  %111 = getelementptr inbounds i8, ptr %110, i64 21
  %112 = call ptr @strrchr(ptr noundef %111, i32 noundef 47) #5
  %113 = getelementptr inbounds i8, ptr %112, i64 1
  br label %119

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

119:                                              ; preds = %114, %107
  %120 = phi ptr [ %113, %107 ], [ %118, %114 ]
  %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 1
  store ptr %120, ptr %122, align 8, !tbaa !11
  %123 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %123, align 4, !tbaa !12
  %124 = call i32 @s2n_calculate_stacktrace()
  br label %125

125:                                              ; preds = %119
  br label %126

126:                                              ; preds = %125
  store ptr null, ptr %3, align 8
  store i32 1, ptr %7, align 4
  br label %360

127:                                              ; No predecessors!
  br label %128

128:                                              ; preds = %127
  br label %129

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

130:                                              ; preds = %129
  br label %131

131:                                              ; preds = %130
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 0, ptr %8, align 4, !tbaa !12
  br label %132

132:                                              ; preds = %206, %131
  %133 = load i32, ptr %8, align 4, !tbaa !12
  %134 = load ptr, ptr %5, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.s2n_security_policy, ptr %134, i32 0, i32 5
  %136 = load ptr, ptr %135, align 8, !tbaa !14
  %137 = getelementptr inbounds %struct.s2n_ecc_preferences, ptr %136, i32 0, i32 0
  %138 = load i8, ptr %137, align 8, !tbaa !19
  %139 = zext i8 %138 to i32
  %140 = icmp slt i32 %133, %139
  br i1 %140, label %142, label %141

141:                                              ; preds = %132
  store i32 20, ptr %7, align 4
  br label %209

142:                                              ; preds = %132
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %143 = load ptr, ptr %5, align 8, !tbaa !5
  %144 = getelementptr inbounds %struct.s2n_security_policy, ptr %143, i32 0, i32 5
  %145 = load ptr, ptr %144, align 8, !tbaa !14
  %146 = getelementptr inbounds %struct.s2n_ecc_preferences, ptr %145, i32 0, i32 1
  %147 = load ptr, ptr %146, align 8, !tbaa !17
  %148 = load i32, ptr %8, align 4, !tbaa !12
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds ptr, ptr %147, i64 %149
  %151 = load ptr, ptr %150, align 8, !tbaa !5
  store ptr %151, ptr %9, align 8, !tbaa !5
  br label %152

152:                                              ; preds = %142
  %153 = load ptr, ptr %9, align 8, !tbaa !5
  %154 = icmp ne ptr %153, null
  br i1 %154, label %188, label %155

155:                                              ; preds = %152
  br label %156

156:                                              ; preds = %155
  br label %157

157:                                              ; preds = %156
  %158 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %159 = getelementptr inbounds %struct.s2n_debug_info, ptr %158, i32 0, i32 0
  store ptr @.str.29, ptr %159, align 8, !tbaa !9
  %160 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %161 = getelementptr inbounds %struct.s2n_debug_info, ptr %160, i32 0, i32 0
  %162 = load ptr, ptr %161, align 8, !tbaa !9
  %163 = getelementptr inbounds i8, ptr %162, i64 21
  %164 = call ptr @strrchr(ptr noundef %163, i32 noundef 47) #5
  %165 = icmp ne ptr %164, null
  br i1 %165, label %166, label %173

166:                                              ; preds = %157
  %167 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %168 = getelementptr inbounds %struct.s2n_debug_info, ptr %167, i32 0, i32 0
  %169 = load ptr, ptr %168, align 8, !tbaa !9
  %170 = getelementptr inbounds i8, ptr %169, i64 21
  %171 = call ptr @strrchr(ptr noundef %170, i32 noundef 47) #5
  %172 = getelementptr inbounds i8, ptr %171, i64 1
  br label %178

173:                                              ; preds = %157
  %174 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %175 = getelementptr inbounds %struct.s2n_debug_info, ptr %174, i32 0, i32 0
  %176 = load ptr, ptr %175, align 8, !tbaa !9
  %177 = getelementptr inbounds i8, ptr %176, i64 21
  br label %178

178:                                              ; preds = %173, %166
  %179 = phi ptr [ %172, %166 ], [ %177, %173 ]
  %180 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %181 = getelementptr inbounds %struct.s2n_debug_info, ptr %180, i32 0, i32 1
  store ptr %179, ptr %181, align 8, !tbaa !11
  %182 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %182, align 4, !tbaa !12
  %183 = call i32 @s2n_calculate_stacktrace()
  br label %184

184:                                              ; preds = %178
  br label %185

185:                                              ; preds = %184
  store ptr null, ptr %3, align 8
  store i32 1, ptr %7, align 4
  br label %203

186:                                              ; No predecessors!
  br label %187

187:                                              ; preds = %186
  br label %188

188:                                              ; preds = %187, %152
  br label %189

189:                                              ; preds = %188
  br label %190

190:                                              ; preds = %189
  %191 = load ptr, ptr %9, align 8, !tbaa !5
  %192 = getelementptr inbounds %struct.s2n_ecc_named_curve, ptr %191, i32 0, i32 0
  %193 = load i16, ptr %192, align 8, !tbaa !20
  %194 = zext i16 %193 to i32
  %195 = load ptr, ptr %6, align 8, !tbaa !5
  %196 = getelementptr inbounds %struct.s2n_ecc_named_curve, ptr %195, i32 0, i32 0
  %197 = load i16, ptr %196, align 8, !tbaa !20
  %198 = zext i16 %197 to i32
  %199 = icmp eq i32 %194, %198
  br i1 %199, label %200, label %202

200:                                              ; preds = %190
  %201 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %201, ptr %3, align 8
  store i32 1, ptr %7, align 4
  br label %203

202:                                              ; preds = %190
  store i32 0, ptr %7, align 4
  br label %203

203:                                              ; preds = %202, %200, %185
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  %204 = load i32, ptr %7, align 4
  switch i32 %204, label %209 [
    i32 0, label %205
  ]

205:                                              ; preds = %203
  br label %206

206:                                              ; preds = %205
  %207 = load i32, ptr %8, align 4, !tbaa !12
  %208 = add nsw i32 %207, 1
  store i32 %208, ptr %8, align 4, !tbaa !12
  br label %132, !llvm.loop !23

209:                                              ; preds = %203, %141
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  %210 = load i32, ptr %7, align 4
  switch i32 %210, label %360 [
    i32 20, label %211
  ]

211:                                              ; preds = %209
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 0, ptr %10, align 4, !tbaa !12
  br label %212

212:                                              ; preds = %354, %211
  %213 = load i32, ptr %10, align 4, !tbaa !12
  %214 = load ptr, ptr %5, align 8, !tbaa !5
  %215 = getelementptr inbounds %struct.s2n_security_policy, ptr %214, i32 0, i32 5
  %216 = load ptr, ptr %215, align 8, !tbaa !14
  %217 = getelementptr inbounds %struct.s2n_ecc_preferences, ptr %216, i32 0, i32 0
  %218 = load i8, ptr %217, align 8, !tbaa !19
  %219 = zext i8 %218 to i32
  %220 = icmp slt i32 %213, %219
  br i1 %220, label %222, label %221

221:                                              ; preds = %212
  store i32 29, ptr %7, align 4
  br label %357

222:                                              ; preds = %212
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %223 = load ptr, ptr %5, align 8, !tbaa !5
  %224 = getelementptr inbounds %struct.s2n_security_policy, ptr %223, i32 0, i32 5
  %225 = load ptr, ptr %224, align 8, !tbaa !14
  %226 = getelementptr inbounds %struct.s2n_ecc_preferences, ptr %225, i32 0, i32 1
  %227 = load ptr, ptr %226, align 8, !tbaa !17
  %228 = load i32, ptr %10, align 4, !tbaa !12
  %229 = sext i32 %228 to i64
  %230 = getelementptr inbounds ptr, ptr %227, i64 %229
  %231 = load ptr, ptr %230, align 8, !tbaa !5
  store ptr %231, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  store i32 1, ptr %12, align 4, !tbaa !12
  br label %232

232:                                              ; preds = %345, %222
  %233 = load i32, ptr %12, align 4, !tbaa !12
  %234 = load ptr, ptr %4, align 8, !tbaa !5
  %235 = getelementptr inbounds %struct.s2n_security_policy, ptr %234, i32 0, i32 5
  %236 = load ptr, ptr %235, align 8, !tbaa !14
  %237 = getelementptr inbounds %struct.s2n_ecc_preferences, ptr %236, i32 0, i32 0
  %238 = load i8, ptr %237, align 8, !tbaa !19
  %239 = zext i8 %238 to i32
  %240 = icmp slt i32 %233, %239
  br i1 %240, label %242, label %241

241:                                              ; preds = %232
  store i32 32, ptr %7, align 4
  br label %348

242:                                              ; preds = %232
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %243 = load ptr, ptr %4, align 8, !tbaa !5
  %244 = getelementptr inbounds %struct.s2n_security_policy, ptr %243, i32 0, i32 5
  %245 = load ptr, ptr %244, align 8, !tbaa !14
  %246 = getelementptr inbounds %struct.s2n_ecc_preferences, ptr %245, i32 0, i32 1
  %247 = load ptr, ptr %246, align 8, !tbaa !17
  %248 = load i32, ptr %12, align 4, !tbaa !12
  %249 = sext i32 %248 to i64
  %250 = getelementptr inbounds ptr, ptr %247, i64 %249
  %251 = load ptr, ptr %250, align 8, !tbaa !5
  store ptr %251, ptr %13, align 8, !tbaa !5
  br label %252

252:                                              ; preds = %242
  %253 = load ptr, ptr %13, align 8, !tbaa !5
  %254 = icmp ne ptr %253, null
  br i1 %254, label %288, label %255

255:                                              ; preds = %252
  br label %256

256:                                              ; preds = %255
  br label %257

257:                                              ; preds = %256
  %258 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %259 = getelementptr inbounds %struct.s2n_debug_info, ptr %258, i32 0, i32 0
  store ptr @.str.30, ptr %259, align 8, !tbaa !9
  %260 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %261 = getelementptr inbounds %struct.s2n_debug_info, ptr %260, i32 0, i32 0
  %262 = load ptr, ptr %261, align 8, !tbaa !9
  %263 = getelementptr inbounds i8, ptr %262, i64 21
  %264 = call ptr @strrchr(ptr noundef %263, i32 noundef 47) #5
  %265 = icmp ne ptr %264, null
  br i1 %265, label %266, label %273

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

273:                                              ; preds = %257
  %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 0
  %276 = load ptr, ptr %275, align 8, !tbaa !9
  %277 = getelementptr inbounds i8, ptr %276, i64 21
  br label %278

278:                                              ; preds = %273, %266
  %279 = phi ptr [ %272, %266 ], [ %277, %273 ]
  %280 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %281 = getelementptr inbounds %struct.s2n_debug_info, ptr %280, i32 0, i32 1
  store ptr %279, ptr %281, align 8, !tbaa !11
  %282 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %282, align 4, !tbaa !12
  %283 = call i32 @s2n_calculate_stacktrace()
  br label %284

284:                                              ; preds = %278
  br label %285

285:                                              ; preds = %284
  store ptr null, ptr %3, align 8
  store i32 1, ptr %7, align 4
  br label %342

286:                                              ; No predecessors!
  br label %287

287:                                              ; preds = %286
  br label %288

288:                                              ; preds = %287, %252
  br label %289

289:                                              ; preds = %288
  br label %290

290:                                              ; preds = %289
  br label %291

291:                                              ; preds = %290
  %292 = load ptr, ptr %11, align 8, !tbaa !5
  %293 = icmp ne ptr %292, null
  br i1 %293, label %327, label %294

294:                                              ; preds = %291
  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.31, 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) #5
  %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) #5
  %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 402653193, ptr %321, align 4, !tbaa !12
  %322 = call i32 @s2n_calculate_stacktrace()
  br label %323

323:                                              ; preds = %317
  br label %324

324:                                              ; preds = %323
  store ptr null, ptr %3, align 8
  store i32 1, ptr %7, align 4
  br label %342

325:                                              ; No predecessors!
  br label %326

326:                                              ; preds = %325
  br label %327

327:                                              ; preds = %326, %291
  br label %328

328:                                              ; preds = %327
  br label %329

329:                                              ; preds = %328
  %330 = load ptr, ptr %13, align 8, !tbaa !5
  %331 = getelementptr inbounds %struct.s2n_ecc_named_curve, ptr %330, i32 0, i32 0
  %332 = load i16, ptr %331, align 8, !tbaa !20
  %333 = zext i16 %332 to i32
  %334 = load ptr, ptr %11, align 8, !tbaa !5
  %335 = getelementptr inbounds %struct.s2n_ecc_named_curve, ptr %334, i32 0, i32 0
  %336 = load i16, ptr %335, align 8, !tbaa !20
  %337 = zext i16 %336 to i32
  %338 = icmp eq i32 %333, %337
  br i1 %338, label %339, label %341

339:                                              ; preds = %329
  %340 = load ptr, ptr %13, align 8, !tbaa !5
  store ptr %340, ptr %3, align 8
  store i32 1, ptr %7, align 4
  br label %342

341:                                              ; preds = %329
  store i32 0, ptr %7, align 4
  br label %342

342:                                              ; preds = %341, %339, %324, %285
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  %343 = load i32, ptr %7, align 4
  switch i32 %343, label %348 [
    i32 0, label %344
  ]

344:                                              ; preds = %342
  br label %345

345:                                              ; preds = %344
  %346 = load i32, ptr %12, align 4, !tbaa !12
  %347 = add nsw i32 %346, 1
  store i32 %347, ptr %12, align 4, !tbaa !12
  br label %232, !llvm.loop !25

348:                                              ; preds = %342, %241
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  %349 = load i32, ptr %7, align 4
  switch i32 %349, label %351 [
    i32 32, label %350
  ]

350:                                              ; preds = %348
  store i32 0, ptr %7, align 4
  br label %351

351:                                              ; preds = %350, %348
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  %352 = load i32, ptr %7, align 4
  switch i32 %352, label %357 [
    i32 0, label %353
  ]

353:                                              ; preds = %351
  br label %354

354:                                              ; preds = %353
  %355 = load i32, ptr %10, align 4, !tbaa !12
  %356 = add nsw i32 %355, 1
  store i32 %356, ptr %10, align 4, !tbaa !12
  br label %212, !llvm.loop !26

357:                                              ; preds = %351, %221
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  %358 = load i32, ptr %7, align 4
  switch i32 %358, label %360 [
    i32 29, label %359
  ]

359:                                              ; preds = %357
  store ptr null, ptr %3, align 8
  store i32 1, ptr %7, align 4
  br label %360

360:                                              ; preds = %359, %357, %209, %126
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  br label %361

361:                                              ; preds = %360, %82, %46
  %362 = load ptr, ptr %3, align 8
  ret ptr %362
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 willreturn memory(read) }
attributes #6 = { 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, !6, i64 40}
!15 = !{!"s2n_security_policy", !7, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !16, i64 56, !7, i64 57}
!16 = !{!"_Bool", !7, i64 0}
!17 = !{!18, !6, i64 8}
!18 = !{!"s2n_ecc_preferences", !7, i64 0, !6, i64 8}
!19 = !{!18, !7, i64 0}
!20 = !{!21, !22, i64 0}
!21 = !{!"s2n_ecc_named_curve", !22, i64 0, !13, i64 4, !6, i64 8, !7, i64 16, !6, i64 24}
!22 = !{!"short", !7, i64 0}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}
!25 = distinct !{!25, !24}
!26 = distinct !{!26, !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.26 = external hidden unnamed_addr constant [110 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [110 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [110 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [110 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [111 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [111 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: nounwind uwtable
define dso_local ptr @s2n_get_predicted_negotiated_ecdhe_curve(ptr noundef readonly %0, ptr noundef readonly %1) local_unnamed_addr #3 {
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %.thread76.sink.split, label %3

3:                                                ; preds = %2
  %.not60 = icmp eq ptr %1, null
  br i1 %.not60, label %.thread76.sink.split, label %4

4:                                                ; preds = %3
  %5 = getelementptr inbounds i8, ptr %0, i64 40
  %6 = load ptr, ptr %5, align 8, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %6, i64 8
  %8 = load ptr, ptr %7, align 8, !tbaa !11
  %9 = load ptr, ptr %8, align 8, !tbaa !13
  %.not62 = icmp eq ptr %9, null
  br i1 %.not62, label %.thread76.sink.split, label %.preheader88

.preheader88:                                     ; preds = %4
  %10 = getelementptr inbounds i8, ptr %1, i64 40
  %11 = load ptr, ptr %10, align 8, !tbaa !5
  %12 = load i8, ptr %11, align 8, !tbaa !14
  %.not6697.not = icmp eq i8 %12, 0
  br i1 %.not6697.not, label %.thread76, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader88
  %13 = getelementptr inbounds i8, ptr %11, i64 8
  %14 = load ptr, ptr %13, align 8, !tbaa !11
  %wide.trip.count = zext i8 %12 to i64
  br label %27

15:                                               ; preds = %30
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %.preheader, label %27, !llvm.loop !15

.preheader:                                       ; preds = %15
  br i1 %.not6697.not, label %.thread76, label %.lr.ph115

.lr.ph115:                                        ; preds = %.preheader
  %16 = getelementptr inbounds i8, ptr %11, i64 8
  %17 = load ptr, ptr %16, align 8, !tbaa !11
  %18 = load i8, ptr %6, align 8, !tbaa !14
  %.not71100 = icmp ugt i8 %18, 1
  br i1 %.not71100, label %.lr.ph115.split.us, label %.thread76

.lr.ph115.split.us:                               ; preds = %.lr.ph115
  %wide.trip.count136 = zext i8 %12 to i64
  %wide.trip.count131 = zext i8 %18 to i64
  br label %.lr.ph103.us

.lr.ph103.us:                                     ; preds = %._crit_edge.us, %.lr.ph115.split.us
  %indvars.iv133 = phi i64 [ %indvars.iv.next134, %._crit_edge.us ], [ 0, %.lr.ph115.split.us ]
  %19 = getelementptr inbounds ptr, ptr %17, i64 %indvars.iv133
  %20 = load ptr, ptr %19, align 8, !tbaa !13
  %.fr = freeze ptr %20
  %.not69.us = icmp eq ptr %.fr, null
  br i1 %.not69.us, label %.lr.ph103.split.us, label %.lr.ph103.split.us119

21:                                               ; preds = %24
  %indvars.iv.next129 = add nuw nsw i64 %indvars.iv128, 1
  %exitcond132.not = icmp eq i64 %indvars.iv.next129, %wide.trip.count131
  br i1 %exitcond132.not, label %._crit_edge.us, label %.lr.ph103.split.us119, !llvm.loop !17

.lr.ph103.split.us119:                            ; preds = %.lr.ph103.us, %21
  %indvars.iv128 = phi i64 [ %indvars.iv.next129, %21 ], [ 1, %.lr.ph103.us ]
  %22 = getelementptr inbounds ptr, ptr %8, i64 %indvars.iv128
  %23 = load ptr, ptr %22, align 8, !tbaa !13
  %.not67.us118 = icmp eq ptr %23, null
  br i1 %.not67.us118, label %.thread76.sink.split, label %24

24:                                               ; preds = %.lr.ph103.split.us119
  %25 = load i16, ptr %23, align 8, !tbaa !18
  %26 = load i16, ptr %.fr, align 8, !tbaa !18
  %.not85.us = icmp eq i16 %25, %26
  br i1 %.not85.us, label %.thread76, label %21

._crit_edge.us:                                   ; preds = %21
  %indvars.iv.next134 = add nuw nsw i64 %indvars.iv133, 1
  %exitcond137.not = icmp eq i64 %indvars.iv.next134, %wide.trip.count136
  br i1 %exitcond137.not, label %.thread76, label %.lr.ph103.us, !llvm.loop !22

27:                                               ; preds = %.lr.ph, %15
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %15 ]
  %28 = getelementptr inbounds ptr, ptr %14, i64 %indvars.iv
  %29 = load ptr, ptr %28, align 8, !tbaa !13
  %.not64 = icmp eq ptr %29, null
  br i1 %.not64, label %.thread76.sink.split, label %30

30:                                               ; preds = %27
  %31 = load i16, ptr %29, align 8, !tbaa !18
  %32 = load i16, ptr %9, align 8, !tbaa !18
  %.not86 = icmp eq i16 %31, %32
  br i1 %.not86, label %.thread76, label %15

.lr.ph103.split.us:                               ; preds = %.lr.ph103.us
  %33 = getelementptr inbounds i8, ptr %8, i64 8
  %34 = load ptr, ptr %33, align 8, !tbaa !13
  %.not67.us = icmp eq ptr %34, null
  %spec.select = select i1 %.not67.us, ptr @.str.30, ptr @.str.31
  %spec.select149 = select i1 %.not67.us, ptr getelementptr inbounds (i8, ptr @.str.30, i64 21), ptr getelementptr inbounds (i8, ptr @.str.31, i64 21)
  br label %.thread76.sink.split

.thread76.sink.split:                             ; preds = %27, %.lr.ph103.split.us119, %.lr.ph103.split.us, %4, %3, %2
  %.str.31.sink = phi ptr [ @.str.26, %2 ], [ @.str.27, %3 ], [ @.str.28, %4 ], [ %spec.select, %.lr.ph103.split.us ], [ @.str.30, %.lr.ph103.split.us119 ], [ @.str.29, %27 ]
  %.sink148 = phi ptr [ getelementptr inbounds (i8, ptr @.str.26, i64 21), %2 ], [ getelementptr inbounds (i8, ptr @.str.27, i64 21), %3 ], [ getelementptr inbounds (i8, ptr @.str.28, i64 21), %4 ], [ %spec.select149, %.lr.ph103.split.us ], [ getelementptr inbounds (i8, ptr @.str.30, i64 21), %.lr.ph103.split.us119 ], [ getelementptr inbounds (i8, ptr @.str.29, i64 21), %27 ]
  %35 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr %.str.31.sink, ptr %35, align 8, !tbaa !23
  %36 = tail call ptr @strrchr(ptr noundef nonnull dereferenceable(1) %.sink148, i32 noundef 47) #4
  %.not70 = icmp eq ptr %36, null
  %37 = getelementptr inbounds i8, ptr %36, i64 1
  %38 = select i1 %.not70, ptr %.sink148, ptr %37
  %39 = getelementptr inbounds i8, ptr %35, i64 8
  store ptr %38, ptr %39, align 8, !tbaa !25
  %40 = tail call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %40, align 4, !tbaa !26
  %41 = tail call i32 @s2n_calculate_stacktrace() #5
  br label %.thread76

.thread76:                                        ; preds = %30, %._crit_edge.us, %24, %.thread76.sink.split, %.preheader88, %.lr.ph115, %.preheader
  %.9 = phi ptr [ null, %.preheader ], [ null, %.lr.ph115 ], [ null, %.preheader88 ], [ null, %.thread76.sink.split ], [ %23, %24 ], [ null, %._crit_edge.us ], [ %9, %30 ]
  ret ptr %.9
}

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 = { 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 #4 = { nounwind willreturn memory(read) }
attributes #5 = { 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, !9, i64 40}
!6 = !{!"s2n_security_policy", !7, i64 0, !9, i64 8, !9, i64 16, !9, i64 24, !9, i64 32, !9, i64 40, !9, i64 48, !10, i64 56, !7, i64 57}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!"any pointer", !7, i64 0}
!10 = !{!"_Bool", !7, i64 0}
!11 = !{!12, !9, i64 8}
!12 = !{!"s2n_ecc_preferences", !7, i64 0, !9, i64 8}
!13 = !{!9, !9, i64 0}
!14 = !{!12, !7, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}
!18 = !{!19, !20, i64 0}
!19 = !{!"s2n_ecc_named_curve", !20, i64 0, !21, i64 4, !9, i64 8, !7, i64 16, !9, i64 24}
!20 = !{!"short", !7, i64 0}
!21 = !{!"int", !7, i64 0}
!22 = distinct !{!22, !16}
!23 = !{!24, !9, i64 0}
!24 = !{!"s2n_debug_info", !9, i64 0, !9, i64 8}
!25 = !{!24, !9, i64 8}
!26 = !{!21, !21, i64 0}


; Effective O3 passes: ADCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass