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

; 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_blob = type { ptr, i32, i32, i8 }

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @s2n_check_all_dh_params(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: inlinehint nounwind uwtable
declare hidden zeroext i1 @s2n_result_is_ok(i32) #4

declare i32 @s2n_blob_validate(ptr noundef) #3

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

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

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

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

22:                                               ; preds = %3
  %23 = load ptr, ptr %5, align 8, !tbaa !5
  %24 = call i32 @s2n_check_all_dh_params(ptr noundef %23)
  %25 = icmp sgt i32 %24, -1
  br i1 %25, label %27, label %26

26:                                               ; preds = %22
  store i32 -1, ptr %4, align 4
  br label %442

27:                                               ; preds = %22
  br label %28

28:                                               ; preds = %27
  br label %29

29:                                               ; preds = %28
  %30 = load ptr, ptr %6, align 8, !tbaa !5
  %31 = call i32 @s2n_stuffer_validate(ptr noundef %30)
  %32 = getelementptr inbounds %struct.s2n_result, ptr %9, i32 0, i32 0
  store i32 %31, ptr %32, align 4
  %33 = getelementptr inbounds %struct.s2n_result, ptr %9, i32 0, i32 0
  %34 = load i32, ptr %33, align 4
  %35 = call zeroext i1 @s2n_result_is_ok(i32 %34)
  %36 = xor i1 %35, true
  %37 = xor i1 %36, true
  %38 = zext i1 %37 to i32
  %39 = sext i32 %38 to i64
  %40 = call i64 @llvm.expect.i64(i64 %39, i64 1)
  %41 = icmp ne i64 %40, 0
  br i1 %41, label %42, label %44

42:                                               ; preds = %29
  %43 = getelementptr inbounds %struct.s2n_result, ptr %8, i32 0, i32 0
  store i32 0, ptr %43, align 4, !tbaa !9
  br label %46

44:                                               ; preds = %29
  %45 = getelementptr inbounds %struct.s2n_result, ptr %8, i32 0, i32 0
  store i32 -1, ptr %45, align 4, !tbaa !9
  br label %46

46:                                               ; preds = %44, %42
  %47 = getelementptr inbounds %struct.s2n_result, ptr %8, i32 0, i32 0
  %48 = load i32, ptr %47, align 4
  %49 = call zeroext i1 @s2n_result_is_ok(i32 %48)
  br i1 %49, label %51, label %50

50:                                               ; preds = %46
  store i32 -1, ptr %4, align 4
  br label %442

51:                                               ; preds = %46
  br label %52

52:                                               ; preds = %51
  br label %53

53:                                               ; preds = %52
  %54 = load ptr, ptr %7, align 8, !tbaa !5
  %55 = call i32 @s2n_blob_validate(ptr noundef %54)
  %56 = getelementptr inbounds %struct.s2n_result, ptr %11, i32 0, i32 0
  store i32 %55, ptr %56, align 4
  %57 = getelementptr inbounds %struct.s2n_result, ptr %11, i32 0, i32 0
  %58 = load i32, ptr %57, align 4
  %59 = call zeroext i1 @s2n_result_is_ok(i32 %58)
  %60 = xor i1 %59, true
  %61 = xor i1 %60, true
  %62 = zext i1 %61 to i32
  %63 = sext i32 %62 to i64
  %64 = call i64 @llvm.expect.i64(i64 %63, i64 1)
  %65 = icmp ne i64 %64, 0
  br i1 %65, label %66, label %68

66:                                               ; preds = %53
  %67 = getelementptr inbounds %struct.s2n_result, ptr %10, i32 0, i32 0
  store i32 0, ptr %67, align 4, !tbaa !9
  br label %70

68:                                               ; preds = %53
  %69 = getelementptr inbounds %struct.s2n_result, ptr %10, i32 0, i32 0
  store i32 -1, ptr %69, align 4, !tbaa !9
  br label %70

70:                                               ; preds = %68, %66
  %71 = getelementptr inbounds %struct.s2n_result, ptr %10, i32 0, i32 0
  %72 = load i32, ptr %71, align 4
  %73 = call zeroext i1 @s2n_result_is_ok(i32 %72)
  br i1 %73, label %75, label %74

74:                                               ; preds = %70
  store i32 -1, ptr %4, align 4
  br label %442

75:                                               ; preds = %70
  br label %76

76:                                               ; preds = %75
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  %77 = load ptr, ptr %5, align 8, !tbaa !5
  %78 = call ptr @s2n_get_p_dh_param(ptr noundef %77)
  store ptr %78, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  %79 = load ptr, ptr %5, align 8, !tbaa !5
  %80 = call ptr @s2n_get_g_dh_param(ptr noundef %79)
  store ptr %80, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  %81 = load ptr, ptr %5, align 8, !tbaa !5
  %82 = call ptr @s2n_get_Ys_dh_param(ptr noundef %81)
  store ptr %82, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 2, ptr %15) #7
  %83 = load ptr, ptr %12, align 8, !tbaa !5
  %84 = call i32 @BN_num_bits(ptr noundef %83)
  %85 = add nsw i32 %84, 7
  %86 = sdiv i32 %85, 8
  %87 = trunc i32 %86 to i16
  store i16 %87, ptr %15, align 2, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 2, ptr %16) #7
  %88 = load ptr, ptr %13, align 8, !tbaa !5
  %89 = call i32 @BN_num_bits(ptr noundef %88)
  %90 = add nsw i32 %89, 7
  %91 = sdiv i32 %90, 8
  %92 = trunc i32 %91 to i16
  store i16 %92, ptr %16, align 2, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 2, ptr %17) #7
  %93 = load ptr, ptr %14, align 8, !tbaa !5
  %94 = call i32 @BN_num_bits(ptr noundef %93)
  %95 = add nsw i32 %94, 7
  %96 = sdiv i32 %95, 8
  %97 = trunc i32 %96 to i16
  store i16 %97, ptr %17, align 2, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  store ptr null, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #7
  store ptr null, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #7
  store ptr null, ptr %20, align 8, !tbaa !5
  %98 = load ptr, ptr %6, align 8, !tbaa !5
  %99 = call ptr @s2n_stuffer_raw_write(ptr noundef %98, i32 noundef 0)
  %100 = load ptr, ptr %7, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.s2n_blob, ptr %100, i32 0, i32 0
  store ptr %99, ptr %101, align 8, !tbaa !14
  br label %102

102:                                              ; preds = %76
  %103 = load ptr, ptr %7, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.s2n_blob, ptr %103, i32 0, i32 0
  %105 = load ptr, ptr %104, align 8, !tbaa !14
  %106 = icmp ne ptr %105, null
  br i1 %106, label %140, label %107

107:                                              ; preds = %102
  br label %108

108:                                              ; preds = %107
  br label %109

109:                                              ; preds = %108
  %110 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %111 = getelementptr inbounds %struct.s2n_debug_info, ptr %110, i32 0, i32 0
  store ptr @.str.6, ptr %111, align 8, !tbaa !16
  %112 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %113 = getelementptr inbounds %struct.s2n_debug_info, ptr %112, i32 0, i32 0
  %114 = load ptr, ptr %113, align 8, !tbaa !16
  %115 = getelementptr inbounds i8, ptr %114, i64 21
  %116 = call ptr @strrchr(ptr noundef %115, i32 noundef 47) #8
  %117 = icmp ne ptr %116, null
  br i1 %117, label %118, label %125

118:                                              ; preds = %109
  %119 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %120 = getelementptr inbounds %struct.s2n_debug_info, ptr %119, i32 0, i32 0
  %121 = load ptr, ptr %120, align 8, !tbaa !16
  %122 = getelementptr inbounds i8, ptr %121, i64 21
  %123 = call ptr @strrchr(ptr noundef %122, i32 noundef 47) #8
  %124 = getelementptr inbounds i8, ptr %123, i64 1
  br label %130

125:                                              ; preds = %109
  %126 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %127 = getelementptr inbounds %struct.s2n_debug_info, ptr %126, i32 0, i32 0
  %128 = load ptr, ptr %127, align 8, !tbaa !16
  %129 = getelementptr inbounds i8, ptr %128, i64 21
  br label %130

130:                                              ; preds = %125, %118
  %131 = phi ptr [ %124, %118 ], [ %129, %125 ]
  %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 1
  store ptr %131, ptr %133, align 8, !tbaa !18
  %134 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %134, align 4, !tbaa !19
  %135 = call i32 @s2n_calculate_stacktrace()
  br label %136

136:                                              ; preds = %130
  br label %137

137:                                              ; preds = %136
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %21, align 4
  br label %441

138:                                              ; No predecessors!
  br label %139

139:                                              ; preds = %138
  br label %140

140:                                              ; preds = %139, %102
  br label %141

141:                                              ; preds = %140
  br label %142

142:                                              ; preds = %141
  br label %143

143:                                              ; preds = %142
  %144 = load ptr, ptr %6, align 8, !tbaa !5
  %145 = load i16, ptr %15, align 2, !tbaa !12
  %146 = call i32 @s2n_stuffer_write_uint16(ptr noundef %144, i16 noundef zeroext %145)
  %147 = icmp sgt i32 %146, -1
  br i1 %147, label %149, label %148

148:                                              ; preds = %143
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %21, align 4
  br label %441

149:                                              ; preds = %143
  br label %150

150:                                              ; preds = %149
  br label %151

151:                                              ; preds = %150
  %152 = load ptr, ptr %6, align 8, !tbaa !5
  %153 = load i16, ptr %15, align 2, !tbaa !12
  %154 = zext i16 %153 to i32
  %155 = call ptr @s2n_stuffer_raw_write(ptr noundef %152, i32 noundef %154)
  store ptr %155, ptr %18, align 8, !tbaa !5
  br label %156

156:                                              ; preds = %151
  %157 = load ptr, ptr %18, align 8, !tbaa !5
  %158 = icmp ne ptr %157, null
  br i1 %158, label %192, label %159

159:                                              ; preds = %156
  br label %160

160:                                              ; preds = %159
  br label %161

161:                                              ; preds = %160
  %162 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %163 = getelementptr inbounds %struct.s2n_debug_info, ptr %162, i32 0, i32 0
  store ptr @.str.7, ptr %163, align 8, !tbaa !16
  %164 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %165 = getelementptr inbounds %struct.s2n_debug_info, ptr %164, i32 0, i32 0
  %166 = load ptr, ptr %165, align 8, !tbaa !16
  %167 = getelementptr inbounds i8, ptr %166, i64 21
  %168 = call ptr @strrchr(ptr noundef %167, i32 noundef 47) #8
  %169 = icmp ne ptr %168, null
  br i1 %169, label %170, label %177

170:                                              ; preds = %161
  %171 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %172 = getelementptr inbounds %struct.s2n_debug_info, ptr %171, i32 0, i32 0
  %173 = load ptr, ptr %172, align 8, !tbaa !16
  %174 = getelementptr inbounds i8, ptr %173, i64 21
  %175 = call ptr @strrchr(ptr noundef %174, i32 noundef 47) #8
  %176 = getelementptr inbounds i8, ptr %175, i64 1
  br label %182

177:                                              ; preds = %161
  %178 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %179 = getelementptr inbounds %struct.s2n_debug_info, ptr %178, i32 0, i32 0
  %180 = load ptr, ptr %179, align 8, !tbaa !16
  %181 = getelementptr inbounds i8, ptr %180, i64 21
  br label %182

182:                                              ; preds = %177, %170
  %183 = phi ptr [ %176, %170 ], [ %181, %177 ]
  %184 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %185 = getelementptr inbounds %struct.s2n_debug_info, ptr %184, i32 0, i32 1
  store ptr %183, ptr %185, align 8, !tbaa !18
  %186 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %186, align 4, !tbaa !19
  %187 = call i32 @s2n_calculate_stacktrace()
  br label %188

188:                                              ; preds = %182
  br label %189

189:                                              ; preds = %188
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %21, align 4
  br label %441

190:                                              ; No predecessors!
  br label %191

191:                                              ; preds = %190
  br label %192

192:                                              ; preds = %191, %156
  br label %193

193:                                              ; preds = %192
  br label %194

194:                                              ; preds = %193
  br label %195

195:                                              ; preds = %194
  %196 = load ptr, ptr %12, align 8, !tbaa !5
  %197 = load ptr, ptr %18, align 8, !tbaa !5
  %198 = call i32 @BN_bn2bin(ptr noundef %196, ptr noundef %197)
  %199 = load i16, ptr %15, align 2, !tbaa !12
  %200 = zext i16 %199 to i32
  %201 = icmp eq i32 %198, %200
  br i1 %201, label %235, label %202

202:                                              ; preds = %195
  br label %203

203:                                              ; preds = %202
  br label %204

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

213:                                              ; preds = %204
  %214 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %215 = getelementptr inbounds %struct.s2n_debug_info, ptr %214, i32 0, i32 0
  %216 = load ptr, ptr %215, align 8, !tbaa !16
  %217 = getelementptr inbounds i8, ptr %216, i64 21
  %218 = call ptr @strrchr(ptr noundef %217, i32 noundef 47) #8
  %219 = getelementptr inbounds i8, ptr %218, i64 1
  br label %225

220:                                              ; preds = %204
  %221 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %222 = getelementptr inbounds %struct.s2n_debug_info, ptr %221, i32 0, i32 0
  %223 = load ptr, ptr %222, align 8, !tbaa !16
  %224 = getelementptr inbounds i8, ptr %223, i64 21
  br label %225

225:                                              ; preds = %220, %213
  %226 = phi ptr [ %219, %213 ], [ %224, %220 ]
  %227 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %228 = getelementptr inbounds %struct.s2n_debug_info, ptr %227, i32 0, i32 1
  store ptr %226, ptr %228, align 8, !tbaa !18
  %229 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 335544328, ptr %229, align 4, !tbaa !19
  %230 = call i32 @s2n_calculate_stacktrace()
  br label %231

231:                                              ; preds = %225
  br label %232

232:                                              ; preds = %231
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %21, align 4
  br label %441

233:                                              ; No predecessors!
  br label %234

234:                                              ; preds = %233
  br label %235

235:                                              ; preds = %234, %195
  br label %236

236:                                              ; preds = %235
  br label %237

237:                                              ; preds = %236
  br label %238

238:                                              ; preds = %237
  %239 = load ptr, ptr %6, align 8, !tbaa !5
  %240 = load i16, ptr %16, align 2, !tbaa !12
  %241 = call i32 @s2n_stuffer_write_uint16(ptr noundef %239, i16 noundef zeroext %240)
  %242 = icmp sgt i32 %241, -1
  br i1 %242, label %244, label %243

243:                                              ; preds = %238
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %21, align 4
  br label %441

244:                                              ; preds = %238
  br label %245

245:                                              ; preds = %244
  br label %246

246:                                              ; preds = %245
  %247 = load ptr, ptr %6, align 8, !tbaa !5
  %248 = load i16, ptr %16, align 2, !tbaa !12
  %249 = zext i16 %248 to i32
  %250 = call ptr @s2n_stuffer_raw_write(ptr noundef %247, i32 noundef %249)
  store ptr %250, ptr %19, align 8, !tbaa !5
  br label %251

251:                                              ; preds = %246
  %252 = load ptr, ptr %19, align 8, !tbaa !5
  %253 = icmp ne ptr %252, null
  br i1 %253, label %287, label %254

254:                                              ; preds = %251
  br label %255

255:                                              ; preds = %254
  br label %256

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

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

272:                                              ; preds = %256
  %273 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %274 = getelementptr inbounds %struct.s2n_debug_info, ptr %273, i32 0, i32 0
  %275 = load ptr, ptr %274, align 8, !tbaa !16
  %276 = getelementptr inbounds i8, ptr %275, i64 21
  br label %277

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

283:                                              ; preds = %277
  br label %284

284:                                              ; preds = %283
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %21, align 4
  br label %441

285:                                              ; No predecessors!
  br label %286

286:                                              ; preds = %285
  br label %287

287:                                              ; preds = %286, %251
  br label %288

288:                                              ; preds = %287
  br label %289

289:                                              ; preds = %288
  br label %290

290:                                              ; preds = %289
  %291 = load ptr, ptr %13, align 8, !tbaa !5
  %292 = load ptr, ptr %19, align 8, !tbaa !5
  %293 = call i32 @BN_bn2bin(ptr noundef %291, ptr noundef %292)
  %294 = load i16, ptr %16, align 2, !tbaa !12
  %295 = zext i16 %294 to i32
  %296 = icmp eq i32 %293, %295
  br i1 %296, label %330, label %297

297:                                              ; preds = %290
  br label %298

298:                                              ; preds = %297
  br label %299

299:                                              ; preds = %298
  %300 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %301 = getelementptr inbounds %struct.s2n_debug_info, ptr %300, i32 0, i32 0
  store ptr @.str.10, ptr %301, align 8, !tbaa !16
  %302 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %303 = getelementptr inbounds %struct.s2n_debug_info, ptr %302, i32 0, i32 0
  %304 = load ptr, ptr %303, align 8, !tbaa !16
  %305 = getelementptr inbounds i8, ptr %304, i64 21
  %306 = call ptr @strrchr(ptr noundef %305, i32 noundef 47) #8
  %307 = icmp ne ptr %306, null
  br i1 %307, label %308, label %315

308:                                              ; preds = %299
  %309 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %310 = getelementptr inbounds %struct.s2n_debug_info, ptr %309, i32 0, i32 0
  %311 = load ptr, ptr %310, align 8, !tbaa !16
  %312 = getelementptr inbounds i8, ptr %311, i64 21
  %313 = call ptr @strrchr(ptr noundef %312, i32 noundef 47) #8
  %314 = getelementptr inbounds i8, ptr %313, i64 1
  br label %320

315:                                              ; preds = %299
  %316 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %317 = getelementptr inbounds %struct.s2n_debug_info, ptr %316, i32 0, i32 0
  %318 = load ptr, ptr %317, align 8, !tbaa !16
  %319 = getelementptr inbounds i8, ptr %318, i64 21
  br label %320

320:                                              ; preds = %315, %308
  %321 = phi ptr [ %314, %308 ], [ %319, %315 ]
  %322 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %323 = getelementptr inbounds %struct.s2n_debug_info, ptr %322, i32 0, i32 1
  store ptr %321, ptr %323, align 8, !tbaa !18
  %324 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 335544328, ptr %324, align 4, !tbaa !19
  %325 = call i32 @s2n_calculate_stacktrace()
  br label %326

326:                                              ; preds = %320
  br label %327

327:                                              ; preds = %326
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %21, align 4
  br label %441

328:                                              ; No predecessors!
  br label %329

329:                                              ; preds = %328
  br label %330

330:                                              ; preds = %329, %290
  br label %331

331:                                              ; preds = %330
  br label %332

332:                                              ; preds = %331
  br label %333

333:                                              ; preds = %332
  %334 = load ptr, ptr %6, align 8, !tbaa !5
  %335 = load i16, ptr %17, align 2, !tbaa !12
  %336 = call i32 @s2n_stuffer_write_uint16(ptr noundef %334, i16 noundef zeroext %335)
  %337 = icmp sgt i32 %336, -1
  br i1 %337, label %339, label %338

338:                                              ; preds = %333
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %21, align 4
  br label %441

339:                                              ; preds = %333
  br label %340

340:                                              ; preds = %339
  br label %341

341:                                              ; preds = %340
  %342 = load ptr, ptr %6, align 8, !tbaa !5
  %343 = load i16, ptr %17, align 2, !tbaa !12
  %344 = zext i16 %343 to i32
  %345 = call ptr @s2n_stuffer_raw_write(ptr noundef %342, i32 noundef %344)
  store ptr %345, ptr %20, align 8, !tbaa !5
  br label %346

346:                                              ; preds = %341
  %347 = load ptr, ptr %20, align 8, !tbaa !5
  %348 = icmp ne ptr %347, null
  br i1 %348, label %382, label %349

349:                                              ; preds = %346
  br label %350

350:                                              ; preds = %349
  br label %351

351:                                              ; preds = %350
  %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
  store ptr @.str.11, ptr %353, align 8, !tbaa !16
  %354 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %355 = getelementptr inbounds %struct.s2n_debug_info, ptr %354, i32 0, i32 0
  %356 = load ptr, ptr %355, align 8, !tbaa !16
  %357 = getelementptr inbounds i8, ptr %356, i64 21
  %358 = call ptr @strrchr(ptr noundef %357, i32 noundef 47) #8
  %359 = icmp ne ptr %358, null
  br i1 %359, label %360, label %367

360:                                              ; preds = %351
  %361 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %362 = getelementptr inbounds %struct.s2n_debug_info, ptr %361, i32 0, i32 0
  %363 = load ptr, ptr %362, align 8, !tbaa !16
  %364 = getelementptr inbounds i8, ptr %363, i64 21
  %365 = call ptr @strrchr(ptr noundef %364, i32 noundef 47) #8
  %366 = getelementptr inbounds i8, ptr %365, i64 1
  br label %372

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

372:                                              ; preds = %367, %360
  %373 = phi ptr [ %366, %360 ], [ %371, %367 ]
  %374 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %375 = getelementptr inbounds %struct.s2n_debug_info, ptr %374, i32 0, i32 1
  store ptr %373, ptr %375, align 8, !tbaa !18
  %376 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %376, align 4, !tbaa !19
  %377 = call i32 @s2n_calculate_stacktrace()
  br label %378

378:                                              ; preds = %372
  br label %379

379:                                              ; preds = %378
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %21, align 4
  br label %441

380:                                              ; No predecessors!
  br label %381

381:                                              ; preds = %380
  br label %382

382:                                              ; preds = %381, %346
  br label %383

383:                                              ; preds = %382
  br label %384

384:                                              ; preds = %383
  br label %385

385:                                              ; preds = %384
  %386 = load ptr, ptr %14, align 8, !tbaa !5
  %387 = load ptr, ptr %20, align 8, !tbaa !5
  %388 = call i32 @BN_bn2bin(ptr noundef %386, ptr noundef %387)
  %389 = load i16, ptr %17, align 2, !tbaa !12
  %390 = zext i16 %389 to i32
  %391 = icmp eq i32 %388, %390
  br i1 %391, label %425, label %392

392:                                              ; preds = %385
  br label %393

393:                                              ; preds = %392
  br label %394

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

403:                                              ; preds = %394
  %404 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %405 = getelementptr inbounds %struct.s2n_debug_info, ptr %404, i32 0, i32 0
  %406 = load ptr, ptr %405, align 8, !tbaa !16
  %407 = getelementptr inbounds i8, ptr %406, i64 21
  %408 = call ptr @strrchr(ptr noundef %407, i32 noundef 47) #8
  %409 = getelementptr inbounds i8, ptr %408, i64 1
  br label %415

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

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

421:                                              ; preds = %415
  br label %422

422:                                              ; preds = %421
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %21, align 4
  br label %441

423:                                              ; No predecessors!
  br label %424

424:                                              ; preds = %423
  br label %425

425:                                              ; preds = %424, %385
  br label %426

426:                                              ; preds = %425
  br label %427

427:                                              ; preds = %426
  %428 = load i16, ptr %15, align 2, !tbaa !12
  %429 = zext i16 %428 to i32
  %430 = add nsw i32 %429, 2
  %431 = load i16, ptr %16, align 2, !tbaa !12
  %432 = zext i16 %431 to i32
  %433 = add nsw i32 %430, %432
  %434 = add nsw i32 %433, 2
  %435 = load i16, ptr %17, align 2, !tbaa !12
  %436 = zext i16 %435 to i32
  %437 = add nsw i32 %434, %436
  %438 = add nsw i32 %437, 2
  %439 = load ptr, ptr %7, align 8, !tbaa !5
  %440 = getelementptr inbounds %struct.s2n_blob, ptr %439, i32 0, i32 1
  store i32 %438, ptr %440, align 8, !tbaa !20
  store i32 0, ptr %4, align 4
  store i32 1, ptr %21, align 4
  br label %441

441:                                              ; preds = %427, %422, %379, %338, %327, %284, %243, %232, %189, %148, %137
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 2, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 2, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 2, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  br label %442

442:                                              ; preds = %441, %74, %50, %26
  %443 = load i32, ptr %4, align 4
  ret i32 %443
}

declare i32 @s2n_stuffer_validate(ptr noundef) #3

; Function Attrs: nounwind uwtable
declare hidden ptr @s2n_get_p_dh_param(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden ptr @s2n_get_g_dh_param(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden ptr @s2n_get_Ys_dh_param(ptr noundef) #0

declare i32 @BN_num_bits(ptr noundef) #3

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

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

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

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { nounwind willreturn memory(read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { inlinehint nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nocallback nofree nosync nounwind willreturn memory(none) }
attributes #6 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #7 = { nounwind }
attributes #8 = { nounwind willreturn memory(read) }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !11, i64 0}
!10 = !{!"", !11, i64 0}
!11 = !{!"int", !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"short", !7, i64 0}
!14 = !{!15, !6, i64 0}
!15 = !{!"s2n_blob", !6, i64 0, !11, i64 8, !11, i64 12, !11, i64 16}
!16 = !{!17, !6, i64 0}
!17 = !{!"s2n_debug_info", !6, i64 0, !6, i64 8}
!18 = !{!17, !6, i64 8}
!19 = !{!11, !11, i64 0}
!20 = !{!15, !11, i64 8}


; 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.6 = external hidden unnamed_addr constant [87 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [87 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [87 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [87 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [87 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [87 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [87 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local i32 @s2n_check_all_dh_params(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: inlinehint nounwind uwtable
declare hidden zeroext i1 @s2n_result_is_ok(i32) local_unnamed_addr #4

declare i32 @s2n_blob_validate(ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
define dso_local range(i32 -1, 1) i32 @s2n_dh_params_to_p_g_Ys(ptr noundef %0, ptr noundef %1, ptr noundef %2) local_unnamed_addr #0 {
  %4 = tail call i32 @s2n_check_all_dh_params(ptr noundef %0)
  %5 = icmp sgt i32 %4, -1
  br i1 %5, label %6, label %119

6:                                                ; preds = %3
  %7 = tail call i32 @s2n_stuffer_validate(ptr noundef %1) #5
  %8 = tail call zeroext i1 @s2n_result_is_ok(i32 %7)
  %not. = xor i1 %8, true
  %. = sext i1 %not. to i32
  %9 = tail call zeroext i1 @s2n_result_is_ok(i32 %.)
  br i1 %9, label %10, label %119

10:                                               ; preds = %6
  %11 = tail call i32 @s2n_blob_validate(ptr noundef %2) #5
  %12 = tail call zeroext i1 @s2n_result_is_ok(i32 %11)
  %not.67 = xor i1 %12, true
  %.66 = sext i1 %not.67 to i32
  %13 = tail call zeroext i1 @s2n_result_is_ok(i32 %.66)
  br i1 %13, label %14, label %119

14:                                               ; preds = %10
  %15 = tail call ptr @s2n_get_p_dh_param(ptr noundef %0)
  %16 = tail call ptr @s2n_get_g_dh_param(ptr noundef %0)
  %17 = tail call ptr @s2n_get_Ys_dh_param(ptr noundef %0)
  %18 = tail call i32 @BN_num_bits(ptr noundef %15) #5
  %19 = add nsw i32 %18, 7
  %20 = sdiv i32 %19, 8
  %21 = tail call i32 @BN_num_bits(ptr noundef %16) #5
  %22 = add nsw i32 %21, 7
  %23 = sdiv i32 %22, 8
  %24 = trunc i32 %23 to i16
  %25 = tail call i32 @BN_num_bits(ptr noundef %17) #5
  %26 = add nsw i32 %25, 7
  %27 = sdiv i32 %26, 8
  %28 = trunc i32 %27 to i16
  %29 = tail call ptr @s2n_stuffer_raw_write(ptr noundef %1, i32 noundef 0) #5
  store ptr %29, ptr %2, align 8, !tbaa !5
  %.not = icmp eq ptr %29, null
  br i1 %.not, label %30, label %38

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

38:                                               ; preds = %14
  %39 = trunc i32 %20 to i16
  %40 = tail call i32 @s2n_stuffer_write_uint16(ptr noundef %1, i16 noundef zeroext %39) #5
  %41 = icmp sgt i32 %40, -1
  br i1 %41, label %42, label %119

42:                                               ; preds = %38
  %43 = and i32 %20, 65535
  %44 = tail call ptr @s2n_stuffer_raw_write(ptr noundef %1, i32 noundef %43) #5
  %.not57 = icmp eq ptr %44, null
  br i1 %.not57, label %45, label %53

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

53:                                               ; preds = %42
  %54 = tail call i32 @BN_bn2bin(ptr noundef %15, ptr noundef nonnull %44) #5
  %55 = icmp eq i32 %54, %43
  br i1 %55, label %64, label %56

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

64:                                               ; preds = %53
  %65 = tail call i32 @s2n_stuffer_write_uint16(ptr noundef %1, i16 noundef zeroext %24) #5
  %66 = icmp sgt i32 %65, -1
  br i1 %66, label %67, label %119

67:                                               ; preds = %64
  %68 = and i32 %23, 65535
  %69 = tail call ptr @s2n_stuffer_raw_write(ptr noundef %1, i32 noundef %68) #5
  %.not60 = icmp eq ptr %69, null
  br i1 %.not60, label %70, label %78

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

78:                                               ; preds = %67
  %79 = tail call i32 @BN_bn2bin(ptr noundef %16, ptr noundef nonnull %69) #5
  %80 = icmp eq i32 %79, %68
  br i1 %80, label %89, label %81

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

89:                                               ; preds = %78
  %90 = tail call i32 @s2n_stuffer_write_uint16(ptr noundef %1, i16 noundef zeroext %28) #5
  %91 = icmp sgt i32 %90, -1
  br i1 %91, label %92, label %119

92:                                               ; preds = %89
  %93 = and i32 %27, 65535
  %94 = tail call ptr @s2n_stuffer_raw_write(ptr noundef %1, i32 noundef %93) #5
  %.not63 = icmp eq ptr %94, null
  br i1 %.not63, label %95, label %103

95:                                               ; preds = %92
  %96 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr @.str.11, ptr %96, align 8, !tbaa !11
  %97 = tail call ptr @strrchr(ptr noundef nonnull dereferenceable(1) getelementptr inbounds (i8, ptr @.str.11, i64 21), i32 noundef 47) #6
  %.not64 = icmp eq ptr %97, null
  %98 = getelementptr inbounds i8, ptr %97, i64 1
  %99 = select i1 %.not64, ptr getelementptr inbounds (i8, ptr @.str.11, i64 21), ptr %98
  %100 = getelementptr inbounds i8, ptr %96, i64 8
  store ptr %99, ptr %100, align 8, !tbaa !13
  %101 = tail call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %101, align 4, !tbaa !14
  %102 = tail call i32 @s2n_calculate_stacktrace() #5
  br label %119

103:                                              ; preds = %92
  %104 = tail call i32 @BN_bn2bin(ptr noundef %17, ptr noundef nonnull %94) #5
  %105 = icmp eq i32 %104, %93
  br i1 %105, label %114, label %106

106:                                              ; preds = %103
  %107 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr @.str.12, ptr %107, align 8, !tbaa !11
  %108 = tail call ptr @strrchr(ptr noundef nonnull dereferenceable(1) getelementptr inbounds (i8, ptr @.str.12, i64 21), i32 noundef 47) #6
  %.not65 = icmp eq ptr %108, null
  %109 = getelementptr inbounds i8, ptr %108, i64 1
  %110 = select i1 %.not65, ptr getelementptr inbounds (i8, ptr @.str.12, i64 21), ptr %109
  %111 = getelementptr inbounds i8, ptr %107, i64 8
  store ptr %110, ptr %111, align 8, !tbaa !13
  %112 = tail call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 335544328, ptr %112, align 4, !tbaa !14
  %113 = tail call i32 @s2n_calculate_stacktrace() #5
  br label %119

114:                                              ; preds = %103
  %115 = add nuw nsw i32 %43, 6
  %116 = add nuw nsw i32 %115, %68
  %117 = add nuw nsw i32 %116, %93
  %118 = getelementptr inbounds i8, ptr %2, i64 8
  store i32 %117, ptr %118, align 8, !tbaa !15
  br label %119

119:                                              ; preds = %30, %45, %56, %70, %81, %95, %106, %114, %38, %64, %89, %10, %6, %3
  %.1 = phi i32 [ -1, %3 ], [ -1, %6 ], [ -1, %10 ], [ 0, %114 ], [ -1, %106 ], [ -1, %95 ], [ -1, %81 ], [ -1, %70 ], [ -1, %56 ], [ -1, %45 ], [ -1, %30 ], [ -1, %38 ], [ -1, %64 ], [ -1, %89 ]
  ret i32 %.1
}

declare i32 @s2n_stuffer_validate(ptr noundef) local_unnamed_addr #3

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

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

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

declare i32 @BN_num_bits(ptr noundef) local_unnamed_addr #3

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

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

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

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { inlinehint nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }
attributes #6 = { nounwind willreturn memory(read) }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 0}
!6 = !{!"s2n_blob", !7, i64 0, !10, i64 8, !10, i64 12, !10, i64 16}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!12, !7, i64 0}
!12 = !{!"s2n_debug_info", !7, i64 0, !7, i64 8}
!13 = !{!12, !7, i64 8}
!14 = !{!10, !10, i64 0}
!15 = !{!6, !10, i64 8}


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