; LLVM IR from specinfo-ua/UAPKI :: library/uapki/src/global-objects.ll (ZN7UapkiNS14release_storesEv)

; 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"

@_ZN7UapkiNSL12lib_cerstoreE = external hidden global ptr, align 8
@_ZN7UapkiNSL12lib_crlstoreE = external hidden global ptr, align 8

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) #0

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN7UapkiNS14release_storesEv() #1 {
  %1 = load ptr, ptr @_ZN7UapkiNSL12lib_cerstoreE, align 8, !tbaa !5
  %2 = icmp ne ptr %1, null
  br i1 %2, label %3, label %8

3:                                                ; preds = %0
  %4 = load ptr, ptr @_ZN7UapkiNSL12lib_cerstoreE, align 8, !tbaa !5
  %5 = icmp eq ptr %4, null
  br i1 %5, label %7, label %6

6:                                                ; preds = %3
  call void @_ZN7UapkiNS4Cert8CerStoreD1Ev(ptr noundef nonnull align 8 dereferenceable(96) %4) #3
  call void @_ZdlPvm(ptr noundef %4, i64 noundef 96) #4
  br label %7

7:                                                ; preds = %6, %3
  store ptr null, ptr @_ZN7UapkiNSL12lib_cerstoreE, align 8, !tbaa !5
  br label %8

8:                                                ; preds = %7, %0
  %9 = load ptr, ptr @_ZN7UapkiNSL12lib_crlstoreE, align 8, !tbaa !5
  %10 = icmp ne ptr %9, null
  br i1 %10, label %11, label %16

11:                                               ; preds = %8
  %12 = load ptr, ptr @_ZN7UapkiNSL12lib_crlstoreE, align 8, !tbaa !5
  %13 = icmp eq ptr %12, null
  br i1 %13, label %15, label %14

14:                                               ; preds = %11
  call void @_ZN7UapkiNS3Crl8CrlStoreD1Ev(ptr noundef nonnull align 8 dereferenceable(144) %12) #3
  call void @_ZdlPvm(ptr noundef %12, i64 noundef 144) #4
  br label %15

15:                                               ; preds = %14, %11
  store ptr null, ptr @_ZN7UapkiNSL12lib_crlstoreE, align 8, !tbaa !5
  br label %16

16:                                               ; preds = %15, %8
  ret void
}

; Function Attrs: nounwind
declare void @_ZN7UapkiNS4Cert8CerStoreD1Ev(ptr noundef nonnull align 8 dereferenceable(96)) unnamed_addr #2

; Function Attrs: nounwind
declare void @_ZN7UapkiNS3Crl8CrlStoreD1Ev(ptr noundef nonnull align 8 dereferenceable(144)) unnamed_addr #2

attributes #0 = { nobuiltin 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 #1 = { mustprogress 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 = { 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 #3 = { nounwind }
attributes #4 = { builtin 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++ TBAA"}


; 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"

@_ZN7UapkiNSL12lib_cerstoreE = external hidden local_unnamed_addr global ptr, align 8
@_ZN7UapkiNSL12lib_crlstoreE = external hidden local_unnamed_addr global ptr, align 8

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN7UapkiNS14release_storesEv() local_unnamed_addr #1 {
  %1 = load ptr, ptr @_ZN7UapkiNSL12lib_cerstoreE, align 8, !tbaa !5
  %.not = icmp eq ptr %1, null
  br i1 %.not, label %3, label %2

2:                                                ; preds = %0
  tail call void @_ZN7UapkiNS4Cert8CerStoreD1Ev(ptr noundef nonnull align 8 dereferenceable(96) %1) #3
  tail call void @_ZdlPvm(ptr noundef nonnull %1, i64 noundef 96) #4
  store ptr null, ptr @_ZN7UapkiNSL12lib_cerstoreE, align 8, !tbaa !5
  br label %3

3:                                                ; preds = %2, %0
  %4 = load ptr, ptr @_ZN7UapkiNSL12lib_crlstoreE, align 8, !tbaa !5
  %.not2 = icmp eq ptr %4, null
  br i1 %.not2, label %6, label %5

5:                                                ; preds = %3
  tail call void @_ZN7UapkiNS3Crl8CrlStoreD1Ev(ptr noundef nonnull align 8 dereferenceable(144) %4) #3
  tail call void @_ZdlPvm(ptr noundef nonnull %4, i64 noundef 144) #4
  store ptr null, ptr @_ZN7UapkiNSL12lib_crlstoreE, align 8, !tbaa !5
  br label %6

6:                                                ; preds = %5, %3
  ret void
}

; Function Attrs: nounwind
declare void @_ZN7UapkiNS4Cert8CerStoreD1Ev(ptr noundef nonnull align 8 dereferenceable(96)) unnamed_addr #2

; Function Attrs: nounwind
declare void @_ZN7UapkiNS3Crl8CrlStoreD1Ev(ptr noundef nonnull align 8 dereferenceable(144)) unnamed_addr #2

attributes #0 = { nobuiltin 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 #1 = { mustprogress 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 = { 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 #3 = { nounwind }
attributes #4 = { builtin 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++ TBAA"}


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