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

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

@.str = external hidden unnamed_addr constant [83 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 [83 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [83 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [83 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 willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

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

14:                                               ; preds = %3
  %15 = load ptr, ptr %5, align 8, !tbaa !5
  %16 = icmp ne ptr %15, null
  br i1 %16, label %48, label %17

17:                                               ; preds = %14
  br label %18

18:                                               ; preds = %17
  br label %19

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

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

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

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

46:                                               ; preds = %40
  store i32 -1, ptr %4, align 4
  br label %227

47:                                               ; No predecessors!
  br label %48

48:                                               ; preds = %47, %14
  br label %49

49:                                               ; preds = %48
  br label %50

50:                                               ; preds = %49
  %51 = load ptr, ptr %5, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.s2n_crl, ptr %51, i32 0, i32 0
  %53 = load ptr, ptr %52, align 8, !tbaa !16
  %54 = icmp eq ptr %53, null
  br i1 %54, label %86, label %55

55:                                               ; preds = %50
  br label %56

56:                                               ; preds = %55
  br label %57

57:                                               ; preds = %56
  %58 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %59 = getelementptr inbounds %struct.s2n_debug_info, ptr %58, i32 0, i32 0
  store ptr @.str.1, ptr %59, align 8, !tbaa !11
  %60 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %61 = getelementptr inbounds %struct.s2n_debug_info, ptr %60, i32 0, i32 0
  %62 = load ptr, ptr %61, align 8, !tbaa !11
  %63 = getelementptr inbounds i8, ptr %62, i64 21
  %64 = call ptr @strrchr(ptr noundef %63, i32 noundef 47) #6
  %65 = icmp ne ptr %64, null
  br i1 %65, label %66, label %73

66:                                               ; preds = %57
  %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 !11
  %70 = getelementptr inbounds i8, ptr %69, i64 21
  %71 = call ptr @strrchr(ptr noundef %70, i32 noundef 47) #6
  %72 = getelementptr inbounds i8, ptr %71, i64 1
  br label %78

73:                                               ; preds = %57
  %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 !11
  %77 = getelementptr inbounds i8, ptr %76, i64 21
  br label %78

78:                                               ; preds = %73, %66
  %79 = phi ptr [ %72, %66 ], [ %77, %73 ]
  %80 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %81 = getelementptr inbounds %struct.s2n_debug_info, ptr %80, i32 0, i32 1
  store ptr %79, ptr %81, align 8, !tbaa !13
  %82 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 469762089, ptr %82, align 4, !tbaa !14
  %83 = call i32 @s2n_calculate_stacktrace()
  br label %84

84:                                               ; preds = %78
  store i32 -1, ptr %4, align 4
  br label %227

85:                                               ; No predecessors!
  br label %86

86:                                               ; preds = %85, %50
  br label %87

87:                                               ; preds = %86
  call void @llvm.lifetime.start.p0(i64 24, ptr %8) #7
  call void @llvm.memset.p0.i64(ptr align 8 %8, i8 0, i64 24, i1 false)
  br label %88

88:                                               ; preds = %87
  %89 = load ptr, ptr %6, align 8, !tbaa !5
  %90 = load i64, ptr %7, align 8, !tbaa !9
  %91 = trunc i64 %90 to i32
  %92 = call i32 @s2n_blob_init(ptr noundef %8, ptr noundef %89, i32 noundef %91)
  %93 = icmp sgt i32 %92, -1
  br i1 %93, label %95, label %94

94:                                               ; preds = %88
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %226

95:                                               ; preds = %88
  br label %96

96:                                               ; preds = %95
  br label %97

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

98:                                               ; preds = %97
  %99 = call i32 @s2n_stuffer_init(ptr noundef %10, ptr noundef %8)
  %100 = icmp sgt i32 %99, -1
  br i1 %100, label %102, label %101

101:                                              ; preds = %98
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %225

102:                                              ; preds = %98
  br label %103

103:                                              ; preds = %102
  br label %104

104:                                              ; preds = %103
  br label %105

105:                                              ; preds = %104
  %106 = getelementptr inbounds %struct.s2n_blob, ptr %8, i32 0, i32 1
  %107 = load i32, ptr %106, align 8, !tbaa !18
  %108 = call i32 @s2n_stuffer_skip_write(ptr noundef %10, i32 noundef %107)
  %109 = icmp sgt i32 %108, -1
  br i1 %109, label %111, label %110

110:                                              ; preds = %105
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %225

111:                                              ; preds = %105
  br label %112

112:                                              ; preds = %111
  br label %113

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

114:                                              ; preds = %113
  %115 = load i64, ptr %7, align 8, !tbaa !9
  %116 = trunc i64 %115 to i32
  %117 = call i32 @s2n_stuffer_growable_alloc(ptr noundef %11, i32 noundef %116)
  %118 = icmp sgt i32 %117, -1
  br i1 %118, label %120, label %119

119:                                              ; preds = %114
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %223

120:                                              ; preds = %114
  br label %121

121:                                              ; preds = %120
  br label %122

122:                                              ; preds = %121
  br label %123

123:                                              ; preds = %122
  %124 = call i32 @s2n_stuffer_crl_from_pem(ptr noundef %10, ptr noundef %11)
  %125 = icmp sgt i32 %124, -1
  br i1 %125, label %127, label %126

126:                                              ; preds = %123
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %223

127:                                              ; preds = %123
  br label %128

128:                                              ; preds = %127
  br label %129

129:                                              ; preds = %128
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  %130 = getelementptr inbounds %struct.s2n_stuffer, ptr %11, i32 0, i32 2
  %131 = load i32, ptr %130, align 4, !tbaa !20
  %132 = getelementptr inbounds %struct.s2n_stuffer, ptr %11, i32 0, i32 1
  %133 = load i32, ptr %132, align 8, !tbaa !22
  %134 = sub i32 %131, %133
  store i32 %134, ptr %12, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  %135 = load i32, ptr %12, align 4, !tbaa !14
  %136 = call ptr @s2n_stuffer_raw_read(ptr noundef %11, i32 noundef %135)
  store ptr %136, ptr %13, align 8, !tbaa !5
  br label %137

137:                                              ; preds = %129
  %138 = load ptr, ptr %13, align 8, !tbaa !5
  %139 = icmp ne ptr %138, null
  br i1 %139, label %173, label %140

140:                                              ; preds = %137
  br label %141

141:                                              ; preds = %140
  br label %142

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

151:                                              ; preds = %142
  %152 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %153 = getelementptr inbounds %struct.s2n_debug_info, ptr %152, i32 0, i32 0
  %154 = load ptr, ptr %153, align 8, !tbaa !11
  %155 = getelementptr inbounds i8, ptr %154, i64 21
  %156 = call ptr @strrchr(ptr noundef %155, i32 noundef 47) #6
  %157 = getelementptr inbounds i8, ptr %156, i64 1
  br label %163

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

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

169:                                              ; preds = %163
  br label %170

170:                                              ; preds = %169
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %222

171:                                              ; No predecessors!
  br label %172

172:                                              ; preds = %171
  br label %173

173:                                              ; preds = %172, %137
  br label %174

174:                                              ; preds = %173
  br label %175

175:                                              ; preds = %174
  %176 = load i32, ptr %12, align 4, !tbaa !14
  %177 = zext i32 %176 to i64
  %178 = call ptr @d2i_X509_CRL(ptr noundef null, ptr noundef %13, i64 noundef %177)
  %179 = load ptr, ptr %5, align 8, !tbaa !5
  %180 = getelementptr inbounds %struct.s2n_crl, ptr %179, i32 0, i32 0
  store ptr %178, ptr %180, align 8, !tbaa !16
  br label %181

181:                                              ; preds = %175
  %182 = load ptr, ptr %5, align 8, !tbaa !5
  %183 = getelementptr inbounds %struct.s2n_crl, ptr %182, i32 0, i32 0
  %184 = load ptr, ptr %183, align 8, !tbaa !16
  %185 = icmp ne ptr %184, null
  br i1 %185, label %219, label %186

186:                                              ; preds = %181
  br label %187

187:                                              ; preds = %186
  br label %188

188:                                              ; preds = %187
  %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
  store ptr @.str.3, ptr %190, align 8, !tbaa !11
  %191 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %192 = getelementptr inbounds %struct.s2n_debug_info, ptr %191, i32 0, i32 0
  %193 = load ptr, ptr %192, align 8, !tbaa !11
  %194 = getelementptr inbounds i8, ptr %193, i64 21
  %195 = call ptr @strrchr(ptr noundef %194, i32 noundef 47) #6
  %196 = icmp ne ptr %195, null
  br i1 %196, label %197, label %204

197:                                              ; preds = %188
  %198 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %199 = getelementptr inbounds %struct.s2n_debug_info, ptr %198, i32 0, i32 0
  %200 = load ptr, ptr %199, align 8, !tbaa !11
  %201 = getelementptr inbounds i8, ptr %200, i64 21
  %202 = call ptr @strrchr(ptr noundef %201, i32 noundef 47) #6
  %203 = getelementptr inbounds i8, ptr %202, i64 1
  br label %209

204:                                              ; preds = %188
  %205 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %206 = getelementptr inbounds %struct.s2n_debug_info, ptr %205, i32 0, i32 0
  %207 = load ptr, ptr %206, align 8, !tbaa !11
  %208 = getelementptr inbounds i8, ptr %207, i64 21
  br label %209

209:                                              ; preds = %204, %197
  %210 = phi ptr [ %203, %197 ], [ %208, %204 ]
  %211 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  %212 = getelementptr inbounds %struct.s2n_debug_info, ptr %211, i32 0, i32 1
  store ptr %210, ptr %212, align 8, !tbaa !13
  %213 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 469762057, ptr %213, align 4, !tbaa !14
  %214 = call i32 @s2n_calculate_stacktrace()
  br label %215

215:                                              ; preds = %209
  br label %216

216:                                              ; preds = %215
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %222

217:                                              ; No predecessors!
  br label %218

218:                                              ; preds = %217
  br label %219

219:                                              ; preds = %218, %181
  br label %220

220:                                              ; preds = %219
  br label %221

221:                                              ; preds = %220
  store i32 0, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %222

222:                                              ; preds = %221, %216, %170
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  br label %223

223:                                              ; preds = %222, %126, %119
  %224 = call i32 @s2n_stuffer_free(ptr noundef %11)
  call void @llvm.lifetime.end.p0(i64 40, ptr %11) #7
  br label %225

225:                                              ; preds = %223, %110, %101
  call void @llvm.lifetime.end.p0(i64 40, ptr %10) #7
  br label %226

226:                                              ; preds = %225, %94
  call void @llvm.lifetime.end.p0(i64 24, ptr %8) #7
  br label %227

227:                                              ; preds = %226, %84, %46
  %228 = load i32, ptr %4, align 4
  ret i32 %228
}

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

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

declare i32 @s2n_calculate_stacktrace() #5

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

declare i32 @s2n_stuffer_init(ptr noundef, ptr noundef) #5

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

declare i32 @s2n_stuffer_free(ptr noundef) #5

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

declare i32 @s2n_stuffer_crl_from_pem(ptr noundef, ptr noundef) #5

declare ptr @s2n_stuffer_raw_read(ptr noundef, i32 noundef) #5

declare ptr @d2i_X509_CRL(ptr noundef, ptr noundef, i64 noundef) #5

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

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

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


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

@.str = external hidden unnamed_addr constant [83 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 [83 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [83 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [83 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 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 @s2n_crl_load_pem(ptr noundef %0, ptr noundef %1, i64 noundef %2) local_unnamed_addr #2 {
  %4 = alloca %struct.s2n_blob, align 8
  %5 = alloca %struct.s2n_stuffer, align 8
  %6 = alloca %struct.s2n_stuffer, align 8
  %7 = alloca ptr, align 8
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %8, label %16

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

16:                                               ; preds = %3
  %17 = load ptr, ptr %0, align 8, !tbaa !13
  %18 = icmp eq ptr %17, null
  br i1 %18, label %27, label %19

19:                                               ; preds = %16
  %20 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr @.str.1, ptr %20, align 8, !tbaa !5
  %21 = tail call ptr @strrchr(ptr noundef nonnull dereferenceable(1) getelementptr inbounds (i8, ptr @.str.1, i64 21), i32 noundef 47) #6
  %.not15 = icmp eq ptr %21, null
  %22 = getelementptr inbounds i8, ptr %21, i64 1
  %23 = select i1 %.not15, ptr getelementptr inbounds (i8, ptr @.str.1, i64 21), ptr %22
  %24 = getelementptr inbounds i8, ptr %20, i64 8
  store ptr %23, ptr %24, align 8, !tbaa !10
  %25 = tail call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 469762089, ptr %25, align 4, !tbaa !11
  %26 = tail call i32 @s2n_calculate_stacktrace() #7
  br label %67

27:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %4, i8 0, i64 24, i1 false)
  %28 = trunc i64 %2 to i32
  %29 = call i32 @s2n_blob_init(ptr noundef nonnull %4, ptr noundef %1, i32 noundef %28) #7
  %30 = icmp sgt i32 %29, -1
  br i1 %30, label %31, label %66

31:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %5) #7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(40) %5, i8 0, i64 40, i1 false)
  %32 = call i32 @s2n_stuffer_init(ptr noundef nonnull %5, ptr noundef nonnull %4) #7
  %33 = icmp sgt i32 %32, -1
  br i1 %33, label %34, label %65

34:                                               ; preds = %31
  %35 = getelementptr inbounds i8, ptr %4, i64 8
  %36 = load i32, ptr %35, align 8, !tbaa !15
  %37 = call i32 @s2n_stuffer_skip_write(ptr noundef nonnull %5, i32 noundef %36) #7
  %38 = icmp sgt i32 %37, -1
  br i1 %38, label %39, label %65

39:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %6) #7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(40) %6, i8 0, i64 40, i1 false)
  %40 = call i32 @s2n_stuffer_growable_alloc(ptr noundef nonnull %6, i32 noundef %28) #7
  %41 = icmp sgt i32 %40, -1
  br i1 %41, label %42, label %63

42:                                               ; preds = %39
  %43 = call i32 @s2n_stuffer_crl_from_pem(ptr noundef nonnull %5, ptr noundef nonnull %6) #7
  %44 = icmp sgt i32 %43, -1
  br i1 %44, label %45, label %63

45:                                               ; preds = %42
  %46 = getelementptr inbounds i8, ptr %6, i64 28
  %47 = load i32, ptr %46, align 4, !tbaa !17
  %48 = getelementptr inbounds i8, ptr %6, i64 24
  %49 = load i32, ptr %48, align 8, !tbaa !19
  %50 = sub i32 %47, %49
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #7
  %51 = call ptr @s2n_stuffer_raw_read(ptr noundef nonnull %6, i32 noundef %50) #7
  store ptr %51, ptr %7, align 8, !tbaa !20
  %.not16 = icmp eq ptr %51, null
  br i1 %.not16, label %.sink.split, label %52

52:                                               ; preds = %45
  %53 = zext i32 %50 to i64
  %54 = call ptr @d2i_X509_CRL(ptr noundef null, ptr noundef nonnull %7, i64 noundef %53) #7
  store ptr %54, ptr %0, align 8, !tbaa !13
  %.not18 = icmp eq ptr %54, null
  br i1 %.not18, label %.sink.split, label %62

.sink.split:                                      ; preds = %52, %45
  %.str.3.sink = phi ptr [ @.str.2, %45 ], [ @.str.3, %52 ]
  %.sink28 = phi ptr [ getelementptr inbounds (i8, ptr @.str.2, i64 21), %45 ], [ getelementptr inbounds (i8, ptr @.str.3, i64 21), %52 ]
  %.sink = phi i32 [ 402653193, %45 ], [ 469762057, %52 ]
  %55 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @_s2n_debug_info)
  store ptr %.str.3.sink, ptr %55, align 8, !tbaa !5
  %56 = call ptr @strrchr(ptr noundef nonnull dereferenceable(1) %.sink28, i32 noundef 47) #6
  %.not19 = icmp eq ptr %56, null
  %57 = getelementptr inbounds i8, ptr %56, i64 1
  %58 = select i1 %.not19, ptr %.sink28, ptr %57
  %59 = getelementptr inbounds i8, ptr %55, i64 8
  store ptr %58, ptr %59, align 8, !tbaa !10
  %60 = call align 4 ptr @llvm.threadlocal.address.p0(ptr align 4 @s2n_errno)
  store i32 %.sink, ptr %60, align 4, !tbaa !11
  %61 = call i32 @s2n_calculate_stacktrace() #7
  br label %62

62:                                               ; preds = %.sink.split, %52
  %.0 = phi i32 [ 0, %52 ], [ -1, %.sink.split ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  br label %63

63:                                               ; preds = %42, %39, %62
  %.1 = phi i32 [ %.0, %62 ], [ -1, %39 ], [ -1, %42 ]
  %64 = call i32 @s2n_stuffer_free(ptr noundef nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %6) #7
  br label %65

65:                                               ; preds = %34, %31, %63
  %.2 = phi i32 [ %.1, %63 ], [ -1, %31 ], [ -1, %34 ]
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %5) #7
  br label %66

66:                                               ; preds = %27, %65
  %.3 = phi i32 [ %.2, %65 ], [ -1, %27 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #7
  br label %67

67:                                               ; preds = %66, %19, %8
  %.4 = phi i32 [ %.3, %66 ], [ -1, %19 ], [ -1, %8 ]
  ret i32 %.4
}

; 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 #5

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

declare i32 @s2n_stuffer_init(ptr noundef, ptr noundef) local_unnamed_addr #5

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

declare i32 @s2n_stuffer_free(ptr noundef) local_unnamed_addr #5

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

declare i32 @s2n_stuffer_crl_from_pem(ptr noundef, ptr noundef) local_unnamed_addr #5

declare ptr @s2n_stuffer_raw_read(ptr noundef, i32 noundef) local_unnamed_addr #5

declare ptr @d2i_X509_CRL(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #5

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

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

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


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