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

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

@.str = external hidden unnamed_addr constant [98 x i8], align 1
@_s2n_debug_info = external thread_local global %struct.s2n_debug_info, align 8
@s2n_errno = external thread_local global i32, align 4
@.str.1 = external hidden unnamed_addr constant [98 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 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 @s2n_stuffer_read_base64(ptr noundef %0, ptr noundef %1) #1 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca %struct.s2n_result, align 4
  %7 = alloca %struct.s2n_result, align 4
  %8 = alloca %struct.s2n_result, align 4
  %9 = alloca %struct.s2n_result, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca ptr, align 8
  %18 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  br label %19

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

32:                                               ; preds = %19
  %33 = getelementptr inbounds %struct.s2n_result, ptr %6, i32 0, i32 0
  store i32 0, ptr %33, align 4, !tbaa !9
  br label %36

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

36:                                               ; preds = %34, %32
  %37 = getelementptr inbounds %struct.s2n_result, ptr %6, i32 0, i32 0
  %38 = load i32, ptr %37, align 4
  %39 = call zeroext i1 @s2n_result_is_ok(i32 %38)
  br i1 %39, label %41, label %40

40:                                               ; preds = %36
  store i32 -1, ptr %3, align 4
  br label %248

41:                                               ; preds = %36
  br label %42

42:                                               ; preds = %41
  br label %43

43:                                               ; preds = %42
  %44 = load ptr, ptr %5, align 8, !tbaa !5
  %45 = call i32 @s2n_stuffer_validate(ptr noundef %44)
  %46 = getelementptr inbounds %struct.s2n_result, ptr %9, i32 0, i32 0
  store i32 %45, ptr %46, align 4
  %47 = getelementptr inbounds %struct.s2n_result, ptr %9, i32 0, i32 0
  %48 = load i32, ptr %47, align 4
  %49 = call zeroext i1 @s2n_result_is_ok(i32 %48)
  %50 = xor i1 %49, true
  %51 = xor i1 %50, true
  %52 = zext i1 %51 to i32
  %53 = sext i32 %52 to i64
  %54 = call i64 @llvm.expect.i64(i64 %53, i64 1)
  %55 = icmp ne i64 %54, 0
  br i1 %55, label %56, label %58

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

58:                                               ; preds = %43
  %59 = getelementptr inbounds %struct.s2n_result, ptr %8, i32 0, i32 0
  store i32 -1, ptr %59, align 4, !tbaa !9
  br label %60

60:                                               ; preds = %58, %56
  %61 = getelementptr inbounds %struct.s2n_result, ptr %8, i32 0, i32 0
  %62 = load i32, ptr %61, align 4
  %63 = call zeroext i1 @s2n_result_is_ok(i32 %62)
  br i1 %63, label %65, label %64

64:                                               ; preds = %60
  store i32 -1, ptr %3, align 4
  br label %248

65:                                               ; preds = %60
  br label %66

66:                                               ; preds = %65
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  %67 = load ptr, ptr %4, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.s2n_stuffer, ptr %67, i32 0, i32 2
  %69 = load i32, ptr %68, align 4, !tbaa !12
  %70 = load ptr, ptr %4, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.s2n_stuffer, ptr %70, i32 0, i32 1
  %72 = load i32, ptr %71, align 8, !tbaa !15
  %73 = sub i32 %69, %72
  %74 = udiv i32 %73, 4
  store i32 %74, ptr %10, align 4, !tbaa !16
  %75 = load i32, ptr %10, align 4, !tbaa !16
  %76 = icmp eq i32 %75, 0
  br i1 %76, label %77, label %78

77:                                               ; preds = %66
  store i32 0, ptr %3, align 4
  store i32 1, ptr %11, align 4
  br label %247

78:                                               ; preds = %66
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  %79 = load i32, ptr %10, align 4, !tbaa !16
  %80 = mul nsw i32 %79, 4
  store i32 %80, ptr %12, align 4, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  %81 = load i32, ptr %10, align 4, !tbaa !16
  %82 = mul nsw i32 %81, 3
  store i32 %82, ptr %13, align 4, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  %83 = load ptr, ptr %4, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.s2n_stuffer, ptr %83, i32 0, i32 1
  %85 = load i32, ptr %84, align 8, !tbaa !15
  store i32 %85, ptr %14, align 4, !tbaa !16
  br label %86

86:                                               ; preds = %78
  %87 = load ptr, ptr %4, align 8, !tbaa !5
  %88 = load i32, ptr %12, align 4, !tbaa !16
  %89 = call i32 @s2n_stuffer_skip_read(ptr noundef %87, i32 noundef %88)
  %90 = icmp sgt i32 %89, -1
  br i1 %90, label %92, label %91

91:                                               ; preds = %86
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %11, align 4
  br label %246

92:                                               ; preds = %86
  br label %93

93:                                               ; preds = %92
  br label %94

94:                                               ; preds = %93
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  %95 = load ptr, ptr %4, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.s2n_stuffer, ptr %95, i32 0, i32 0
  %97 = getelementptr inbounds %struct.s2n_blob, ptr %96, i32 0, i32 0
  %98 = load ptr, ptr %97, align 8, !tbaa !17
  %99 = load i32, ptr %14, align 4, !tbaa !16
  %100 = zext i32 %99 to i64
  %101 = getelementptr inbounds i8, ptr %98, i64 %100
  store ptr %101, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  %102 = load ptr, ptr %5, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.s2n_stuffer, ptr %102, i32 0, i32 2
  %104 = load i32, ptr %103, align 4, !tbaa !12
  store i32 %104, ptr %16, align 4, !tbaa !16
  br label %105

105:                                              ; preds = %94
  %106 = load ptr, ptr %5, align 8, !tbaa !5
  %107 = load i32, ptr %13, align 4, !tbaa !16
  %108 = call i32 @s2n_stuffer_skip_write(ptr noundef %106, i32 noundef %107)
  %109 = icmp sgt i32 %108, -1
  br i1 %109, label %111, label %110

110:                                              ; preds = %105
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %11, align 4
  br label %245

111:                                              ; preds = %105
  br label %112

112:                                              ; preds = %111
  br label %113

113:                                              ; preds = %112
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  %114 = load ptr, ptr %5, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.s2n_stuffer, ptr %114, i32 0, i32 0
  %116 = getelementptr inbounds %struct.s2n_blob, ptr %115, i32 0, i32 0
  %117 = load ptr, ptr %116, align 8, !tbaa !17
  %118 = load i32, ptr %16, align 4, !tbaa !16
  %119 = zext i32 %118 to i64
  %120 = getelementptr inbounds i8, ptr %117, i64 %119
  store ptr %120, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  %121 = load ptr, ptr %17, align 8, !tbaa !5
  %122 = load ptr, ptr %15, align 8, !tbaa !5
  %123 = load i32, ptr %12, align 4, !tbaa !16
  %124 = call i32 @EVP_DecodeBlock(ptr noundef %121, ptr noundef %122, i32 noundef %123)
  store i32 %124, ptr %18, align 4, !tbaa !16
  br label %125

125:                                              ; preds = %113
  %126 = load i32, ptr %18, align 4, !tbaa !16
  %127 = load i32, ptr %13, align 4, !tbaa !16
  %128 = icmp eq i32 %126, %127
  br i1 %128, label %162, label %129

129:                                              ; preds = %125
  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, ptr %133, align 8, !tbaa !18
  %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 !18
  %137 = getelementptr inbounds i8, ptr %136, i64 21
  %138 = call ptr @strrchr(ptr noundef %137, i32 noundef 47) #8
  %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 !18
  %144 = getelementptr inbounds i8, ptr %143, i64 21
  %145 = call ptr @strrchr(ptr noundef %144, i32 noundef 47) #8
  %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 !18
  %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 !20
  %156 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 469762055, ptr %156, align 4, !tbaa !16
  %157 = call i32 @s2n_calculate_stacktrace()
  br label %158

158:                                              ; preds = %152
  br label %159

159:                                              ; preds = %158
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %11, align 4
  br label %244

160:                                              ; No predecessors!
  br label %161

161:                                              ; preds = %160
  br label %162

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

163:                                              ; preds = %162
  br label %164

164:                                              ; preds = %163
  br label %165

165:                                              ; preds = %164
  %166 = load ptr, ptr %4, align 8, !tbaa !5
  %167 = getelementptr inbounds %struct.s2n_stuffer, ptr %166, i32 0, i32 1
  %168 = load i32, ptr %167, align 8, !tbaa !15
  %169 = icmp uge i32 %168, 2
  br i1 %169, label %203, label %170

170:                                              ; preds = %165
  br label %171

171:                                              ; preds = %170
  br label %172

172:                                              ; preds = %171
  %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 0
  store ptr @.str.1, ptr %174, align 8, !tbaa !18
  %175 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %176 = getelementptr inbounds %struct.s2n_debug_info, ptr %175, i32 0, i32 0
  %177 = load ptr, ptr %176, align 8, !tbaa !18
  %178 = getelementptr inbounds i8, ptr %177, i64 21
  %179 = call ptr @strrchr(ptr noundef %178, i32 noundef 47) #8
  %180 = icmp ne ptr %179, null
  br i1 %180, label %181, label %188

181:                                              ; preds = %172
  %182 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %183 = getelementptr inbounds %struct.s2n_debug_info, ptr %182, i32 0, i32 0
  %184 = load ptr, ptr %183, align 8, !tbaa !18
  %185 = getelementptr inbounds i8, ptr %184, i64 21
  %186 = call ptr @strrchr(ptr noundef %185, i32 noundef 47) #8
  %187 = getelementptr inbounds i8, ptr %186, i64 1
  br label %193

188:                                              ; preds = %172
  %189 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %190 = getelementptr inbounds %struct.s2n_debug_info, ptr %189, i32 0, i32 0
  %191 = load ptr, ptr %190, align 8, !tbaa !18
  %192 = getelementptr inbounds i8, ptr %191, i64 21
  br label %193

193:                                              ; preds = %188, %181
  %194 = phi ptr [ %187, %181 ], [ %192, %188 ]
  %195 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %196 = getelementptr inbounds %struct.s2n_debug_info, ptr %195, i32 0, i32 1
  store ptr %194, ptr %196, align 8, !tbaa !20
  %197 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653194, ptr %197, align 4, !tbaa !16
  %198 = call i32 @s2n_calculate_stacktrace()
  br label %199

199:                                              ; preds = %193
  br label %200

200:                                              ; preds = %199
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %11, align 4
  br label %244

201:                                              ; No predecessors!
  br label %202

202:                                              ; preds = %201
  br label %203

203:                                              ; preds = %202, %165
  br label %204

204:                                              ; preds = %203
  br label %205

205:                                              ; preds = %204
  %206 = load ptr, ptr %4, align 8, !tbaa !5
  %207 = getelementptr inbounds %struct.s2n_stuffer, ptr %206, i32 0, i32 0
  %208 = getelementptr inbounds %struct.s2n_blob, ptr %207, i32 0, i32 0
  %209 = load ptr, ptr %208, align 8, !tbaa !17
  %210 = load ptr, ptr %4, align 8, !tbaa !5
  %211 = getelementptr inbounds %struct.s2n_stuffer, ptr %210, i32 0, i32 1
  %212 = load i32, ptr %211, align 8, !tbaa !15
  %213 = sub i32 %212, 1
  %214 = zext i32 %213 to i64
  %215 = getelementptr inbounds i8, ptr %209, i64 %214
  %216 = load i8, ptr %215, align 1, !tbaa !21
  %217 = zext i8 %216 to i32
  %218 = icmp eq i32 %217, 61
  br i1 %218, label %219, label %224

219:                                              ; preds = %205
  %220 = load ptr, ptr %5, align 8, !tbaa !5
  %221 = getelementptr inbounds %struct.s2n_stuffer, ptr %220, i32 0, i32 2
  %222 = load i32, ptr %221, align 4, !tbaa !12
  %223 = sub i32 %222, 1
  store i32 %223, ptr %221, align 4, !tbaa !12
  br label %224

224:                                              ; preds = %219, %205
  %225 = load ptr, ptr %4, align 8, !tbaa !5
  %226 = getelementptr inbounds %struct.s2n_stuffer, ptr %225, i32 0, i32 0
  %227 = getelementptr inbounds %struct.s2n_blob, ptr %226, i32 0, i32 0
  %228 = load ptr, ptr %227, align 8, !tbaa !17
  %229 = load ptr, ptr %4, align 8, !tbaa !5
  %230 = getelementptr inbounds %struct.s2n_stuffer, ptr %229, i32 0, i32 1
  %231 = load i32, ptr %230, align 8, !tbaa !15
  %232 = sub i32 %231, 2
  %233 = zext i32 %232 to i64
  %234 = getelementptr inbounds i8, ptr %228, i64 %233
  %235 = load i8, ptr %234, align 1, !tbaa !21
  %236 = zext i8 %235 to i32
  %237 = icmp eq i32 %236, 61
  br i1 %237, label %238, label %243

238:                                              ; preds = %224
  %239 = load ptr, ptr %5, align 8, !tbaa !5
  %240 = getelementptr inbounds %struct.s2n_stuffer, ptr %239, i32 0, i32 2
  %241 = load i32, ptr %240, align 4, !tbaa !12
  %242 = sub i32 %241, 1
  store i32 %242, ptr %240, align 4, !tbaa !12
  br label %243

243:                                              ; preds = %238, %224
  store i32 0, ptr %3, align 4
  store i32 1, ptr %11, align 4
  br label %244

244:                                              ; preds = %243, %200, %159
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  br label %245

245:                                              ; preds = %244, %110
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  br label %246

246:                                              ; preds = %245, %91
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  br label %247

247:                                              ; preds = %246, %77
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %248

248:                                              ; preds = %247, %64, %40
  %249 = load i32, ptr %3, align 4
  ret i32 %249
}

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

declare i32 @s2n_stuffer_validate(ptr noundef) #3

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

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

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

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

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

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

declare i32 @s2n_calculate_stacktrace() #3

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

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

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


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

%struct.s2n_debug_info = type { ptr, ptr }

@.str = external hidden unnamed_addr constant [98 x i8], align 1
@_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.1 = external hidden unnamed_addr constant [98 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local range(i32 -1, 1) i32 @s2n_stuffer_read_base64(ptr noundef %0, ptr noundef %1) local_unnamed_addr #0 {
  %3 = tail call i32 @s2n_stuffer_validate(ptr noundef %0) #5
  %4 = tail call zeroext i1 @s2n_result_is_ok(i32 %3)
  %not. = xor i1 %4, true
  %. = sext i1 %not. to i32
  %5 = tail call zeroext i1 @s2n_result_is_ok(i32 %.)
  br i1 %5, label %6, label %75

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

10:                                               ; preds = %6
  %11 = getelementptr inbounds i8, ptr %0, i64 28
  %12 = load i32, ptr %11, align 4, !tbaa !5
  %13 = getelementptr inbounds i8, ptr %0, i64 24
  %14 = load i32, ptr %13, align 8, !tbaa !12
  %15 = sub i32 %12, %14
  %16 = icmp ult i32 %15, 4
  br i1 %16, label %75, label %17

17:                                               ; preds = %10
  %18 = lshr i32 %15, 2
  %19 = and i32 %15, -4
  %20 = mul nuw nsw i32 %18, 3
  %21 = tail call i32 @s2n_stuffer_skip_read(ptr noundef nonnull %0, i32 noundef %19) #5
  %22 = icmp sgt i32 %21, -1
  br i1 %22, label %23, label %75

23:                                               ; preds = %17
  %24 = load ptr, ptr %0, align 8, !tbaa !13
  %25 = getelementptr inbounds i8, ptr %1, i64 28
  %26 = load i32, ptr %25, align 4, !tbaa !5
  %27 = tail call i32 @s2n_stuffer_skip_write(ptr noundef %1, i32 noundef %20) #5
  %28 = icmp sgt i32 %27, -1
  br i1 %28, label %29, label %75

29:                                               ; preds = %23
  %30 = zext i32 %14 to i64
  %31 = getelementptr inbounds i8, ptr %24, i64 %30
  %32 = load ptr, ptr %1, align 8, !tbaa !13
  %33 = zext i32 %26 to i64
  %34 = getelementptr inbounds i8, ptr %32, i64 %33
  %35 = tail call i32 @EVP_DecodeBlock(ptr noundef %34, ptr noundef %31, i32 noundef %19) #5
  %36 = icmp eq i32 %35, %20
  br i1 %36, label %45, label %37

37:                                               ; preds = %29
  %38 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr @.str, ptr %38, align 8, !tbaa !14
  %39 = tail call ptr @strrchr(ptr noundef nonnull dereferenceable(1) getelementptr inbounds (i8, ptr @.str, i64 21), i32 noundef 47) #6
  %.not = icmp eq ptr %39, null
  %40 = getelementptr inbounds i8, ptr %39, i64 1
  %41 = select i1 %.not, ptr getelementptr inbounds (i8, ptr @.str, i64 21), ptr %40
  %42 = getelementptr inbounds i8, ptr %38, i64 8
  store ptr %41, ptr %42, align 8, !tbaa !16
  %43 = tail call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 469762055, ptr %43, align 4, !tbaa !17
  %44 = tail call i32 @s2n_calculate_stacktrace() #5
  br label %75

45:                                               ; preds = %29
  %46 = load i32, ptr %13, align 8, !tbaa !12
  %47 = icmp ugt i32 %46, 1
  br i1 %47, label %56, label %48

48:                                               ; preds = %45
  %49 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr @.str.1, ptr %49, align 8, !tbaa !14
  %50 = tail call ptr @strrchr(ptr noundef nonnull dereferenceable(1) getelementptr inbounds (i8, ptr @.str.1, i64 21), i32 noundef 47) #6
  %.not36 = icmp eq ptr %50, null
  %51 = getelementptr inbounds i8, ptr %50, i64 1
  %52 = select i1 %.not36, ptr getelementptr inbounds (i8, ptr @.str.1, i64 21), ptr %51
  %53 = getelementptr inbounds i8, ptr %49, i64 8
  store ptr %52, ptr %53, align 8, !tbaa !16
  %54 = tail call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 402653194, ptr %54, align 4, !tbaa !17
  %55 = tail call i32 @s2n_calculate_stacktrace() #5
  br label %75

56:                                               ; preds = %45
  %57 = load ptr, ptr %0, align 8, !tbaa !13
  %58 = add i32 %46, -1
  %59 = zext i32 %58 to i64
  %60 = getelementptr inbounds i8, ptr %57, i64 %59
  %61 = load i8, ptr %60, align 1, !tbaa !18
  %62 = icmp eq i8 %61, 61
  br i1 %62, label %63, label %66

63:                                               ; preds = %56
  %64 = load i32, ptr %25, align 4, !tbaa !5
  %65 = add i32 %64, -1
  store i32 %65, ptr %25, align 4, !tbaa !5
  br label %66

66:                                               ; preds = %63, %56
  %67 = add i32 %46, -2
  %68 = zext i32 %67 to i64
  %69 = getelementptr inbounds i8, ptr %57, i64 %68
  %70 = load i8, ptr %69, align 1, !tbaa !18
  %71 = icmp eq i8 %70, 61
  br i1 %71, label %72, label %75

72:                                               ; preds = %66
  %73 = load i32, ptr %25, align 4, !tbaa !5
  %74 = add i32 %73, -1
  store i32 %74, ptr %25, align 4, !tbaa !5
  br label %75

75:                                               ; preds = %10, %23, %66, %72, %48, %37, %17, %6, %2
  %.4 = phi i32 [ -1, %2 ], [ -1, %6 ], [ 0, %10 ], [ -1, %17 ], [ -1, %23 ], [ -1, %48 ], [ -1, %37 ], [ 0, %72 ], [ 0, %66 ]
  ret i32 %.4
}

; 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

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

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

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

; 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

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { 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 = { nounwind }
attributes #6 = { nounwind willreturn memory(read) }

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

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


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