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

; 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.msghdr = type { ptr, i32, ptr, i64, ptr, i64, i32 }
%struct.s2n_test_ktls_io_stuffer = type { %struct.s2n_stuffer, %struct.s2n_stuffer, i64, i64 }
%struct.s2n_stuffer = type { %struct.s2n_blob, i32, i32, i32, i8 }
%struct.s2n_blob = type { ptr, i32, i32, i8 }
%struct.iovec = type { ptr, i64 }

@_s2n_debug_info = external thread_local global %struct.s2n_debug_info, align 8
@s2n_errno = external thread_local global i32, align 4
@.str.3 = external hidden unnamed_addr constant [105 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [105 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [105 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [106 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [106 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [106 x i8], align 1

; Function Attrs: nounwind willreturn memory(none)
declare ptr @__errno_location() #0

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

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

declare i32 @s2n_calculate_stacktrace() #3

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

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

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

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

22:                                               ; preds = %2
  %23 = load ptr, ptr %5, align 8, !tbaa !5
  %24 = icmp ne ptr %23, null
  br i1 %24, label %56, label %25

25:                                               ; preds = %22
  br label %26

26:                                               ; preds = %25
  br label %27

27:                                               ; preds = %26
  %28 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %29 = getelementptr inbounds %struct.s2n_debug_info, ptr %28, i32 0, i32 0
  store ptr @.str.3, ptr %29, align 8, !tbaa !11
  %30 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %31 = getelementptr inbounds %struct.s2n_debug_info, ptr %30, i32 0, i32 0
  %32 = load ptr, ptr %31, align 8, !tbaa !11
  %33 = getelementptr inbounds i8, ptr %32, i64 21
  %34 = call ptr @strrchr(ptr noundef %33, i32 noundef 47) #8
  %35 = icmp ne ptr %34, null
  br i1 %35, label %36, label %43

36:                                               ; preds = %27
  %37 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %38 = getelementptr inbounds %struct.s2n_debug_info, ptr %37, i32 0, i32 0
  %39 = load ptr, ptr %38, align 8, !tbaa !11
  %40 = getelementptr inbounds i8, ptr %39, i64 21
  %41 = call ptr @strrchr(ptr noundef %40, i32 noundef 47) #8
  %42 = getelementptr inbounds i8, ptr %41, i64 1
  br label %48

43:                                               ; preds = %27
  %44 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %45 = getelementptr inbounds %struct.s2n_debug_info, ptr %44, i32 0, i32 0
  %46 = load ptr, ptr %45, align 8, !tbaa !11
  %47 = getelementptr inbounds i8, ptr %46, i64 21
  br label %48

48:                                               ; preds = %43, %36
  %49 = phi ptr [ %42, %36 ], [ %47, %43 ]
  %50 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %51 = getelementptr inbounds %struct.s2n_debug_info, ptr %50, i32 0, i32 1
  store ptr %49, ptr %51, align 8, !tbaa !13
  %52 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %52, align 4, !tbaa !9
  %53 = call i32 @s2n_calculate_stacktrace()
  br label %54

54:                                               ; preds = %48
  store i64 -1, ptr %3, align 8
  br label %418

55:                                               ; No predecessors!
  br label %56

56:                                               ; preds = %55, %22
  br label %57

57:                                               ; preds = %56
  br label %58

58:                                               ; preds = %57
  %59 = load ptr, ptr %5, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.msghdr, ptr %59, i32 0, i32 2
  %61 = load ptr, ptr %60, align 8, !tbaa !14
  %62 = icmp ne ptr %61, null
  br i1 %62, label %94, label %63

63:                                               ; preds = %58
  br label %64

64:                                               ; preds = %63
  br label %65

65:                                               ; preds = %64
  %66 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %67 = getelementptr inbounds %struct.s2n_debug_info, ptr %66, i32 0, i32 0
  store ptr @.str.4, ptr %67, align 8, !tbaa !11
  %68 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %69 = getelementptr inbounds %struct.s2n_debug_info, ptr %68, i32 0, i32 0
  %70 = load ptr, ptr %69, align 8, !tbaa !11
  %71 = getelementptr inbounds i8, ptr %70, i64 21
  %72 = call ptr @strrchr(ptr noundef %71, i32 noundef 47) #8
  %73 = icmp ne ptr %72, null
  br i1 %73, label %74, label %81

74:                                               ; preds = %65
  %75 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %76 = getelementptr inbounds %struct.s2n_debug_info, ptr %75, i32 0, i32 0
  %77 = load ptr, ptr %76, align 8, !tbaa !11
  %78 = getelementptr inbounds i8, ptr %77, i64 21
  %79 = call ptr @strrchr(ptr noundef %78, i32 noundef 47) #8
  %80 = getelementptr inbounds i8, ptr %79, i64 1
  br label %86

81:                                               ; preds = %65
  %82 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %83 = getelementptr inbounds %struct.s2n_debug_info, ptr %82, i32 0, i32 0
  %84 = load ptr, ptr %83, align 8, !tbaa !11
  %85 = getelementptr inbounds i8, ptr %84, i64 21
  br label %86

86:                                               ; preds = %81, %74
  %87 = phi ptr [ %80, %74 ], [ %85, %81 ]
  %88 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %89 = getelementptr inbounds %struct.s2n_debug_info, ptr %88, i32 0, i32 1
  store ptr %87, ptr %89, align 8, !tbaa !13
  %90 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %90, align 4, !tbaa !9
  %91 = call i32 @s2n_calculate_stacktrace()
  br label %92

92:                                               ; preds = %86
  store i64 -1, ptr %3, align 8
  br label %418

93:                                               ; No predecessors!
  br label %94

94:                                               ; preds = %93, %58
  br label %95

95:                                               ; preds = %94
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #9
  %96 = load ptr, ptr %4, align 8, !tbaa !5
  store ptr %96, ptr %6, align 8, !tbaa !5
  br label %97

97:                                               ; preds = %95
  %98 = load ptr, ptr %6, align 8, !tbaa !5
  %99 = icmp ne ptr %98, null
  br i1 %99, label %133, label %100

100:                                              ; preds = %97
  br label %101

101:                                              ; preds = %100
  br label %102

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

111:                                              ; preds = %102
  %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 !11
  %115 = getelementptr inbounds i8, ptr %114, i64 21
  %116 = call ptr @strrchr(ptr noundef %115, i32 noundef 47) #8
  %117 = getelementptr inbounds i8, ptr %116, i64 1
  br label %123

118:                                              ; preds = %102
  %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 !11
  %122 = getelementptr inbounds i8, ptr %121, i64 21
  br label %123

123:                                              ; preds = %118, %111
  %124 = phi ptr [ %117, %111 ], [ %122, %118 ]
  %125 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %126 = getelementptr inbounds %struct.s2n_debug_info, ptr %125, i32 0, i32 1
  store ptr %124, ptr %126, align 8, !tbaa !13
  %127 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %127, align 4, !tbaa !9
  %128 = call i32 @s2n_calculate_stacktrace()
  br label %129

129:                                              ; preds = %123
  br label %130

130:                                              ; preds = %129
  store i64 -1, ptr %3, align 8
  store i32 1, ptr %7, align 4
  br label %417

131:                                              ; No predecessors!
  br label %132

132:                                              ; preds = %131
  br label %133

133:                                              ; preds = %132, %97
  br label %134

134:                                              ; preds = %133
  br label %135

135:                                              ; preds = %134
  %136 = load ptr, ptr %6, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct.s2n_test_ktls_io_stuffer, ptr %136, i32 0, i32 3
  %138 = load i64, ptr %137, align 8, !tbaa !17
  %139 = add i64 %138, 1
  store i64 %139, ptr %137, align 8, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #9
  %140 = load ptr, ptr %5, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct.msghdr, ptr %140, i32 0, i32 2
  %142 = load ptr, ptr %141, align 8, !tbaa !14
  %143 = getelementptr inbounds %struct.iovec, ptr %142, i32 0, i32 0
  %144 = load ptr, ptr %143, align 8, !tbaa !21
  store ptr %144, ptr %8, align 8, !tbaa !5
  br label %145

145:                                              ; preds = %135
  %146 = load ptr, ptr %8, align 8, !tbaa !5
  %147 = icmp ne ptr %146, null
  br i1 %147, label %181, label %148

148:                                              ; preds = %145
  br label %149

149:                                              ; preds = %148
  br label %150

150:                                              ; preds = %149
  %151 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %152 = getelementptr inbounds %struct.s2n_debug_info, ptr %151, i32 0, i32 0
  store ptr @.str.6, ptr %152, align 8, !tbaa !11
  %153 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %154 = getelementptr inbounds %struct.s2n_debug_info, ptr %153, i32 0, i32 0
  %155 = load ptr, ptr %154, align 8, !tbaa !11
  %156 = getelementptr inbounds i8, ptr %155, i64 21
  %157 = call ptr @strrchr(ptr noundef %156, i32 noundef 47) #8
  %158 = icmp ne ptr %157, null
  br i1 %158, label %159, label %166

159:                                              ; preds = %150
  %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 !11
  %163 = getelementptr inbounds i8, ptr %162, i64 21
  %164 = call ptr @strrchr(ptr noundef %163, i32 noundef 47) #8
  %165 = getelementptr inbounds i8, ptr %164, i64 1
  br label %171

166:                                              ; preds = %150
  %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 !11
  %170 = getelementptr inbounds i8, ptr %169, i64 21
  br label %171

171:                                              ; preds = %166, %159
  %172 = phi ptr [ %165, %159 ], [ %170, %166 ]
  %173 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %174 = getelementptr inbounds %struct.s2n_debug_info, ptr %173, i32 0, i32 1
  store ptr %172, ptr %174, align 8, !tbaa !13
  %175 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %175, align 4, !tbaa !9
  %176 = call i32 @s2n_calculate_stacktrace()
  br label %177

177:                                              ; preds = %171
  br label %178

178:                                              ; preds = %177
  store i64 -1, ptr %3, align 8
  store i32 1, ptr %7, align 4
  br label %416

179:                                              ; No predecessors!
  br label %180

180:                                              ; preds = %179
  br label %181

181:                                              ; preds = %180, %145
  br label %182

182:                                              ; preds = %181
  br label %183

183:                                              ; preds = %182
  %184 = load ptr, ptr %6, align 8, !tbaa !5
  %185 = getelementptr inbounds %struct.s2n_test_ktls_io_stuffer, ptr %184, i32 0, i32 0
  %186 = getelementptr inbounds %struct.s2n_stuffer, ptr %185, i32 0, i32 2
  %187 = load i32, ptr %186, align 4, !tbaa !23
  %188 = load ptr, ptr %6, align 8, !tbaa !5
  %189 = getelementptr inbounds %struct.s2n_test_ktls_io_stuffer, ptr %188, i32 0, i32 0
  %190 = getelementptr inbounds %struct.s2n_stuffer, ptr %189, i32 0, i32 1
  %191 = load i32, ptr %190, align 8, !tbaa !24
  %192 = sub i32 %187, %191
  %193 = icmp ne i32 %192, 0
  br i1 %193, label %196, label %194

194:                                              ; preds = %183
  %195 = call ptr @__errno_location() #7
  store i32 11, ptr %195, align 4, !tbaa !9
  store i64 -1, ptr %3, align 8
  store i32 1, ptr %7, align 4
  br label %416

196:                                              ; preds = %183
  br label %197

197:                                              ; preds = %196
  %198 = load ptr, ptr %5, align 8, !tbaa !5
  %199 = getelementptr inbounds %struct.msghdr, ptr %198, i32 0, i32 3
  %200 = load i64, ptr %199, align 8, !tbaa !25
  %201 = icmp eq i64 %200, 1
  br i1 %201, label %235, label %202

202:                                              ; preds = %197
  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.7, ptr %206, align 8, !tbaa !11
  %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 !11
  %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 !11
  %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 !11
  %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 !13
  %229 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653194, ptr %229, align 4, !tbaa !9
  %230 = call i32 @s2n_calculate_stacktrace()
  br label %231

231:                                              ; preds = %225
  br label %232

232:                                              ; preds = %231
  store i64 -1, ptr %3, align 8
  store i32 1, ptr %7, align 4
  br label %416

233:                                              ; No predecessors!
  br label %234

234:                                              ; preds = %233
  br label %235

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

236:                                              ; preds = %235
  br label %237

237:                                              ; preds = %236
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #9
  %238 = load ptr, ptr %5, align 8, !tbaa !5
  %239 = getelementptr inbounds %struct.msghdr, ptr %238, i32 0, i32 2
  %240 = load ptr, ptr %239, align 8, !tbaa !14
  %241 = getelementptr inbounds %struct.iovec, ptr %240, i32 0, i32 1
  %242 = load i64, ptr %241, align 8, !tbaa !26
  store i64 %242, ptr %9, align 8, !tbaa !27
  call void @llvm.lifetime.start.p0(i64 1, ptr %10) #9
  store i8 0, ptr %10, align 1, !tbaa !28
  br label %243

243:                                              ; preds = %237
  %244 = load ptr, ptr %6, align 8, !tbaa !5
  %245 = getelementptr inbounds %struct.s2n_test_ktls_io_stuffer, ptr %244, i32 0, i32 0
  %246 = call i32 @s2n_stuffer_read_uint8(ptr noundef %245, ptr noundef %10)
  %247 = icmp sgt i32 %246, -1
  br i1 %247, label %249, label %248

248:                                              ; preds = %243
  store i64 -1, ptr %3, align 8
  store i32 1, ptr %7, align 4
  br label %415

249:                                              ; preds = %243
  br label %250

250:                                              ; preds = %249
  br label %251

251:                                              ; preds = %250
  br label %252

252:                                              ; preds = %251
  %253 = load ptr, ptr %5, align 8, !tbaa !5
  %254 = load ptr, ptr %5, align 8, !tbaa !5
  %255 = getelementptr inbounds %struct.msghdr, ptr %254, i32 0, i32 4
  %256 = load ptr, ptr %255, align 8, !tbaa !29
  %257 = load ptr, ptr %5, align 8, !tbaa !5
  %258 = getelementptr inbounds %struct.msghdr, ptr %257, i32 0, i32 5
  %259 = load i64, ptr %258, align 8, !tbaa !30
  %260 = load i8, ptr %10, align 1, !tbaa !28
  %261 = call i32 @s2n_ktls_set_control_data(ptr noundef %253, ptr noundef %256, i64 noundef %259, i32 noundef 0, i8 noundef zeroext %260)
  %262 = getelementptr inbounds %struct.s2n_result, ptr %11, i32 0, i32 0
  store i32 %261, ptr %262, align 4
  %263 = getelementptr inbounds %struct.s2n_result, ptr %11, i32 0, i32 0
  %264 = load i32, ptr %263, align 4
  %265 = call zeroext i1 @s2n_result_is_ok(i32 %264)
  br i1 %265, label %267, label %266

266:                                              ; preds = %252
  store i64 -1, ptr %3, align 8
  store i32 1, ptr %7, align 4
  br label %415

267:                                              ; preds = %252
  br label %268

268:                                              ; preds = %267
  br label %269

269:                                              ; preds = %268
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #9
  store i64 0, ptr %12, align 8, !tbaa !27
  br label %270

270:                                              ; preds = %411, %269
  %271 = load i64, ptr %12, align 8, !tbaa !27
  %272 = load i64, ptr %9, align 8, !tbaa !27
  %273 = icmp ult i64 %271, %272
  br i1 %273, label %274, label %412

274:                                              ; preds = %270
  call void @llvm.lifetime.start.p0(i64 2, ptr %13) #9
  store i16 0, ptr %13, align 2, !tbaa !31
  br label %275

275:                                              ; preds = %274
  %276 = load ptr, ptr %6, align 8, !tbaa !5
  %277 = getelementptr inbounds %struct.s2n_test_ktls_io_stuffer, ptr %276, i32 0, i32 0
  %278 = call i32 @s2n_stuffer_read_uint16(ptr noundef %277, ptr noundef %13)
  %279 = icmp sgt i32 %278, -1
  br i1 %279, label %281, label %280

280:                                              ; preds = %275
  store i64 -1, ptr %3, align 8
  store i32 1, ptr %7, align 4
  br label %409

281:                                              ; preds = %275
  br label %282

282:                                              ; preds = %281
  br label %283

283:                                              ; preds = %282
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #9
  %284 = load i64, ptr %9, align 8, !tbaa !27
  %285 = load i64, ptr %12, align 8, !tbaa !27
  %286 = sub i64 %284, %285
  %287 = load i16, ptr %13, align 2, !tbaa !31
  %288 = zext i16 %287 to i64
  %289 = icmp ult i64 %286, %288
  br i1 %289, label %290, label %294

290:                                              ; preds = %283
  %291 = load i64, ptr %9, align 8, !tbaa !27
  %292 = load i64, ptr %12, align 8, !tbaa !27
  %293 = sub i64 %291, %292
  br label %297

294:                                              ; preds = %283
  %295 = load i16, ptr %13, align 2, !tbaa !31
  %296 = zext i16 %295 to i64
  br label %297

297:                                              ; preds = %294, %290
  %298 = phi i64 [ %293, %290 ], [ %296, %294 ]
  store i64 %298, ptr %14, align 8, !tbaa !27
  br label %299

299:                                              ; preds = %297
  %300 = load i64, ptr %14, align 8, !tbaa !27
  %301 = icmp ugt i64 %300, 0
  br i1 %301, label %335, label %302

302:                                              ; preds = %299
  br label %303

303:                                              ; preds = %302
  br label %304

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

313:                                              ; preds = %304
  %314 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %315 = getelementptr inbounds %struct.s2n_debug_info, ptr %314, i32 0, i32 0
  %316 = load ptr, ptr %315, align 8, !tbaa !11
  %317 = getelementptr inbounds i8, ptr %316, i64 21
  %318 = call ptr @strrchr(ptr noundef %317, i32 noundef 47) #8
  %319 = getelementptr inbounds i8, ptr %318, i64 1
  br label %325

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

325:                                              ; preds = %320, %313
  %326 = phi ptr [ %319, %313 ], [ %324, %320 ]
  %327 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %328 = getelementptr inbounds %struct.s2n_debug_info, ptr %327, i32 0, i32 1
  store ptr %326, ptr %328, align 8, !tbaa !13
  %329 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653194, ptr %329, align 4, !tbaa !9
  %330 = call i32 @s2n_calculate_stacktrace()
  br label %331

331:                                              ; preds = %325
  br label %332

332:                                              ; preds = %331
  store i64 -1, ptr %3, align 8
  store i32 1, ptr %7, align 4
  br label %408

333:                                              ; No predecessors!
  br label %334

334:                                              ; preds = %333
  br label %335

335:                                              ; preds = %334, %299
  br label %336

336:                                              ; preds = %335
  br label %337

337:                                              ; preds = %336
  br label %338

338:                                              ; preds = %337
  %339 = load ptr, ptr %6, align 8, !tbaa !5
  %340 = getelementptr inbounds %struct.s2n_test_ktls_io_stuffer, ptr %339, i32 0, i32 1
  %341 = load ptr, ptr %8, align 8, !tbaa !5
  %342 = load i64, ptr %12, align 8, !tbaa !27
  %343 = getelementptr inbounds i8, ptr %341, i64 %342
  %344 = load i64, ptr %14, align 8, !tbaa !27
  %345 = trunc i64 %344 to i32
  %346 = call i32 @s2n_stuffer_read_bytes(ptr noundef %340, ptr noundef %343, i32 noundef %345)
  %347 = icmp sgt i32 %346, -1
  br i1 %347, label %349, label %348

348:                                              ; preds = %338
  store i64 -1, ptr %3, align 8
  store i32 1, ptr %7, align 4
  br label %408

349:                                              ; preds = %338
  br label %350

350:                                              ; preds = %349
  br label %351

351:                                              ; preds = %350
  %352 = load i64, ptr %14, align 8, !tbaa !27
  %353 = load i64, ptr %12, align 8, !tbaa !27
  %354 = add i64 %353, %352
  store i64 %354, ptr %12, align 8, !tbaa !27
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #9
  %355 = load i16, ptr %13, align 2, !tbaa !31
  %356 = zext i16 %355 to i64
  %357 = load i64, ptr %14, align 8, !tbaa !27
  %358 = sub i64 %356, %357
  store i64 %358, ptr %15, align 8, !tbaa !27
  %359 = load i64, ptr %15, align 8, !tbaa !27
  %360 = icmp ne i64 %359, 0
  br i1 %360, label %361, label %375

361:                                              ; preds = %351
  br label %362

362:                                              ; preds = %361
  %363 = load ptr, ptr %6, align 8, !tbaa !5
  %364 = load i64, ptr %15, align 8, !tbaa !27
  %365 = trunc i64 %364 to i16
  %366 = call i32 @s2n_test_ktls_update_prev_header_len(ptr noundef %363, i16 noundef zeroext %365)
  %367 = getelementptr inbounds %struct.s2n_result, ptr %16, i32 0, i32 0
  store i32 %366, ptr %367, align 4
  %368 = getelementptr inbounds %struct.s2n_result, ptr %16, i32 0, i32 0
  %369 = load i32, ptr %368, align 4
  %370 = call zeroext i1 @s2n_result_is_ok(i32 %369)
  br i1 %370, label %372, label %371

371:                                              ; preds = %362
  store i64 -1, ptr %3, align 8
  store i32 1, ptr %7, align 4
  br label %407

372:                                              ; preds = %362
  br label %373

373:                                              ; preds = %372
  br label %374

374:                                              ; preds = %373
  store i32 37, ptr %7, align 4
  br label %407

375:                                              ; preds = %351
  call void @llvm.lifetime.start.p0(i64 1, ptr %17) #9
  store i8 0, ptr %17, align 1, !tbaa !28
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #9
  %376 = load ptr, ptr %6, align 8, !tbaa !5
  %377 = getelementptr inbounds %struct.s2n_test_ktls_io_stuffer, ptr %376, i32 0, i32 0
  %378 = call i32 @s2n_stuffer_peek_char(ptr noundef %377, ptr noundef %17)
  store i32 %378, ptr %18, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %19) #9
  %379 = load i32, ptr %18, align 4, !tbaa !9
  %380 = icmp ne i32 %379, 0
  %381 = zext i1 %380 to i8
  store i8 %381, ptr %19, align 1, !tbaa !33
  %382 = load i8, ptr %19, align 1, !tbaa !33, !range !35, !noundef !36
  %383 = trunc i8 %382 to i1
  br i1 %383, label %384, label %385

384:                                              ; preds = %375
  store i32 37, ptr %7, align 4
  br label %406

385:                                              ; preds = %375
  call void @llvm.lifetime.start.p0(i64 1, ptr %20) #9
  %386 = load i8, ptr %17, align 1, !tbaa !28
  %387 = zext i8 %386 to i32
  %388 = load i8, ptr %10, align 1, !tbaa !28
  %389 = zext i8 %388 to i32
  %390 = icmp ne i32 %387, %389
  %391 = zext i1 %390 to i8
  store i8 %391, ptr %20, align 1, !tbaa !33
  %392 = load i8, ptr %20, align 1, !tbaa !33, !range !35, !noundef !36
  %393 = trunc i8 %392 to i1
  br i1 %393, label %394, label %395

394:                                              ; preds = %385
  store i32 37, ptr %7, align 4
  br label %405

395:                                              ; preds = %385
  br label %396

396:                                              ; preds = %395
  %397 = load ptr, ptr %6, align 8, !tbaa !5
  %398 = getelementptr inbounds %struct.s2n_test_ktls_io_stuffer, ptr %397, i32 0, i32 0
  %399 = call i32 @s2n_stuffer_skip_read(ptr noundef %398, i32 noundef 1)
  %400 = icmp sgt i32 %399, -1
  br i1 %400, label %402, label %401

401:                                              ; preds = %396
  store i64 -1, ptr %3, align 8
  store i32 1, ptr %7, align 4
  br label %405

402:                                              ; preds = %396
  br label %403

403:                                              ; preds = %402
  br label %404

404:                                              ; preds = %403
  store i32 0, ptr %7, align 4
  br label %405

405:                                              ; preds = %404, %401, %394
  call void @llvm.lifetime.end.p0(i64 1, ptr %20) #9
  br label %406

406:                                              ; preds = %405, %384
  call void @llvm.lifetime.end.p0(i64 1, ptr %19) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr %17) #9
  br label %407

407:                                              ; preds = %406, %374, %371
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #9
  br label %408

408:                                              ; preds = %407, %348, %332
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #9
  br label %409

409:                                              ; preds = %408, %280
  call void @llvm.lifetime.end.p0(i64 2, ptr %13) #9
  %410 = load i32, ptr %7, align 4
  switch i32 %410, label %414 [
    i32 0, label %411
    i32 37, label %412
  ]

411:                                              ; preds = %409
  br label %270, !llvm.loop !37

412:                                              ; preds = %409, %270
  %413 = load i64, ptr %12, align 8, !tbaa !27
  store i64 %413, ptr %3, align 8
  store i32 1, ptr %7, align 4
  br label %414

414:                                              ; preds = %412, %409
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #9
  br label %415

415:                                              ; preds = %414, %266, %248
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #9
  br label %416

416:                                              ; preds = %415, %232, %194, %178
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #9
  br label %417

417:                                              ; preds = %416, %130
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #9
  br label %418

418:                                              ; preds = %417, %92, %54
  %419 = load i64, ptr %3, align 8
  ret i64 %419
}

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

declare i32 @s2n_ktls_set_control_data(ptr noundef, ptr noundef, i64 noundef, i32 noundef, i8 noundef zeroext) #3

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

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

; Function Attrs: nounwind uwtable
declare hidden i32 @s2n_test_ktls_update_prev_header_len(ptr noundef, i16 noundef zeroext) #6

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !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, !6, i64 16}
!15 = !{!"msghdr", !6, i64 0, !10, i64 8, !6, i64 16, !16, i64 24, !6, i64 32, !16, i64 40, !10, i64 48}
!16 = !{!"long", !7, i64 0}
!17 = !{!18, !16, i64 88}
!18 = !{!"s2n_test_ktls_io_stuffer", !19, i64 0, !19, i64 40, !16, i64 80, !16, i64 88}
!19 = !{!"s2n_stuffer", !20, i64 0, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !10, i64 36, !10, i64 36}
!20 = !{!"s2n_blob", !6, i64 0, !10, i64 8, !10, i64 12, !10, i64 16}
!21 = !{!22, !6, i64 0}
!22 = !{!"iovec", !6, i64 0, !16, i64 8}
!23 = !{!18, !10, i64 28}
!24 = !{!18, !10, i64 24}
!25 = !{!15, !16, i64 24}
!26 = !{!22, !16, i64 8}
!27 = !{!16, !16, i64 0}
!28 = !{!7, !7, i64 0}
!29 = !{!15, !6, i64 32}
!30 = !{!15, !16, i64 40}
!31 = !{!32, !32, i64 0}
!32 = !{!"short", !7, i64 0}
!33 = !{!34, !34, i64 0}
!34 = !{!"_Bool", !7, i64 0}
!35 = !{i8 0, i8 2}
!36 = !{}
!37 = distinct !{!37, !38}
!38 = !{!"llvm.loop.mustprogress"}


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

; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
declare ptr @__errno_location() local_unnamed_addr #0

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

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

declare i32 @s2n_calculate_stacktrace() local_unnamed_addr #3

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

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

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

; Function Attrs: nounwind uwtable
define dso_local i64 @s2n_test_ktls_recvmsg_io_stuffer(ptr noundef %0, ptr noundef %1) local_unnamed_addr #6 {
  %3 = alloca i8, align 1
  %4 = alloca i16, align 2
  %5 = alloca i8, align 1
  %6 = tail call ptr @__errno_location() #8
  store i32 22, ptr %6, align 4, !tbaa !5
  %.not = icmp eq ptr %1, null
  br i1 %.not, label %7, label %15

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

15:                                               ; preds = %2
  %16 = getelementptr inbounds i8, ptr %1, i64 16
  %17 = load ptr, ptr %16, align 8, !tbaa !13
  %.not63 = icmp eq ptr %17, null
  br i1 %.not63, label %18, label %26

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

26:                                               ; preds = %15
  %.not65 = icmp eq ptr %0, null
  br i1 %.not65, label %27, label %35

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

35:                                               ; preds = %26
  %36 = getelementptr inbounds i8, ptr %0, i64 88
  %37 = load i64, ptr %36, align 8, !tbaa !16
  %38 = add i64 %37, 1
  store i64 %38, ptr %36, align 8, !tbaa !16
  %39 = load ptr, ptr %17, align 8, !tbaa !20
  %.not67 = icmp eq ptr %39, null
  br i1 %.not67, label %40, label %48

40:                                               ; preds = %35
  %41 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr @.str.6, ptr %41, align 8, !tbaa !9
  %42 = tail call ptr @strrchr(ptr noundef nonnull dereferenceable(1) getelementptr inbounds (i8, ptr @.str.6, i64 21), i32 noundef 47) #9
  %.not68 = icmp eq ptr %42, null
  %43 = getelementptr inbounds i8, ptr %42, i64 1
  %44 = select i1 %.not68, ptr getelementptr inbounds (i8, ptr @.str.6, i64 21), ptr %43
  %45 = getelementptr inbounds i8, ptr %41, i64 8
  store ptr %44, ptr %45, align 8, !tbaa !12
  %46 = tail call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %46, align 4, !tbaa !5
  %47 = tail call i32 @s2n_calculate_stacktrace() #10
  br label %120

48:                                               ; preds = %35
  %49 = getelementptr inbounds i8, ptr %0, i64 28
  %50 = load i32, ptr %49, align 4, !tbaa !22
  %51 = getelementptr inbounds i8, ptr %0, i64 24
  %52 = load i32, ptr %51, align 8, !tbaa !23
  %.not69 = icmp eq i32 %50, %52
  br i1 %.not69, label %53, label %54

53:                                               ; preds = %48
  store i32 11, ptr %6, align 4, !tbaa !5
  br label %120

54:                                               ; preds = %48
  %55 = getelementptr inbounds i8, ptr %1, i64 24
  %56 = load i64, ptr %55, align 8, !tbaa !24
  %57 = icmp eq i64 %56, 1
  br i1 %57, label %66, label %58

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

66:                                               ; preds = %54
  %67 = getelementptr inbounds i8, ptr %17, i64 8
  %68 = load i64, ptr %67, align 8, !tbaa !25
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %3) #10
  store i8 0, ptr %3, align 1, !tbaa !26
  %69 = call i32 @s2n_stuffer_read_uint8(ptr noundef nonnull %0, ptr noundef nonnull %3) #10
  %70 = icmp sgt i32 %69, -1
  br i1 %70, label %71, label %.loopexit

71:                                               ; preds = %66
  %72 = getelementptr inbounds i8, ptr %1, i64 32
  %73 = load ptr, ptr %72, align 8, !tbaa !27
  %74 = getelementptr inbounds i8, ptr %1, i64 40
  %75 = load i64, ptr %74, align 8, !tbaa !28
  %76 = load i8, ptr %3, align 1, !tbaa !26
  %77 = call i32 @s2n_ktls_set_control_data(ptr noundef nonnull %1, ptr noundef %73, i64 noundef %75, i32 noundef 0, i8 noundef zeroext %76) #10
  %78 = call zeroext i1 @s2n_result_is_ok(i32 %77)
  br i1 %78, label %.preheader, label %.loopexit

.preheader:                                       ; preds = %71
  %.not104 = icmp eq i64 %68, 0
  br i1 %.not104, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader
  %79 = getelementptr inbounds i8, ptr %0, i64 40
  br label %80

80:                                               ; preds = %.lr.ph, %118
  %.046103 = phi i64 [ 0, %.lr.ph ], [ %102, %118 ]
  call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %4) #10
  store i16 0, ptr %4, align 2, !tbaa !29
  %81 = call i32 @s2n_stuffer_read_uint16(ptr noundef nonnull %0, ptr noundef nonnull %4) #10
  %82 = icmp sgt i32 %81, -1
  br i1 %82, label %83, label %.thread

83:                                               ; preds = %80
  %84 = sub i64 %68, %.046103
  %85 = load i16, ptr %4, align 2
  %86 = zext i16 %85 to i64
  %87 = call i64 @llvm.umin.i64(i64 %84, i64 %86)
  %.not71 = icmp eq i64 %87, 0
  br i1 %.not71, label %88, label %96

88:                                               ; preds = %83
  %89 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr @.str.8, ptr %89, align 8, !tbaa !9
  %90 = call ptr @strrchr(ptr noundef nonnull dereferenceable(1) getelementptr inbounds (i8, ptr @.str.8, i64 21), i32 noundef 47) #9
  %.not72 = icmp eq ptr %90, null
  %91 = getelementptr inbounds i8, ptr %90, i64 1
  %92 = select i1 %.not72, ptr getelementptr inbounds (i8, ptr @.str.8, i64 21), ptr %91
  %93 = getelementptr inbounds i8, ptr %89, i64 8
  store ptr %92, ptr %93, align 8, !tbaa !12
  %94 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653194, ptr %94, align 4, !tbaa !5
  %95 = call i32 @s2n_calculate_stacktrace() #10
  br label %.thread

96:                                               ; preds = %83
  %97 = getelementptr inbounds i8, ptr %39, i64 %.046103
  %98 = trunc nuw nsw i64 %87 to i32
  %99 = call i32 @s2n_stuffer_read_bytes(ptr noundef nonnull %79, ptr noundef nonnull %97, i32 noundef %98) #10
  %100 = icmp sgt i32 %99, -1
  br i1 %100, label %101, label %.thread

101:                                              ; preds = %96
  %102 = add i64 %87, %.046103
  %103 = load i16, ptr %4, align 2, !tbaa !29
  %104 = zext i16 %103 to i64
  %.not73 = icmp eq i64 %87, %104
  br i1 %.not73, label %110, label %105

105:                                              ; preds = %101
  %106 = trunc nuw i64 %87 to i16
  %107 = sub i16 %103, %106
  %108 = call i32 @s2n_test_ktls_update_prev_header_len(ptr noundef nonnull %0, i16 noundef zeroext %107)
  %109 = call zeroext i1 @s2n_result_is_ok(i32 %108)
  br i1 %109, label %.thread79, label %.thread

110:                                              ; preds = %101
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %5) #10
  store i8 0, ptr %5, align 1, !tbaa !26
  %111 = call i32 @s2n_stuffer_peek_char(ptr noundef nonnull %0, ptr noundef nonnull %5) #10
  %.not74 = icmp eq i32 %111, 0
  br i1 %.not74, label %112, label %.thread85

112:                                              ; preds = %110
  %113 = load i8, ptr %5, align 1, !tbaa !26
  %114 = load i8, ptr %3, align 1, !tbaa !26
  %.not75 = icmp eq i8 %113, %114
  br i1 %.not75, label %115, label %.thread85

115:                                              ; preds = %112
  %116 = call i32 @s2n_stuffer_skip_read(ptr noundef nonnull %0, i32 noundef 1) #10
  %117 = icmp sgt i32 %116, -1
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #10
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %4) #10
  br i1 %117, label %118, label %.loopexit

.thread79:                                        ; preds = %105
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %4) #10
  br label %.loopexit

.thread:                                          ; preds = %80, %96, %88, %105
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %4) #10
  br label %.loopexit

.thread85:                                        ; preds = %110, %112
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #10
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %4) #10
  br label %.loopexit

118:                                              ; preds = %115
  %119 = icmp ult i64 %102, %68
  br i1 %119, label %80, label %.loopexit

.loopexit:                                        ; preds = %118, %115, %.preheader, %.thread79, %.thread85, %.thread, %71, %66
  %.7 = phi i64 [ -1, %66 ], [ -1, %71 ], [ -1, %.thread ], [ %102, %.thread85 ], [ %102, %.thread79 ], [ 0, %.preheader ], [ -1, %115 ], [ %102, %118 ]
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %3) #10
  br label %120

120:                                              ; preds = %27, %.loopexit, %58, %53, %40, %18, %7
  %.10 = phi i64 [ -1, %18 ], [ -1, %7 ], [ -1, %27 ], [ %.7, %.loopexit ], [ -1, %58 ], [ -1, %53 ], [ -1, %40 ]
  ret i64 %.10
}

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

declare i32 @s2n_ktls_set_control_data(ptr noundef, ptr noundef, i64 noundef, i32 noundef, i8 noundef zeroext) local_unnamed_addr #3

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

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

; Function Attrs: nounwind uwtable
declare hidden i32 @s2n_test_ktls_update_prev_header_len(ptr noundef, i16 noundef zeroext) local_unnamed_addr #6

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

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

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

attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(none) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { inlinehint nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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 #7 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #8 = { nounwind willreturn memory(none) }
attributes #9 = { nounwind willreturn memory(read) }
attributes #10 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !11, i64 0}
!10 = !{!"s2n_debug_info", !11, i64 0, !11, i64 8}
!11 = !{!"any pointer", !7, i64 0}
!12 = !{!10, !11, i64 8}
!13 = !{!14, !11, i64 16}
!14 = !{!"msghdr", !11, i64 0, !6, i64 8, !11, i64 16, !15, i64 24, !11, i64 32, !15, i64 40, !6, i64 48}
!15 = !{!"long", !7, i64 0}
!16 = !{!17, !15, i64 88}
!17 = !{!"s2n_test_ktls_io_stuffer", !18, i64 0, !18, i64 40, !15, i64 80, !15, i64 88}
!18 = !{!"s2n_stuffer", !19, i64 0, !6, i64 24, !6, i64 28, !6, i64 32, !6, i64 36, !6, i64 36, !6, i64 36}
!19 = !{!"s2n_blob", !11, i64 0, !6, i64 8, !6, i64 12, !6, i64 16}
!20 = !{!21, !11, i64 0}
!21 = !{!"iovec", !11, i64 0, !15, i64 8}
!22 = !{!17, !6, i64 28}
!23 = !{!17, !6, i64 24}
!24 = !{!14, !15, i64 24}
!25 = !{!21, !15, i64 8}
!26 = !{!7, !7, i64 0}
!27 = !{!14, !11, i64 32}
!28 = !{!14, !15, i64 40}
!29 = !{!30, !30, i64 0}
!30 = !{!"short", !7, i64 0}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass