; LLVM IR from aws/s2n-tls :: stuffer (s2n_stuffer_text)

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

%struct.s2n_debug_info = type { ptr, ptr }
%struct.s2n_result = type { i32 }
%struct.s2n_va_list = type { [1 x %struct.__va_list_tag] }
%struct.__va_list_tag = type { i32, i32, 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 global %struct.s2n_debug_info, align 8
@s2n_errno = external thread_local global i32, align 4
@.str.10 = external hidden unnamed_addr constant [97 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [97 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [97 x i8], align 1
@.str.13 = 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: inlinehint nounwind uwtable
declare hidden zeroext i1 @s2n_result_is_ok(i32) #1

declare i32 @s2n_stuffer_validate(ptr noundef) #2

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

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

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

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

declare i32 @s2n_calculate_stacktrace() #2

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

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

20:                                               ; preds = %3
  %21 = load ptr, ptr %5, align 8, !tbaa !5
  %22 = call i32 @s2n_stuffer_validate(ptr noundef %21)
  %23 = getelementptr inbounds %struct.s2n_result, ptr %9, i32 0, i32 0
  store i32 %22, ptr %23, align 4
  %24 = getelementptr inbounds %struct.s2n_result, ptr %9, i32 0, i32 0
  %25 = load i32, ptr %24, align 4
  %26 = call zeroext i1 @s2n_result_is_ok(i32 %25)
  %27 = xor i1 %26, true
  %28 = xor i1 %27, true
  %29 = zext i1 %28 to i32
  %30 = sext i32 %29 to i64
  %31 = call i64 @llvm.expect.i64(i64 %30, i64 1)
  %32 = icmp ne i64 %31, 0
  br i1 %32, label %33, label %35

33:                                               ; preds = %20
  %34 = getelementptr inbounds %struct.s2n_result, ptr %8, i32 0, i32 0
  store i32 0, ptr %34, align 4, !tbaa !9
  br label %37

35:                                               ; preds = %20
  %36 = getelementptr inbounds %struct.s2n_result, ptr %8, i32 0, i32 0
  store i32 -1, ptr %36, align 4, !tbaa !9
  br label %37

37:                                               ; preds = %35, %33
  %38 = getelementptr inbounds %struct.s2n_result, ptr %8, i32 0, i32 0
  %39 = load i32, ptr %38, align 4
  %40 = call zeroext i1 @s2n_result_is_ok(i32 %39)
  br i1 %40, label %42, label %41

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

42:                                               ; preds = %37
  br label %43

43:                                               ; preds = %42
  br label %44

44:                                               ; preds = %43
  %45 = load ptr, ptr %6, align 8, !tbaa !5
  %46 = icmp ne ptr %45, null
  br i1 %46, label %78, label %47

47:                                               ; preds = %44
  br label %48

48:                                               ; preds = %47
  br label %49

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

58:                                               ; preds = %49
  %59 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %60 = getelementptr inbounds %struct.s2n_debug_info, ptr %59, i32 0, i32 0
  %61 = load ptr, ptr %60, align 8, !tbaa !12
  %62 = getelementptr inbounds i8, ptr %61, i64 21
  %63 = call ptr @strrchr(ptr noundef %62, i32 noundef 47) #10
  %64 = getelementptr inbounds i8, ptr %63, i64 1
  br label %70

65:                                               ; preds = %49
  %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
  %68 = load ptr, ptr %67, align 8, !tbaa !12
  %69 = getelementptr inbounds i8, ptr %68, i64 21
  br label %70

70:                                               ; preds = %65, %58
  %71 = phi ptr [ %64, %58 ], [ %69, %65 ]
  %72 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %73 = getelementptr inbounds %struct.s2n_debug_info, ptr %72, i32 0, i32 1
  store ptr %71, ptr %73, align 8, !tbaa !14
  %74 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653193, ptr %74, align 4, !tbaa !15
  %75 = call i32 @s2n_calculate_stacktrace()
  br label %76

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

77:                                               ; No predecessors!
  br label %78

78:                                               ; preds = %77, %44
  br label %79

79:                                               ; preds = %78
  call void @llvm.lifetime.start.p0(i64 24, ptr %10) #11
  call void @llvm.memset.p0.i64(ptr align 8 %10, i8 0, i64 24, i1 false)
  %80 = getelementptr inbounds %struct.s2n_va_list, ptr %10, i32 0, i32 0
  %81 = getelementptr inbounds [1 x %struct.__va_list_tag], ptr %80, i64 0, i64 0
  %82 = load ptr, ptr %7, align 8, !tbaa !5
  call void @llvm.va_copy.p0(ptr %81, ptr %82)
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #11
  %83 = load ptr, ptr %6, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.s2n_va_list, ptr %10, i32 0, i32 0
  %85 = getelementptr inbounds [1 x %struct.__va_list_tag], ptr %84, i64 0, i64 0
  %86 = call i32 @vsnprintf(ptr noundef null, i64 noundef 0, ptr noundef %83, ptr noundef %85) #11
  store i32 %86, ptr %11, align 4, !tbaa !15
  br label %87

87:                                               ; preds = %79
  %88 = load i32, ptr %11, align 4, !tbaa !15
  %89 = icmp sge i32 %88, 0
  br i1 %89, label %123, label %90

90:                                               ; preds = %87
  br label %91

91:                                               ; preds = %90
  br label %92

92:                                               ; preds = %91
  %93 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %94 = getelementptr inbounds %struct.s2n_debug_info, ptr %93, i32 0, i32 0
  store ptr @.str.11, ptr %94, align 8, !tbaa !12
  %95 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %96 = getelementptr inbounds %struct.s2n_debug_info, ptr %95, i32 0, i32 0
  %97 = load ptr, ptr %96, align 8, !tbaa !12
  %98 = getelementptr inbounds i8, ptr %97, i64 21
  %99 = call ptr @strrchr(ptr noundef %98, i32 noundef 47) #10
  %100 = icmp ne ptr %99, null
  br i1 %100, label %101, label %108

101:                                              ; preds = %92
  %102 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %103 = getelementptr inbounds %struct.s2n_debug_info, ptr %102, i32 0, i32 0
  %104 = load ptr, ptr %103, align 8, !tbaa !12
  %105 = getelementptr inbounds i8, ptr %104, i64 21
  %106 = call ptr @strrchr(ptr noundef %105, i32 noundef 47) #10
  %107 = getelementptr inbounds i8, ptr %106, i64 1
  br label %113

108:                                              ; preds = %92
  %109 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %110 = getelementptr inbounds %struct.s2n_debug_info, ptr %109, i32 0, i32 0
  %111 = load ptr, ptr %110, align 8, !tbaa !12
  %112 = getelementptr inbounds i8, ptr %111, i64 21
  br label %113

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

119:                                              ; preds = %113
  br label %120

120:                                              ; preds = %119
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %12, align 4
  br label %288

121:                                              ; No predecessors!
  br label %122

122:                                              ; preds = %121
  br label %123

123:                                              ; preds = %122, %87
  br label %124

124:                                              ; preds = %123
  br label %125

125:                                              ; preds = %124
  br label %126

126:                                              ; preds = %125
  %127 = load i32, ptr %11, align 4, !tbaa !15
  %128 = icmp slt i32 %127, 2147483647
  br i1 %128, label %162, label %129

129:                                              ; preds = %126
  br label %130

130:                                              ; preds = %129
  br label %131

131:                                              ; preds = %130
  %132 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %133 = getelementptr inbounds %struct.s2n_debug_info, ptr %132, i32 0, i32 0
  store ptr @.str.12, ptr %133, align 8, !tbaa !12
  %134 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %135 = getelementptr inbounds %struct.s2n_debug_info, ptr %134, i32 0, i32 0
  %136 = load ptr, ptr %135, align 8, !tbaa !12
  %137 = getelementptr inbounds i8, ptr %136, i64 21
  %138 = call ptr @strrchr(ptr noundef %137, i32 noundef 47) #10
  %139 = icmp ne ptr %138, null
  br i1 %139, label %140, label %147

140:                                              ; preds = %131
  %141 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %142 = getelementptr inbounds %struct.s2n_debug_info, ptr %141, i32 0, i32 0
  %143 = load ptr, ptr %142, align 8, !tbaa !12
  %144 = getelementptr inbounds i8, ptr %143, i64 21
  %145 = call ptr @strrchr(ptr noundef %144, i32 noundef 47) #10
  %146 = getelementptr inbounds i8, ptr %145, i64 1
  br label %152

147:                                              ; preds = %131
  %148 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %149 = getelementptr inbounds %struct.s2n_debug_info, ptr %148, i32 0, i32 0
  %150 = load ptr, ptr %149, align 8, !tbaa !12
  %151 = getelementptr inbounds i8, ptr %150, i64 21
  br label %152

152:                                              ; preds = %147, %140
  %153 = phi ptr [ %146, %140 ], [ %151, %147 ]
  %154 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %155 = getelementptr inbounds %struct.s2n_debug_info, ptr %154, i32 0, i32 1
  store ptr %153, ptr %155, align 8, !tbaa !14
  %156 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653194, ptr %156, align 4, !tbaa !15
  %157 = call i32 @s2n_calculate_stacktrace()
  br label %158

158:                                              ; preds = %152
  br label %159

159:                                              ; preds = %158
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %12, align 4
  br label %288

160:                                              ; No predecessors!
  br label %161

161:                                              ; preds = %160
  br label %162

162:                                              ; preds = %161, %126
  br label %163

163:                                              ; preds = %162
  br label %164

164:                                              ; preds = %163
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #11
  %165 = load i32, ptr %11, align 4, !tbaa !15
  %166 = add nsw i32 %165, 1
  store i32 %166, ptr %13, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 1, ptr %14) #11
  %167 = load ptr, ptr %5, align 8, !tbaa !5
  %168 = getelementptr inbounds %struct.s2n_stuffer, ptr %167, i32 0, i32 4
  %169 = load i8, ptr %168, align 4
  %170 = lshr i8 %169, 2
  %171 = and i8 %170, 1
  %172 = zext i8 %171 to i32
  %173 = icmp ne i32 %172, 0
  %174 = zext i1 %173 to i8
  store i8 %174, ptr %14, align 1, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #11
  %175 = load ptr, ptr %5, align 8, !tbaa !5
  %176 = load i32, ptr %13, align 4, !tbaa !15
  %177 = call ptr @s2n_stuffer_raw_write(ptr noundef %175, i32 noundef %176)
  store ptr %177, ptr %15, align 8, !tbaa !5
  %178 = load i8, ptr %14, align 1, !tbaa !16, !range !18, !noundef !19
  %179 = trunc i8 %178 to i1
  %180 = zext i1 %179 to i32
  %181 = load ptr, ptr %5, align 8, !tbaa !5
  %182 = getelementptr inbounds %struct.s2n_stuffer, ptr %181, i32 0, i32 4
  %183 = trunc i32 %180 to i8
  %184 = load i8, ptr %182, align 4
  %185 = and i8 %183, 1
  %186 = shl i8 %185, 2
  %187 = and i8 %184, -5
  %188 = or i8 %187, %186
  store i8 %188, ptr %182, align 4
  %189 = zext i8 %185 to i32
  br label %190

190:                                              ; preds = %164
  %191 = load ptr, ptr %15, align 8, !tbaa !5
  %192 = icmp ne ptr %191, null
  br i1 %192, label %194, label %193

193:                                              ; preds = %190
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %12, align 4
  br label %287

194:                                              ; preds = %190
  br label %195

195:                                              ; preds = %194
  br label %196

196:                                              ; preds = %195
  call void @llvm.lifetime.start.p0(i64 24, ptr %16) #11
  call void @llvm.memset.p0.i64(ptr align 8 %16, i8 0, i64 24, i1 false)
  %197 = getelementptr inbounds %struct.s2n_va_list, ptr %16, i32 0, i32 0
  %198 = getelementptr inbounds [1 x %struct.__va_list_tag], ptr %197, i64 0, i64 0
  %199 = load ptr, ptr %7, align 8, !tbaa !5
  call void @llvm.va_copy.p0(ptr %198, ptr %199)
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #11
  %200 = load ptr, ptr %15, align 8, !tbaa !5
  %201 = load i32, ptr %13, align 4, !tbaa !15
  %202 = sext i32 %201 to i64
  %203 = load ptr, ptr %6, align 8, !tbaa !5
  %204 = getelementptr inbounds %struct.s2n_va_list, ptr %16, i32 0, i32 0
  %205 = getelementptr inbounds [1 x %struct.__va_list_tag], ptr %204, i64 0, i64 0
  %206 = call i32 @vsnprintf(ptr noundef %200, i64 noundef %202, ptr noundef %203, ptr noundef %205) #11
  store i32 %206, ptr %17, align 4, !tbaa !15
  %207 = load i32, ptr %17, align 4, !tbaa !15
  %208 = load i32, ptr %11, align 4, !tbaa !15
  %209 = icmp ne i32 %207, %208
  br i1 %209, label %210, label %252

210:                                              ; preds = %196
  br label %211

211:                                              ; preds = %210
  %212 = load ptr, ptr %5, align 8, !tbaa !5
  %213 = load i32, ptr %13, align 4, !tbaa !15
  %214 = call i32 @s2n_stuffer_wipe_n(ptr noundef %212, i32 noundef %213)
  %215 = icmp sgt i32 %214, -1
  br i1 %215, label %217, label %216

216:                                              ; preds = %211
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %12, align 4
  br label %286

217:                                              ; preds = %211
  br label %218

218:                                              ; preds = %217
  br label %219

219:                                              ; preds = %218
  br label %220

220:                                              ; preds = %219
  br label %221

221:                                              ; preds = %220
  %222 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %223 = getelementptr inbounds %struct.s2n_debug_info, ptr %222, i32 0, i32 0
  store ptr @.str.13, ptr %223, align 8, !tbaa !12
  %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 0
  %226 = load ptr, ptr %225, align 8, !tbaa !12
  %227 = getelementptr inbounds i8, ptr %226, i64 21
  %228 = call ptr @strrchr(ptr noundef %227, i32 noundef 47) #10
  %229 = icmp ne ptr %228, null
  br i1 %229, label %230, label %237

230:                                              ; preds = %221
  %231 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %232 = getelementptr inbounds %struct.s2n_debug_info, ptr %231, i32 0, i32 0
  %233 = load ptr, ptr %232, align 8, !tbaa !12
  %234 = getelementptr inbounds i8, ptr %233, i64 21
  %235 = call ptr @strrchr(ptr noundef %234, i32 noundef 47) #10
  %236 = getelementptr inbounds i8, ptr %235, i64 1
  br label %242

237:                                              ; preds = %221
  %238 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %239 = getelementptr inbounds %struct.s2n_debug_info, ptr %238, i32 0, i32 0
  %240 = load ptr, ptr %239, align 8, !tbaa !12
  %241 = getelementptr inbounds i8, ptr %240, i64 21
  br label %242

242:                                              ; preds = %237, %230
  %243 = phi ptr [ %236, %230 ], [ %241, %237 ]
  %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 1
  store ptr %243, ptr %245, align 8, !tbaa !14
  %246 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653194, ptr %246, align 4, !tbaa !15
  %247 = call i32 @s2n_calculate_stacktrace()
  br label %248

248:                                              ; preds = %242
  br label %249

249:                                              ; preds = %248
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %12, align 4
  br label %286

250:                                              ; No predecessors!
  br label %251

251:                                              ; preds = %250
  br label %252

252:                                              ; preds = %251, %196
  br label %253

253:                                              ; preds = %252
  %254 = load ptr, ptr %5, align 8, !tbaa !5
  %255 = call i32 @s2n_stuffer_wipe_n(ptr noundef %254, i32 noundef 1)
  %256 = icmp sgt i32 %255, -1
  br i1 %256, label %258, label %257

257:                                              ; preds = %253
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %12, align 4
  br label %286

258:                                              ; preds = %253
  br label %259

259:                                              ; preds = %258
  br label %260

260:                                              ; preds = %259
  br label %261

261:                                              ; preds = %260
  %262 = load ptr, ptr %5, align 8, !tbaa !5
  %263 = call i32 @s2n_stuffer_validate(ptr noundef %262)
  %264 = getelementptr inbounds %struct.s2n_result, ptr %19, i32 0, i32 0
  store i32 %263, ptr %264, align 4
  %265 = getelementptr inbounds %struct.s2n_result, ptr %19, i32 0, i32 0
  %266 = load i32, ptr %265, align 4
  %267 = call zeroext i1 @s2n_result_is_ok(i32 %266)
  %268 = xor i1 %267, true
  %269 = xor i1 %268, true
  %270 = zext i1 %269 to i32
  %271 = sext i32 %270 to i64
  %272 = call i64 @llvm.expect.i64(i64 %271, i64 1)
  %273 = icmp ne i64 %272, 0
  br i1 %273, label %274, label %276

274:                                              ; preds = %261
  %275 = getelementptr inbounds %struct.s2n_result, ptr %18, i32 0, i32 0
  store i32 0, ptr %275, align 4, !tbaa !9
  br label %278

276:                                              ; preds = %261
  %277 = getelementptr inbounds %struct.s2n_result, ptr %18, i32 0, i32 0
  store i32 -1, ptr %277, align 4, !tbaa !9
  br label %278

278:                                              ; preds = %276, %274
  %279 = getelementptr inbounds %struct.s2n_result, ptr %18, i32 0, i32 0
  %280 = load i32, ptr %279, align 4
  %281 = call zeroext i1 @s2n_result_is_ok(i32 %280)
  br i1 %281, label %283, label %282

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

283:                                              ; preds = %278
  br label %284

284:                                              ; preds = %283
  br label %285

285:                                              ; preds = %284
  store i32 0, ptr %4, align 4
  store i32 1, ptr %12, align 4
  br label %286

286:                                              ; preds = %285, %282, %257, %249, %216
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #11
  call void @s2n_va_list_cleanup(ptr noundef %16)
  call void @llvm.lifetime.end.p0(i64 24, ptr %16) #11
  br label %287

287:                                              ; preds = %286, %193
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #11
  call void @llvm.lifetime.end.p0(i64 1, ptr %14) #11
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #11
  br label %288

288:                                              ; preds = %287, %159, %120
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #11
  call void @s2n_va_list_cleanup(ptr noundef %10)
  call void @llvm.lifetime.end.p0(i64 24, ptr %10) #11
  br label %289

289:                                              ; preds = %288, %76, %41
  %290 = load i32, ptr %4, align 4
  ret i32 %290
}

; Function Attrs: nounwind uwtable
declare hidden void @s2n_va_list_cleanup(ptr noundef) #7

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare void @llvm.va_copy.p0(ptr, ptr) #8

; Function Attrs: nounwind
declare i32 @vsnprintf(ptr noundef, i64 noundef, ptr noundef, ptr noundef) #9

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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(none) }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { 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 #6 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #7 = { 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 #8 = { nocallback nofree nosync nounwind willreturn }
attributes #9 = { nounwind "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 #10 = { nounwind willreturn memory(read) }
attributes #11 = { 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, !11, i64 0}
!10 = !{!"", !11, i64 0}
!11 = !{!"int", !7, i64 0}
!12 = !{!13, !6, i64 0}
!13 = !{!"s2n_debug_info", !6, i64 0, !6, i64 8}
!14 = !{!13, !6, i64 8}
!15 = !{!11, !11, i64 0}
!16 = !{!17, !17, i64 0}
!17 = !{!"_Bool", !7, i64 0}
!18 = !{i8 0, i8 2}
!19 = !{}


; 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_va_list = type { [1 x %struct.__va_list_tag] }
%struct.__va_list_tag = type { i32, i32, 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.10 = external hidden unnamed_addr constant [97 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [97 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [97 x i8], align 1
@.str.13 = 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: inlinehint nounwind uwtable
declare hidden zeroext i1 @s2n_result_is_ok(i32) local_unnamed_addr #1

declare i32 @s2n_stuffer_validate(ptr noundef) local_unnamed_addr #2

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

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

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

declare i32 @s2n_calculate_stacktrace() local_unnamed_addr #2

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

; Function Attrs: nounwind uwtable
define dso_local range(i32 -1, 1) i32 @s2n_stuffer_vprintf(ptr noundef %0, ptr noundef readonly %1, ptr noundef %2) local_unnamed_addr #6 {
  %4 = alloca %struct.s2n_va_list, align 8
  %5 = alloca %struct.s2n_va_list, align 8
  %6 = tail call i32 @s2n_stuffer_validate(ptr noundef %0) #9
  %7 = tail call zeroext i1 @s2n_result_is_ok(i32 %6)
  %not. = xor i1 %7, true
  %. = sext i1 %not. to i32
  %8 = tail call zeroext i1 @s2n_result_is_ok(i32 %.)
  br i1 %8, label %9, label %69

9:                                                ; preds = %3
  %.not = icmp eq ptr %1, null
  br i1 %.not, label %10, label %18

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

18:                                               ; preds = %9
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #9
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %4, i8 0, i64 24, i1 false)
  call void @llvm.va_copy.p0(ptr nonnull %4, ptr %2)
  %19 = call i32 @vsnprintf(ptr noundef null, i64 noundef 0, ptr noundef nonnull %1, ptr noundef nonnull %4) #9
  %20 = icmp sgt i32 %19, -1
  br i1 %20, label %29, label %21

21:                                               ; preds = %18
  %22 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr @.str.11, ptr %22, align 8, !tbaa !5
  %23 = call ptr @strrchr(ptr noundef nonnull dereferenceable(1) getelementptr inbounds (i8, ptr @.str.11, i64 21), i32 noundef 47) #10
  %.not34 = icmp eq ptr %23, null
  %24 = getelementptr inbounds i8, ptr %23, i64 1
  %25 = select i1 %.not34, ptr getelementptr inbounds (i8, ptr @.str.11, i64 21), ptr %24
  %26 = getelementptr inbounds i8, ptr %22, i64 8
  store ptr %25, ptr %26, align 8, !tbaa !10
  %27 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653194, ptr %27, align 4, !tbaa !11
  %28 = call i32 @s2n_calculate_stacktrace() #9
  br label %68

29:                                               ; preds = %18
  %.not35 = icmp eq i32 %19, 2147483647
  br i1 %.not35, label %30, label %38

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

38:                                               ; preds = %29
  %39 = add nuw nsw i32 %19, 1
  %40 = getelementptr inbounds i8, ptr %0, i64 36
  %41 = load i8, ptr %40, align 4
  %42 = call ptr @s2n_stuffer_raw_write(ptr noundef %0, i32 noundef %39) #9
  %.lobit = and i8 %41, 4
  %43 = load i8, ptr %40, align 4
  %44 = and i8 %43, -5
  %45 = or disjoint i8 %44, %.lobit
  store i8 %45, ptr %40, align 4
  %.not37 = icmp eq ptr %42, null
  br i1 %.not37, label %68, label %46

46:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #9
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %5, i8 0, i64 24, i1 false)
  call void @llvm.va_copy.p0(ptr nonnull %5, ptr %2)
  %47 = zext nneg i32 %39 to i64
  %48 = call i32 @vsnprintf(ptr noundef nonnull %42, i64 noundef %47, ptr noundef nonnull %1, ptr noundef nonnull %5) #9
  %.not38 = icmp eq i32 %48, %19
  br i1 %.not38, label %60, label %49

49:                                               ; preds = %46
  %50 = call i32 @s2n_stuffer_wipe_n(ptr noundef nonnull %0, i32 noundef %39) #9
  %51 = icmp sgt i32 %50, -1
  br i1 %51, label %52, label %67

52:                                               ; preds = %49
  %53 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr @.str.13, ptr %53, align 8, !tbaa !5
  %54 = call ptr @strrchr(ptr noundef nonnull dereferenceable(1) getelementptr inbounds (i8, ptr @.str.13, i64 21), i32 noundef 47) #10
  %.not39 = icmp eq ptr %54, null
  %55 = getelementptr inbounds i8, ptr %54, i64 1
  %56 = select i1 %.not39, ptr getelementptr inbounds (i8, ptr @.str.13, i64 21), ptr %55
  %57 = getelementptr inbounds i8, ptr %53, i64 8
  store ptr %56, ptr %57, align 8, !tbaa !10
  %58 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653194, ptr %58, align 4, !tbaa !11
  %59 = call i32 @s2n_calculate_stacktrace() #9
  br label %67

60:                                               ; preds = %46
  %61 = call i32 @s2n_stuffer_wipe_n(ptr noundef nonnull %0, i32 noundef 1) #9
  %62 = icmp sgt i32 %61, -1
  br i1 %62, label %63, label %67

63:                                               ; preds = %60
  %64 = call i32 @s2n_stuffer_validate(ptr noundef nonnull %0) #9
  %65 = call zeroext i1 @s2n_result_is_ok(i32 %64)
  %not.41 = xor i1 %65, true
  %.40 = sext i1 %not.41 to i32
  %66 = call zeroext i1 @s2n_result_is_ok(i32 %.40)
  %not.42 = xor i1 %66, true
  %spec.select = sext i1 %not.42 to i32
  br label %67

67:                                               ; preds = %63, %60, %49, %52
  %.0 = phi i32 [ -1, %52 ], [ -1, %49 ], [ -1, %60 ], [ %spec.select, %63 ]
  call void @s2n_va_list_cleanup(ptr noundef nonnull %5)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #9
  br label %68

68:                                               ; preds = %67, %38, %30, %21
  %.2 = phi i32 [ -1, %30 ], [ -1, %21 ], [ %.0, %67 ], [ -1, %38 ]
  call void @s2n_va_list_cleanup(ptr noundef nonnull %4)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #9
  br label %69

69:                                               ; preds = %3, %68, %10
  %.3 = phi i32 [ %.2, %68 ], [ -1, %10 ], [ -1, %3 ]
  ret i32 %.3
}

; Function Attrs: nounwind uwtable
declare hidden void @s2n_va_list_cleanup(ptr noundef) local_unnamed_addr #6

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.va_copy.p0(ptr, ptr) #7

; Function Attrs: nofree nounwind
declare noundef i32 @vsnprintf(ptr nocapture noundef, i64 noundef, ptr nocapture noundef readonly, ptr noundef) local_unnamed_addr #8

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 speculatable willreturn memory(none) }
attributes #4 = { 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 #5 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #8 = { nofree nounwind "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 #9 = { nounwind }
attributes #10 = { nounwind willreturn memory(read) }

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

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


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