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

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

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

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

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

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

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

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

declare i32 @s2n_calculate_stacktrace() #4

declare i32 @s2n_blob_init(ptr noundef, ptr noundef, i32 noundef) #4

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

; Function Attrs: nounwind uwtable
define dso_local i32 @successful_stack_blob() #5 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %3 = alloca [10 x i8], align 1
  %4 = alloca i32, align 4
  %5 = alloca %struct.s2n_blob, align 8
  %6 = alloca i64, align 8
  %7 = alloca [10 x i8], align 1
  %8 = alloca %struct.s2n_blob, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #6
  store i64 10, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 10, ptr %3) #6
  call void @llvm.memset.p0.i64(ptr align 1 %3, i8 0, i64 10, i1 false)
  br label %9

9:                                                ; preds = %0
  %10 = load i64, ptr %2, align 8, !tbaa !5
  %11 = icmp ule i64 %10, 10
  br i1 %11, label %45, label %12

12:                                               ; preds = %9
  br label %13

13:                                               ; preds = %12
  br label %14

14:                                               ; preds = %13
  %15 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %16 = getelementptr inbounds %struct.s2n_debug_info, ptr %15, i32 0, i32 0
  store ptr @.str.4, ptr %16, align 8, !tbaa !9
  %17 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %18 = getelementptr inbounds %struct.s2n_debug_info, ptr %17, i32 0, i32 0
  %19 = load ptr, ptr %18, align 8, !tbaa !9
  %20 = getelementptr inbounds i8, ptr %19, i64 21
  %21 = call ptr @strrchr(ptr noundef %20, i32 noundef 47) #7
  %22 = icmp ne ptr %21, null
  br i1 %22, label %23, label %30

23:                                               ; preds = %14
  %24 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %25 = getelementptr inbounds %struct.s2n_debug_info, ptr %24, i32 0, i32 0
  %26 = load ptr, ptr %25, align 8, !tbaa !9
  %27 = getelementptr inbounds i8, ptr %26, i64 21
  %28 = call ptr @strrchr(ptr noundef %27, i32 noundef 47) #7
  %29 = getelementptr inbounds i8, ptr %28, i64 1
  br label %35

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

35:                                               ; preds = %30, %23
  %36 = phi ptr [ %29, %23 ], [ %34, %30 ]
  %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 1
  store ptr %36, ptr %38, align 8, !tbaa !12
  %39 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653194, ptr %39, align 4, !tbaa !13
  %40 = call i32 @s2n_calculate_stacktrace()
  br label %41

41:                                               ; preds = %35
  br label %42

42:                                               ; preds = %41
  store i32 -1, ptr %1, align 4
  store i32 1, ptr %4, align 4
  br label %270

43:                                               ; No predecessors!
  br label %44

44:                                               ; preds = %43
  br label %45

45:                                               ; preds = %44, %9
  br label %46

46:                                               ; preds = %45
  br label %47

47:                                               ; preds = %46
  call void @llvm.lifetime.start.p0(i64 24, ptr %5) #6
  call void @llvm.memset.p0.i64(ptr align 8 %5, i8 0, i64 24, i1 false)
  br label %48

48:                                               ; preds = %47
  %49 = getelementptr inbounds [10 x i8], ptr %3, i64 0, i64 0
  %50 = load i64, ptr %2, align 8, !tbaa !5
  %51 = trunc i64 %50 to i32
  %52 = call i32 @s2n_blob_init(ptr noundef %5, ptr noundef %49, i32 noundef %51)
  %53 = icmp sgt i32 %52, -1
  br i1 %53, label %55, label %54

54:                                               ; preds = %48
  store i32 -1, ptr %1, align 4
  store i32 1, ptr %4, align 4
  br label %269

55:                                               ; preds = %48
  br label %56

56:                                               ; preds = %55
  br label %57

57:                                               ; preds = %56
  br label %58

58:                                               ; preds = %57
  %59 = getelementptr inbounds %struct.s2n_blob, ptr %5, i32 0, i32 1
  %60 = load i32, ptr %59, align 8, !tbaa !15
  %61 = icmp eq i32 %60, 10
  br i1 %61, label %95, label %62

62:                                               ; preds = %58
  br label %63

63:                                               ; preds = %62
  br label %64

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

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

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

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

91:                                               ; preds = %85
  br label %92

92:                                               ; preds = %91
  store i32 -1, ptr %1, align 4
  store i32 1, ptr %4, align 4
  br label %269

93:                                               ; No predecessors!
  br label %94

94:                                               ; preds = %93
  br label %95

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

96:                                               ; preds = %95
  br label %97

97:                                               ; preds = %96
  br label %98

98:                                               ; preds = %97
  %99 = getelementptr inbounds %struct.s2n_blob, ptr %5, i32 0, i32 2
  %100 = load i32, ptr %99, align 4, !tbaa !17
  %101 = icmp eq i32 %100, 0
  br i1 %101, label %135, label %102

102:                                              ; preds = %98
  br label %103

103:                                              ; preds = %102
  br label %104

104:                                              ; preds = %103
  %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
  store ptr @.str.6, ptr %106, align 8, !tbaa !9
  %107 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %108 = getelementptr inbounds %struct.s2n_debug_info, ptr %107, i32 0, i32 0
  %109 = load ptr, ptr %108, align 8, !tbaa !9
  %110 = getelementptr inbounds i8, ptr %109, i64 21
  %111 = call ptr @strrchr(ptr noundef %110, i32 noundef 47) #7
  %112 = icmp ne ptr %111, null
  br i1 %112, label %113, label %120

113:                                              ; preds = %104
  %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 0
  %116 = load ptr, ptr %115, align 8, !tbaa !9
  %117 = getelementptr inbounds i8, ptr %116, i64 21
  %118 = call ptr @strrchr(ptr noundef %117, i32 noundef 47) #7
  %119 = getelementptr inbounds i8, ptr %118, i64 1
  br label %125

120:                                              ; preds = %104
  %121 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %122 = getelementptr inbounds %struct.s2n_debug_info, ptr %121, i32 0, i32 0
  %123 = load ptr, ptr %122, align 8, !tbaa !9
  %124 = getelementptr inbounds i8, ptr %123, i64 21
  br label %125

125:                                              ; preds = %120, %113
  %126 = phi ptr [ %119, %113 ], [ %124, %120 ]
  %127 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %128 = getelementptr inbounds %struct.s2n_debug_info, ptr %127, i32 0, i32 1
  store ptr %126, ptr %128, align 8, !tbaa !12
  %129 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653194, ptr %129, align 4, !tbaa !13
  %130 = call i32 @s2n_calculate_stacktrace()
  br label %131

131:                                              ; preds = %125
  br label %132

132:                                              ; preds = %131
  store i32 -1, ptr %1, align 4
  store i32 1, ptr %4, align 4
  br label %269

133:                                              ; No predecessors!
  br label %134

134:                                              ; preds = %133
  br label %135

135:                                              ; preds = %134, %98
  br label %136

136:                                              ; preds = %135
  br label %137

137:                                              ; preds = %136
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  store i64 1, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 10, ptr %7) #6
  call void @llvm.memset.p0.i64(ptr align 1 %7, i8 0, i64 10, i1 false)
  br label %138

138:                                              ; preds = %137
  %139 = load i64, ptr %6, align 8, !tbaa !5
  %140 = icmp ule i64 %139, 10
  br i1 %140, label %174, label %141

141:                                              ; preds = %138
  br label %142

142:                                              ; preds = %141
  br label %143

143:                                              ; preds = %142
  %144 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %145 = getelementptr inbounds %struct.s2n_debug_info, ptr %144, i32 0, i32 0
  store ptr @.str.7, ptr %145, align 8, !tbaa !9
  %146 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %147 = getelementptr inbounds %struct.s2n_debug_info, ptr %146, i32 0, i32 0
  %148 = load ptr, ptr %147, align 8, !tbaa !9
  %149 = getelementptr inbounds i8, ptr %148, i64 21
  %150 = call ptr @strrchr(ptr noundef %149, i32 noundef 47) #7
  %151 = icmp ne ptr %150, null
  br i1 %151, label %152, label %159

152:                                              ; preds = %143
  %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 !9
  %156 = getelementptr inbounds i8, ptr %155, i64 21
  %157 = call ptr @strrchr(ptr noundef %156, i32 noundef 47) #7
  %158 = getelementptr inbounds i8, ptr %157, i64 1
  br label %164

159:                                              ; preds = %143
  %160 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %161 = getelementptr inbounds %struct.s2n_debug_info, ptr %160, i32 0, i32 0
  %162 = load ptr, ptr %161, align 8, !tbaa !9
  %163 = getelementptr inbounds i8, ptr %162, i64 21
  br label %164

164:                                              ; preds = %159, %152
  %165 = phi ptr [ %158, %152 ], [ %163, %159 ]
  %166 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %167 = getelementptr inbounds %struct.s2n_debug_info, ptr %166, i32 0, i32 1
  store ptr %165, ptr %167, align 8, !tbaa !12
  %168 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653194, ptr %168, align 4, !tbaa !13
  %169 = call i32 @s2n_calculate_stacktrace()
  br label %170

170:                                              ; preds = %164
  br label %171

171:                                              ; preds = %170
  store i32 -1, ptr %1, align 4
  store i32 1, ptr %4, align 4
  br label %268

172:                                              ; No predecessors!
  br label %173

173:                                              ; preds = %172
  br label %174

174:                                              ; preds = %173, %138
  br label %175

175:                                              ; preds = %174
  br label %176

176:                                              ; preds = %175
  call void @llvm.lifetime.start.p0(i64 24, ptr %8) #6
  call void @llvm.memset.p0.i64(ptr align 8 %8, i8 0, i64 24, i1 false)
  br label %177

177:                                              ; preds = %176
  %178 = getelementptr inbounds [10 x i8], ptr %7, i64 0, i64 0
  %179 = load i64, ptr %6, align 8, !tbaa !5
  %180 = trunc i64 %179 to i32
  %181 = call i32 @s2n_blob_init(ptr noundef %8, ptr noundef %178, i32 noundef %180)
  %182 = icmp sgt i32 %181, -1
  br i1 %182, label %184, label %183

183:                                              ; preds = %177
  store i32 -1, ptr %1, align 4
  store i32 1, ptr %4, align 4
  br label %267

184:                                              ; preds = %177
  br label %185

185:                                              ; preds = %184
  br label %186

186:                                              ; preds = %185
  br label %187

187:                                              ; preds = %186
  %188 = getelementptr inbounds %struct.s2n_blob, ptr %8, i32 0, i32 1
  %189 = load i32, ptr %188, align 8, !tbaa !15
  %190 = icmp eq i32 %189, 1
  br i1 %190, label %224, label %191

191:                                              ; preds = %187
  br label %192

192:                                              ; preds = %191
  br label %193

193:                                              ; preds = %192
  %194 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %195 = getelementptr inbounds %struct.s2n_debug_info, ptr %194, i32 0, i32 0
  store ptr @.str.8, ptr %195, align 8, !tbaa !9
  %196 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %197 = getelementptr inbounds %struct.s2n_debug_info, ptr %196, i32 0, i32 0
  %198 = load ptr, ptr %197, align 8, !tbaa !9
  %199 = getelementptr inbounds i8, ptr %198, i64 21
  %200 = call ptr @strrchr(ptr noundef %199, i32 noundef 47) #7
  %201 = icmp ne ptr %200, null
  br i1 %201, label %202, label %209

202:                                              ; preds = %193
  %203 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %204 = getelementptr inbounds %struct.s2n_debug_info, ptr %203, i32 0, i32 0
  %205 = load ptr, ptr %204, align 8, !tbaa !9
  %206 = getelementptr inbounds i8, ptr %205, i64 21
  %207 = call ptr @strrchr(ptr noundef %206, i32 noundef 47) #7
  %208 = getelementptr inbounds i8, ptr %207, i64 1
  br label %214

209:                                              ; preds = %193
  %210 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %211 = getelementptr inbounds %struct.s2n_debug_info, ptr %210, i32 0, i32 0
  %212 = load ptr, ptr %211, align 8, !tbaa !9
  %213 = getelementptr inbounds i8, ptr %212, i64 21
  br label %214

214:                                              ; preds = %209, %202
  %215 = phi ptr [ %208, %202 ], [ %213, %209 ]
  %216 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %217 = getelementptr inbounds %struct.s2n_debug_info, ptr %216, i32 0, i32 1
  store ptr %215, ptr %217, align 8, !tbaa !12
  %218 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653194, ptr %218, align 4, !tbaa !13
  %219 = call i32 @s2n_calculate_stacktrace()
  br label %220

220:                                              ; preds = %214
  br label %221

221:                                              ; preds = %220
  store i32 -1, ptr %1, align 4
  store i32 1, ptr %4, align 4
  br label %267

222:                                              ; No predecessors!
  br label %223

223:                                              ; preds = %222
  br label %224

224:                                              ; preds = %223, %187
  br label %225

225:                                              ; preds = %224
  br label %226

226:                                              ; preds = %225
  br label %227

227:                                              ; preds = %226
  %228 = getelementptr inbounds %struct.s2n_blob, ptr %8, i32 0, i32 2
  %229 = load i32, ptr %228, align 4, !tbaa !17
  %230 = icmp eq i32 %229, 0
  br i1 %230, label %264, label %231

231:                                              ; preds = %227
  br label %232

232:                                              ; preds = %231
  br label %233

233:                                              ; preds = %232
  %234 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %235 = getelementptr inbounds %struct.s2n_debug_info, ptr %234, i32 0, i32 0
  store ptr @.str.9, ptr %235, align 8, !tbaa !9
  %236 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %237 = getelementptr inbounds %struct.s2n_debug_info, ptr %236, i32 0, i32 0
  %238 = load ptr, ptr %237, align 8, !tbaa !9
  %239 = getelementptr inbounds i8, ptr %238, i64 21
  %240 = call ptr @strrchr(ptr noundef %239, i32 noundef 47) #7
  %241 = icmp ne ptr %240, null
  br i1 %241, label %242, label %249

242:                                              ; preds = %233
  %243 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %244 = getelementptr inbounds %struct.s2n_debug_info, ptr %243, i32 0, i32 0
  %245 = load ptr, ptr %244, align 8, !tbaa !9
  %246 = getelementptr inbounds i8, ptr %245, i64 21
  %247 = call ptr @strrchr(ptr noundef %246, i32 noundef 47) #7
  %248 = getelementptr inbounds i8, ptr %247, i64 1
  br label %254

249:                                              ; preds = %233
  %250 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %251 = getelementptr inbounds %struct.s2n_debug_info, ptr %250, i32 0, i32 0
  %252 = load ptr, ptr %251, align 8, !tbaa !9
  %253 = getelementptr inbounds i8, ptr %252, i64 21
  br label %254

254:                                              ; preds = %249, %242
  %255 = phi ptr [ %248, %242 ], [ %253, %249 ]
  %256 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %257 = getelementptr inbounds %struct.s2n_debug_info, ptr %256, i32 0, i32 1
  store ptr %255, ptr %257, align 8, !tbaa !12
  %258 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653194, ptr %258, align 4, !tbaa !13
  %259 = call i32 @s2n_calculate_stacktrace()
  br label %260

260:                                              ; preds = %254
  br label %261

261:                                              ; preds = %260
  store i32 -1, ptr %1, align 4
  store i32 1, ptr %4, align 4
  br label %267

262:                                              ; No predecessors!
  br label %263

263:                                              ; preds = %262
  br label %264

264:                                              ; preds = %263, %227
  br label %265

265:                                              ; preds = %264
  br label %266

266:                                              ; preds = %265
  store i32 0, ptr %1, align 4
  store i32 1, ptr %4, align 4
  br label %267

267:                                              ; preds = %266, %261, %221, %183
  call void @llvm.lifetime.end.p0(i64 24, ptr %8) #6
  br label %268

268:                                              ; preds = %267, %171
  call void @llvm.lifetime.end.p0(i64 10, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  br label %269

269:                                              ; preds = %268, %132, %92, %54
  call void @llvm.lifetime.end.p0(i64 24, ptr %5) #6
  br label %270

270:                                              ; preds = %269, %42
  call void @llvm.lifetime.end.p0(i64 10, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #6
  %271 = load i32, ptr %1, align 4
  ret i32 %271
}

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long", !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, !14, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = !{!16, !14, i64 8}
!16 = !{!"s2n_blob", !11, i64 0, !14, i64 8, !14, i64 12, !14, i64 16}
!17 = !{!16, !14, i64 12}


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

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

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

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

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

declare i32 @s2n_calculate_stacktrace() local_unnamed_addr #4

declare i32 @s2n_blob_init(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #4

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

; Function Attrs: nounwind uwtable
define dso_local range(i32 -1, 1) i32 @successful_stack_blob() local_unnamed_addr #5 {
  %1 = alloca [10 x i8], align 1
  %2 = alloca %struct.s2n_blob, align 8
  %3 = alloca [10 x i8], align 1
  %4 = alloca %struct.s2n_blob, align 8
  call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %1) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %1, i8 0, i64 10, i1 false)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %2) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %2, i8 0, i64 24, i1 false)
  %5 = call i32 @s2n_blob_init(ptr noundef nonnull %2, ptr noundef nonnull %1, i32 noundef 10) #6
  %6 = icmp sgt i32 %5, -1
  br i1 %6, label %7, label %50

7:                                                ; preds = %0
  %8 = getelementptr inbounds i8, ptr %2, i64 8
  %9 = load i32, ptr %8, align 8, !tbaa !5
  %10 = icmp eq i32 %9, 10
  br i1 %10, label %19, label %11

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

19:                                               ; preds = %7
  %20 = getelementptr inbounds i8, ptr %2, i64 12
  %21 = load i32, ptr %20, align 4, !tbaa !15
  %22 = icmp eq i32 %21, 0
  br i1 %22, label %31, label %23

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

31:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %3) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %3, i8 0, i64 10, i1 false)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %4, i8 0, i64 24, i1 false)
  %32 = call i32 @s2n_blob_init(ptr noundef nonnull %4, ptr noundef nonnull %3, i32 noundef 1) #6
  %33 = icmp sgt i32 %32, -1
  br i1 %33, label %34, label %49

34:                                               ; preds = %31
  %35 = getelementptr inbounds i8, ptr %4, i64 8
  %36 = load i32, ptr %35, align 8, !tbaa !5
  %37 = icmp eq i32 %36, 1
  br i1 %37, label %38, label %.sink.split

38:                                               ; preds = %34
  %39 = getelementptr inbounds i8, ptr %4, i64 12
  %40 = load i32, ptr %39, align 4, !tbaa !15
  %41 = icmp eq i32 %40, 0
  br i1 %41, label %49, label %.sink.split

.sink.split:                                      ; preds = %38, %34
  %.str.9.sink = phi ptr [ @.str.8, %34 ], [ @.str.9, %38 ]
  %.sink19 = phi ptr [ getelementptr inbounds (i8, ptr @.str.8, i64 21), %34 ], [ getelementptr inbounds (i8, ptr @.str.9, i64 21), %38 ]
  %42 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr %.str.9.sink, ptr %42, align 8, !tbaa !11
  %43 = call ptr @strrchr(ptr noundef nonnull dereferenceable(1) %.sink19, i32 noundef 47) #7
  %.not13 = icmp eq ptr %43, null
  %44 = getelementptr inbounds i8, ptr %43, i64 1
  %45 = select i1 %.not13, ptr %.sink19, ptr %44
  %46 = getelementptr inbounds i8, ptr %42, i64 8
  store ptr %45, ptr %46, align 8, !tbaa !13
  %47 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653194, ptr %47, align 4, !tbaa !14
  %48 = call i32 @s2n_calculate_stacktrace() #6
  br label %49

49:                                               ; preds = %.sink.split, %38, %31
  %.0 = phi i32 [ -1, %31 ], [ 0, %38 ], [ -1, %.sink.split ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 10, ptr nonnull %3) #6
  br label %50

50:                                               ; preds = %0, %49, %23, %11
  %.2 = phi i32 [ %.0, %49 ], [ -1, %23 ], [ -1, %11 ], [ -1, %0 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 10, ptr nonnull %1) #6
  ret i32 %.2
}

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

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

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


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