; LLVM IR from aws/s2n-tls :: tests/testlib (s2n_kem_fuzz_testlib)

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

@_s2n_debug_info = external thread_local global %struct.s2n_debug_info, align 8
@s2n_errno = external thread_local global i32, align 4
@.str.11 = external hidden unnamed_addr constant [106 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [106 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [106 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [107 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [107 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [107 x i8], align 1

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

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

declare i32 @s2n_calculate_stacktrace() #2

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

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

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

declare i32 @s2n_stuffer_free(ptr noundef) #2

declare i32 @s2n_stuffer_alloc(ptr noundef, i32 noundef) #2

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

declare zeroext i1 @s2n_pq_is_enabled() #2

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

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

15:                                               ; preds = %12
  br label %16

16:                                               ; preds = %15
  br label %17

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

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

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

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

44:                                               ; preds = %38
  store i32 -1, ptr %4, align 4
  br label %292

45:                                               ; No predecessors!
  br label %46

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

47:                                               ; preds = %46
  br label %48

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

51:                                               ; preds = %48
  br label %52

52:                                               ; preds = %51
  br label %53

53:                                               ; preds = %52
  %54 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %55 = getelementptr inbounds %struct.s2n_debug_info, ptr %54, i32 0, i32 0
  store ptr @.str.12, ptr %55, align 8, !tbaa !11
  %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
  %58 = load ptr, ptr %57, align 8, !tbaa !11
  %59 = getelementptr inbounds i8, ptr %58, i64 21
  %60 = call ptr @strrchr(ptr noundef %59, i32 noundef 47) #6
  %61 = icmp ne ptr %60, null
  br i1 %61, label %62, label %69

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

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

74:                                               ; preds = %69, %62
  %75 = phi ptr [ %68, %62 ], [ %73, %69 ]
  %76 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %77 = getelementptr inbounds %struct.s2n_debug_info, ptr %76, i32 0, i32 1
  store ptr %75, ptr %77, align 8, !tbaa !13
  %78 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %78, align 4, !tbaa !14
  %79 = call i32 @s2n_calculate_stacktrace()
  br label %80

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

81:                                               ; No predecessors!
  br label %82

82:                                               ; preds = %81, %48
  br label %83

83:                                               ; preds = %82
  br label %84

84:                                               ; preds = %83
  %85 = load ptr, ptr %7, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.s2n_kem_params, ptr %85, i32 0, i32 0
  %87 = load ptr, ptr %86, align 8, !tbaa !16
  %88 = icmp ne ptr %87, null
  br i1 %88, label %120, label %89

89:                                               ; preds = %84
  br label %90

90:                                               ; preds = %89
  br label %91

91:                                               ; preds = %90
  %92 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %93 = getelementptr inbounds %struct.s2n_debug_info, ptr %92, i32 0, i32 0
  store ptr @.str.13, ptr %93, align 8, !tbaa !11
  %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 0
  %96 = load ptr, ptr %95, align 8, !tbaa !11
  %97 = getelementptr inbounds i8, ptr %96, i64 21
  %98 = call ptr @strrchr(ptr noundef %97, i32 noundef 47) #6
  %99 = icmp ne ptr %98, null
  br i1 %99, label %100, label %107

100:                                              ; preds = %91
  %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 !11
  %104 = getelementptr inbounds i8, ptr %103, i64 21
  %105 = call ptr @strrchr(ptr noundef %104, i32 noundef 47) #6
  %106 = getelementptr inbounds i8, ptr %105, i64 1
  br label %112

107:                                              ; preds = %91
  %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 !11
  %111 = getelementptr inbounds i8, ptr %110, i64 21
  br label %112

112:                                              ; preds = %107, %100
  %113 = phi ptr [ %106, %100 ], [ %111, %107 ]
  %114 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %115 = getelementptr inbounds %struct.s2n_debug_info, ptr %114, i32 0, i32 1
  store ptr %113, ptr %115, align 8, !tbaa !13
  %116 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %116, align 4, !tbaa !14
  %117 = call i32 @s2n_calculate_stacktrace()
  br label %118

118:                                              ; preds = %112
  store i32 -1, ptr %4, align 4
  br label %292

119:                                              ; No predecessors!
  br label %120

120:                                              ; preds = %119, %84
  br label %121

121:                                              ; preds = %120
  call void @llvm.lifetime.start.p0(i64 40, ptr %8) #7
  call void @llvm.memset.p0.i64(ptr align 8 %8, i8 0, i64 40, i1 false)
  br label %122

122:                                              ; preds = %121
  %123 = load i64, ptr %6, align 8, !tbaa !9
  %124 = trunc i64 %123 to i32
  %125 = call i32 @s2n_stuffer_alloc(ptr noundef %8, i32 noundef %124)
  %126 = icmp sgt i32 %125, -1
  br i1 %126, label %128, label %127

127:                                              ; preds = %122
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %290

128:                                              ; preds = %122
  br label %129

129:                                              ; preds = %128
  br label %130

130:                                              ; preds = %129
  br label %131

131:                                              ; preds = %130
  %132 = load ptr, ptr %5, align 8, !tbaa !5
  %133 = load i64, ptr %6, align 8, !tbaa !9
  %134 = trunc i64 %133 to i32
  %135 = call i32 @s2n_stuffer_write_bytes(ptr noundef %8, ptr noundef %132, i32 noundef %134)
  %136 = icmp sgt i32 %135, -1
  br i1 %136, label %138, label %137

137:                                              ; preds = %131
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %290

138:                                              ; preds = %131
  br label %139

139:                                              ; preds = %138
  br label %140

140:                                              ; preds = %139
  %141 = load ptr, ptr %7, align 8, !tbaa !5
  %142 = call i32 @s2n_kem_recv_public_key(ptr noundef %8, ptr noundef %141)
  %143 = icmp eq i32 %142, 0
  br i1 %143, label %144, label %281

144:                                              ; preds = %140
  call void @llvm.lifetime.start.p0(i64 40, ptr %10) #7
  call void @llvm.memset.p0.i64(ptr align 8 %10, i8 0, i64 40, i1 false)
  br label %145

145:                                              ; preds = %144
  %146 = call i32 @s2n_stuffer_growable_alloc(ptr noundef %10, i32 noundef 8192)
  %147 = icmp sgt i32 %146, -1
  br i1 %147, label %149, label %148

148:                                              ; preds = %145
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %277

149:                                              ; preds = %145
  br label %150

150:                                              ; preds = %149
  br label %151

151:                                              ; preds = %150
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  %152 = load ptr, ptr %7, align 8, !tbaa !5
  %153 = call i32 @s2n_kem_send_ciphertext(ptr noundef %10, ptr noundef %152)
  store i32 %153, ptr %11, align 4, !tbaa !14
  %154 = call zeroext i1 @s2n_pq_is_enabled()
  br i1 %154, label %155, label %195

155:                                              ; preds = %151
  br label %156

156:                                              ; preds = %155
  %157 = load i32, ptr %11, align 4, !tbaa !14
  %158 = icmp eq i32 %157, 0
  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.14, ptr %163, align 8, !tbaa !11
  %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 !11
  %167 = getelementptr inbounds i8, ptr %166, i64 21
  %168 = call ptr @strrchr(ptr noundef %167, i32 noundef 47) #6
  %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 !11
  %174 = getelementptr inbounds i8, ptr %173, i64 21
  %175 = call ptr @strrchr(ptr noundef %174, i32 noundef 47) #6
  %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 !11
  %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 !13
  %186 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653194, ptr %186, align 4, !tbaa !14
  %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 %9, align 4
  br label %276

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 %275

195:                                              ; preds = %151
  br label %196

196:                                              ; preds = %195
  %197 = load i32, ptr %11, align 4, !tbaa !14
  %198 = icmp ne i32 %197, 0
  br i1 %198, label %232, label %199

199:                                              ; preds = %196
  br label %200

200:                                              ; preds = %199
  br label %201

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

210:                                              ; preds = %201
  %211 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %212 = getelementptr inbounds %struct.s2n_debug_info, ptr %211, i32 0, i32 0
  %213 = load ptr, ptr %212, align 8, !tbaa !11
  %214 = getelementptr inbounds i8, ptr %213, i64 21
  %215 = call ptr @strrchr(ptr noundef %214, i32 noundef 47) #6
  %216 = getelementptr inbounds i8, ptr %215, i64 1
  br label %222

217:                                              ; preds = %201
  %218 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %219 = getelementptr inbounds %struct.s2n_debug_info, ptr %218, i32 0, i32 0
  %220 = load ptr, ptr %219, align 8, !tbaa !11
  %221 = getelementptr inbounds i8, ptr %220, i64 21
  br label %222

222:                                              ; preds = %217, %210
  %223 = phi ptr [ %216, %210 ], [ %221, %217 ]
  %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 1
  store ptr %223, ptr %225, align 8, !tbaa !13
  %226 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653194, ptr %226, align 4, !tbaa !14
  %227 = call i32 @s2n_calculate_stacktrace()
  br label %228

228:                                              ; preds = %222
  br label %229

229:                                              ; preds = %228
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %276

230:                                              ; No predecessors!
  br label %231

231:                                              ; preds = %230
  br label %232

232:                                              ; preds = %231, %196
  br label %233

233:                                              ; preds = %232
  br label %234

234:                                              ; preds = %233
  br label %235

235:                                              ; preds = %234
  %236 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  %237 = load i32, ptr %236, align 4, !tbaa !14
  %238 = icmp eq i32 %237, 402653260
  br i1 %238, label %272, label %239

239:                                              ; preds = %235
  br label %240

240:                                              ; preds = %239
  br label %241

241:                                              ; preds = %240
  %242 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %243 = getelementptr inbounds %struct.s2n_debug_info, ptr %242, i32 0, i32 0
  store ptr @.str.16, ptr %243, align 8, !tbaa !11
  %244 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %245 = getelementptr inbounds %struct.s2n_debug_info, ptr %244, i32 0, i32 0
  %246 = load ptr, ptr %245, align 8, !tbaa !11
  %247 = getelementptr inbounds i8, ptr %246, i64 21
  %248 = call ptr @strrchr(ptr noundef %247, i32 noundef 47) #6
  %249 = icmp ne ptr %248, null
  br i1 %249, label %250, label %257

250:                                              ; preds = %241
  %251 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %252 = getelementptr inbounds %struct.s2n_debug_info, ptr %251, i32 0, i32 0
  %253 = load ptr, ptr %252, align 8, !tbaa !11
  %254 = getelementptr inbounds i8, ptr %253, i64 21
  %255 = call ptr @strrchr(ptr noundef %254, i32 noundef 47) #6
  %256 = getelementptr inbounds i8, ptr %255, i64 1
  br label %262

257:                                              ; preds = %241
  %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
  %260 = load ptr, ptr %259, align 8, !tbaa !11
  %261 = getelementptr inbounds i8, ptr %260, i64 21
  br label %262

262:                                              ; preds = %257, %250
  %263 = phi ptr [ %256, %250 ], [ %261, %257 ]
  %264 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %265 = getelementptr inbounds %struct.s2n_debug_info, ptr %264, i32 0, i32 1
  store ptr %263, ptr %265, align 8, !tbaa !13
  %266 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653194, ptr %266, align 4, !tbaa !14
  %267 = call i32 @s2n_calculate_stacktrace()
  br label %268

268:                                              ; preds = %262
  br label %269

269:                                              ; preds = %268
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %276

270:                                              ; No predecessors!
  br label %271

271:                                              ; preds = %270
  br label %272

272:                                              ; preds = %271, %235
  br label %273

273:                                              ; preds = %272
  br label %274

274:                                              ; preds = %273
  br label %275

275:                                              ; preds = %274, %194
  store i32 0, ptr %9, align 4
  br label %276

276:                                              ; preds = %275, %269, %229, %189
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %277

277:                                              ; preds = %276, %148
  %278 = call i32 @s2n_stuffer_free(ptr noundef %10)
  call void @llvm.lifetime.end.p0(i64 40, ptr %10) #7
  %279 = load i32, ptr %9, align 4
  switch i32 %279, label %290 [
    i32 0, label %280
  ]

280:                                              ; preds = %277
  br label %281

281:                                              ; preds = %280, %140
  br label %282

282:                                              ; preds = %281
  %283 = load ptr, ptr %7, align 8, !tbaa !5
  %284 = call i32 @s2n_kem_free(ptr noundef %283)
  %285 = icmp sgt i32 %284, -1
  br i1 %285, label %287, label %286

286:                                              ; preds = %282
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %290

287:                                              ; preds = %282
  br label %288

288:                                              ; preds = %287
  br label %289

289:                                              ; preds = %288
  store i32 0, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %290

290:                                              ; preds = %289, %286, %277, %137, %127
  %291 = call i32 @s2n_stuffer_free(ptr noundef %8)
  call void @llvm.lifetime.end.p0(i64 40, ptr %8) #7
  br label %292

292:                                              ; preds = %290, %118, %80, %44
  %293 = load i32, ptr %4, align 4
  ret i32 %293
}

declare i32 @s2n_kem_recv_public_key(ptr noundef, ptr noundef) #2

declare i32 @s2n_stuffer_growable_alloc(ptr noundef, i32 noundef) #2

declare i32 @s2n_kem_send_ciphertext(ptr noundef, ptr noundef) #2

declare i32 @s2n_kem_free(ptr noundef) #2

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

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

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


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.s2n_debug_info = type { ptr, ptr }
%struct.s2n_stuffer = type { %struct.s2n_blob, i32, i32, i32, i8 }
%struct.s2n_blob = type { ptr, i32, i32, i8 }

@_s2n_debug_info = external thread_local local_unnamed_addr global %struct.s2n_debug_info, align 8
@s2n_errno = external thread_local local_unnamed_addr global i32, align 4
@.str.11 = external hidden unnamed_addr constant [106 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [106 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [106 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [107 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [107 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [107 x i8], align 1

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

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

declare i32 @s2n_calculate_stacktrace() local_unnamed_addr #2

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

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

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

declare i32 @s2n_stuffer_free(ptr noundef) local_unnamed_addr #2

declare i32 @s2n_stuffer_alloc(ptr noundef, i32 noundef) local_unnamed_addr #2

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

declare zeroext i1 @s2n_pq_is_enabled() local_unnamed_addr #2

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

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

14:                                               ; preds = %3
  %.not22 = icmp eq ptr %2, null
  br i1 %.not22, label %15, label %23

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

23:                                               ; preds = %14
  %24 = load ptr, ptr %2, align 8, !tbaa !13
  %.not24 = icmp eq ptr %24, null
  br i1 %.not24, label %25, label %33

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

33:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %4) #7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(40) %4, i8 0, i64 40, i1 false)
  %34 = trunc i64 %1 to i32
  %35 = call i32 @s2n_stuffer_alloc(ptr noundef nonnull %4, i32 noundef %34) #7
  %36 = icmp sgt i32 %35, -1
  br i1 %36, label %37, label %82

37:                                               ; preds = %33
  %38 = call i32 @s2n_stuffer_write_bytes(ptr noundef nonnull %4, ptr noundef nonnull %0, i32 noundef %34) #7
  %39 = icmp sgt i32 %38, -1
  br i1 %39, label %40, label %82

40:                                               ; preds = %37
  %41 = call i32 @s2n_kem_recv_public_key(ptr noundef nonnull %4, ptr noundef nonnull %2) #7
  %42 = icmp eq i32 %41, 0
  br i1 %42, label %43, label %78

43:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %5) #7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(40) %5, i8 0, i64 40, i1 false)
  %44 = call i32 @s2n_stuffer_growable_alloc(ptr noundef nonnull %5, i32 noundef 8192) #7
  %45 = icmp sgt i32 %44, -1
  br i1 %45, label %46, label %.critedge

46:                                               ; preds = %43
  %47 = call i32 @s2n_kem_send_ciphertext(ptr noundef nonnull %5, ptr noundef nonnull %2) #7
  %48 = call zeroext i1 @s2n_pq_is_enabled() #7
  %49 = icmp eq i32 %47, 0
  br i1 %48, label %50, label %58

50:                                               ; preds = %46
  br i1 %49, label %76, label %51

51:                                               ; preds = %50
  %52 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr @.str.14, ptr %52, align 8, !tbaa !5
  %53 = call ptr @strrchr(ptr noundef nonnull dereferenceable(1) getelementptr inbounds (i8, ptr @.str.14, i64 21), i32 noundef 47) #6
  %.not29 = icmp eq ptr %53, null
  %54 = getelementptr inbounds i8, ptr %53, i64 1
  %55 = select i1 %.not29, ptr getelementptr inbounds (i8, ptr @.str.14, i64 21), ptr %54
  %56 = getelementptr inbounds i8, ptr %52, i64 8
  store ptr %55, ptr %56, align 8, !tbaa !10
  %57 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  br label %.critedge.sink.split

58:                                               ; preds = %46
  br i1 %49, label %59, label %66

59:                                               ; preds = %58
  %60 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr @.str.15, ptr %60, align 8, !tbaa !5
  %61 = call ptr @strrchr(ptr noundef nonnull dereferenceable(1) getelementptr inbounds (i8, ptr @.str.15, i64 21), i32 noundef 47) #6
  %.not27 = icmp eq ptr %61, null
  %62 = getelementptr inbounds i8, ptr %61, i64 1
  %63 = select i1 %.not27, ptr getelementptr inbounds (i8, ptr @.str.15, i64 21), ptr %62
  %64 = getelementptr inbounds i8, ptr %60, i64 8
  store ptr %63, ptr %64, align 8, !tbaa !10
  %65 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  br label %.critedge.sink.split

66:                                               ; preds = %58
  %67 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  %68 = load i32, ptr %67, align 4, !tbaa !11
  %69 = icmp eq i32 %68, 402653260
  br i1 %69, label %76, label %70

70:                                               ; preds = %66
  %71 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr @.str.16, ptr %71, align 8, !tbaa !5
  %72 = call ptr @strrchr(ptr noundef nonnull dereferenceable(1) getelementptr inbounds (i8, ptr @.str.16, i64 21), i32 noundef 47) #6
  %.not28 = icmp eq ptr %72, null
  %73 = getelementptr inbounds i8, ptr %72, i64 1
  %74 = select i1 %.not28, ptr getelementptr inbounds (i8, ptr @.str.16, i64 21), ptr %73
  %75 = getelementptr inbounds i8, ptr %71, i64 8
  store ptr %74, ptr %75, align 8, !tbaa !10
  br label %.critedge.sink.split

76:                                               ; preds = %66, %50
  %77 = call i32 @s2n_stuffer_free(ptr noundef nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %5) #7
  br label %78

78:                                               ; preds = %76, %40
  %79 = call i32 @s2n_kem_free(ptr noundef nonnull %2) #7
  %.lobit = ashr i32 %79, 31
  br label %82

.critedge.sink.split:                             ; preds = %51, %70, %59
  %.sink = phi ptr [ %65, %59 ], [ %67, %70 ], [ %57, %51 ]
  store i32 402653194, ptr %.sink, align 4, !tbaa !11
  %80 = call i32 @s2n_calculate_stacktrace() #7
  br label %.critedge

.critedge:                                        ; preds = %.critedge.sink.split, %43
  %81 = call i32 @s2n_stuffer_free(ptr noundef nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %5) #7
  br label %82

82:                                               ; preds = %78, %.critedge, %37, %33
  %.2 = phi i32 [ -1, %33 ], [ -1, %37 ], [ -1, %.critedge ], [ %.lobit, %78 ]
  %83 = call i32 @s2n_stuffer_free(ptr noundef nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %4) #7
  br label %84

84:                                               ; preds = %82, %25, %15, %6
  %.3 = phi i32 [ %.2, %82 ], [ -1, %25 ], [ -1, %15 ], [ -1, %6 ]
  ret i32 %.3
}

declare i32 @s2n_kem_recv_public_key(ptr noundef, ptr noundef) local_unnamed_addr #2

declare i32 @s2n_stuffer_growable_alloc(ptr noundef, i32 noundef) local_unnamed_addr #2

declare i32 @s2n_kem_send_ciphertext(ptr noundef, ptr noundef) local_unnamed_addr #2

declare i32 @s2n_kem_free(ptr noundef) local_unnamed_addr #2

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

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

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


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