; LLVM IR from specinfo-ua/UAPKI :: library/uapki/src (cer-store)

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

%"class.std::lock_guard" = type { ptr }
%"class.UapkiNS::SmartBA" = type { ptr }
%"class.__gnu_cxx::__normal_iterator.23" = type { ptr }
%"class.UapkiNS::Cert::CerStore" = type { %"class.std::mutex", %"class.std::__cxx11::basic_string", %"class.std::vector" }
%"class.std::mutex" = type { %"class.std::__mutex_base" }
%"class.std::__mutex_base" = type { %union.pthread_mutex_t }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<UapkiNS::Cert::CerItem *, std::allocator<UapkiNS::Cert::CerItem *>>::_Vector_impl" }
%"struct.std::_Vector_base<UapkiNS::Cert::CerItem *, std::allocator<UapkiNS::Cert::CerItem *>>::_Vector_impl" = type { %"struct.std::_Vector_base<UapkiNS::Cert::CerItem *, std::allocator<UapkiNS::Cert::CerItem *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<UapkiNS::Cert::CerItem *, std::allocator<UapkiNS::Cert::CerItem *>>::_Vector_impl_data" = type { ptr, ptr, ptr }

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt10lock_guardISt5mutexEC2ERS0_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #1 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt10lock_guardISt5mutexED2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorIPN7UapkiNS4Cert7CerItemESaIS3_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorIPN7UapkiNS4Cert7CerItemESaIS3_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPPN7UapkiNS4Cert7CerItemESt6vectorIS4_SaIS4_EEEEbRKNS_17__normal_iteratorIT_T0_EESE_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPPN7UapkiNS4Cert7CerItemESt6vectorIS4_SaIS4_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8)) #2 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPPN7UapkiNS4Cert7CerItemESt6vectorIS4_SaIS4_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8)) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN7UapkiNS7SmartBAC2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN7UapkiNS7SmartBAadEv(ptr noundef nonnull align 8 dereferenceable(8)) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK7UapkiNS7SmartBA3getEv(ptr noundef nonnull align 8 dereferenceable(8)) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN7UapkiNS7SmartBAD2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK7UapkiNS4Cert7CerItem15getSerialNumberEv(ptr noundef nonnull align 8 dereferenceable(401)) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK7UapkiNS4Cert7CerItem9getIssuerEv(ptr noundef nonnull align 8 dereferenceable(401)) #2 align 2

; Function Attrs: mustprogress uwtable
declare hidden noundef i32 @_ZN7UapkiNS4CertL26get_cert_by_keyid_internalERKSt6vectorIPNS0_7CerItemESaIS3_EEPK12ByteArray_stPS3_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef, ptr noundef) #1

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN7UapkiNS4Cert8CerStore12getCertBySIDEPK12ByteArray_stPPNS0_7CerItemE(ptr noundef nonnull align 8 dereferenceable(96) %0, ptr noundef %1, ptr noundef %2) #1 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca %"class.std::lock_guard", align 8
  %9 = alloca %"class.UapkiNS::SmartBA", align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca %"class.UapkiNS::SmartBA", align 8
  %13 = alloca %"class.UapkiNS::SmartBA", align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca ptr, align 8
  %17 = alloca %"class.__gnu_cxx::__normal_iterator.23", align 8
  %18 = alloca %"class.__gnu_cxx::__normal_iterator.23", align 8
  %19 = alloca ptr, align 8
  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
  %20 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %21 = getelementptr inbounds %"class.UapkiNS::Cert::CerStore", ptr %20, i32 0, i32 0
  call void @_ZNSt10lock_guardISt5mutexEC2ERS0_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(40) %21)
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  invoke void @_ZN7UapkiNS7SmartBAC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %9)
          to label %22 unwind label %38

22:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  invoke void @_ZN7UapkiNS7SmartBAC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %12)
          to label %23 unwind label %42

23:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  invoke void @_ZN7UapkiNS7SmartBAC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %13)
          to label %24 unwind label %46

24:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  %25 = load ptr, ptr %6, align 8, !tbaa !5
  %26 = invoke noundef ptr @_ZN7UapkiNS7SmartBAadEv(ptr noundef nonnull align 8 dereferenceable(8) %9)
          to label %27 unwind label %50

27:                                               ; preds = %24
  %28 = invoke noundef ptr @_ZN7UapkiNS7SmartBAadEv(ptr noundef nonnull align 8 dereferenceable(8) %13)
          to label %29 unwind label %50

29:                                               ; preds = %27
  %30 = invoke noundef ptr @_ZN7UapkiNS7SmartBAadEv(ptr noundef nonnull align 8 dereferenceable(8) %12)
          to label %31 unwind label %50

31:                                               ; preds = %29
  %32 = invoke noundef i32 @_ZN7UapkiNS4Cert8parseSIDEPK12ByteArray_stPPS1_S5_S5_(ptr noundef %25, ptr noundef %26, ptr noundef %28, ptr noundef %30)
          to label %33 unwind label %50

33:                                               ; preds = %31
  store i32 %32, ptr %14, align 4, !tbaa !9
  %34 = load i32, ptr %14, align 4, !tbaa !9
  %35 = icmp ne i32 %34, 0
  br i1 %35, label %36, label %54

36:                                               ; preds = %33
  %37 = load i32, ptr %14, align 4, !tbaa !9
  store i32 %37, ptr %4, align 4
  store i32 1, ptr %15, align 4
  br label %115

38:                                               ; preds = %3
  %39 = landingpad { ptr, i32 }
          cleanup
  %40 = extractvalue { ptr, i32 } %39, 0
  store ptr %40, ptr %10, align 8
  %41 = extractvalue { ptr, i32 } %39, 1
  store i32 %41, ptr %11, align 4
  br label %120

42:                                               ; preds = %22
  %43 = landingpad { ptr, i32 }
          cleanup
  %44 = extractvalue { ptr, i32 } %43, 0
  store ptr %44, ptr %10, align 8
  %45 = extractvalue { ptr, i32 } %43, 1
  store i32 %45, ptr %11, align 4
  br label %119

46:                                               ; preds = %23
  %47 = landingpad { ptr, i32 }
          cleanup
  %48 = extractvalue { ptr, i32 } %47, 0
  store ptr %48, ptr %10, align 8
  %49 = extractvalue { ptr, i32 } %47, 1
  store i32 %49, ptr %11, align 4
  br label %118

50:                                               ; preds = %61, %58, %54, %31, %29, %27, %24
  %51 = landingpad { ptr, i32 }
          cleanup
  %52 = extractvalue { ptr, i32 } %51, 0
  store ptr %52, ptr %10, align 8
  %53 = extractvalue { ptr, i32 } %51, 1
  store i32 %53, ptr %11, align 4
  br label %117

54:                                               ; preds = %33
  %55 = invoke noundef i64 @_ZNK7UapkiNS7SmartBA4sizeEv(ptr noundef nonnull align 8 dereferenceable(8) %12)
          to label %56 unwind label %50

56:                                               ; preds = %54
  %57 = icmp ugt i64 %55, 0
  br i1 %57, label %58, label %66

58:                                               ; preds = %56
  %59 = getelementptr inbounds %"class.UapkiNS::Cert::CerStore", ptr %20, i32 0, i32 2
  %60 = invoke noundef ptr @_ZNK7UapkiNS7SmartBA3getEv(ptr noundef nonnull align 8 dereferenceable(8) %12)
          to label %61 unwind label %50

61:                                               ; preds = %58
  %62 = load ptr, ptr %7, align 8, !tbaa !5
  %63 = invoke noundef i32 @_ZN7UapkiNS4CertL26get_cert_by_keyid_internalERKSt6vectorIPNS0_7CerItemESaIS3_EEPK12ByteArray_stPS3_(ptr noundef nonnull align 8 dereferenceable(24) %59, ptr noundef %60, ptr noundef %62)
          to label %64 unwind label %50

64:                                               ; preds = %61
  store i32 %63, ptr %14, align 4, !tbaa !9
  %65 = load i32, ptr %14, align 4, !tbaa !9
  store i32 %65, ptr %4, align 4
  store i32 1, ptr %15, align 4
  br label %115

66:                                               ; preds = %56
  store i32 4161, ptr %14, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  %67 = getelementptr inbounds %"class.UapkiNS::Cert::CerStore", ptr %20, i32 0, i32 2
  store ptr %67, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  %68 = load ptr, ptr %16, align 8, !tbaa !5
  %69 = call ptr @_ZNSt6vectorIPN7UapkiNS4Cert7CerItemESaIS3_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %68) #5
  %70 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.23", ptr %17, i32 0, i32 0
  store ptr %69, ptr %70, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  %71 = load ptr, ptr %16, align 8, !tbaa !5
  %72 = call ptr @_ZNSt6vectorIPN7UapkiNS4Cert7CerItemESaIS3_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %71) #5
  %73 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.23", ptr %18, i32 0, i32 0
  store ptr %72, ptr %73, align 8
  br label %74

74:                                               ; preds = %110, %66
  %75 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPPN7UapkiNS4Cert7CerItemESt6vectorIS4_SaIS4_EEEEbRKNS_17__normal_iteratorIT_T0_EESE_(ptr noundef nonnull align 8 dereferenceable(8) %17, ptr noundef nonnull align 8 dereferenceable(8) %18) #5
  br i1 %75, label %77, label %76

76:                                               ; preds = %74
  store i32 2, ptr %15, align 4
  br label %112

77:                                               ; preds = %74
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  %78 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPPN7UapkiNS4Cert7CerItemESt6vectorIS4_SaIS4_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %17) #5
  store ptr %78, ptr %19, align 8, !tbaa !5
  %79 = invoke noundef ptr @_ZNK7UapkiNS7SmartBA3getEv(ptr noundef nonnull align 8 dereferenceable(8) %13)
          to label %80 unwind label %102

80:                                               ; preds = %77
  %81 = load ptr, ptr %19, align 8, !tbaa !5
  %82 = load ptr, ptr %81, align 8, !tbaa !5
  %83 = invoke noundef ptr @_ZNK7UapkiNS4Cert7CerItem15getSerialNumberEv(ptr noundef nonnull align 8 dereferenceable(401) %82)
          to label %84 unwind label %102

84:                                               ; preds = %80
  %85 = invoke i32 @ba_cmp(ptr noundef %79, ptr noundef %83)
          to label %86 unwind label %102

86:                                               ; preds = %84
  %87 = icmp eq i32 %85, 0
  br i1 %87, label %88, label %106

88:                                               ; preds = %86
  %89 = invoke noundef ptr @_ZNK7UapkiNS7SmartBA3getEv(ptr noundef nonnull align 8 dereferenceable(8) %9)
          to label %90 unwind label %102

90:                                               ; preds = %88
  %91 = load ptr, ptr %19, align 8, !tbaa !5
  %92 = load ptr, ptr %91, align 8, !tbaa !5
  %93 = invoke noundef ptr @_ZNK7UapkiNS4Cert7CerItem9getIssuerEv(ptr noundef nonnull align 8 dereferenceable(401) %92)
          to label %94 unwind label %102

94:                                               ; preds = %90
  %95 = invoke i32 @ba_cmp(ptr noundef %89, ptr noundef %93)
          to label %96 unwind label %102

96:                                               ; preds = %94
  %97 = icmp eq i32 %95, 0
  br i1 %97, label %98, label %106

98:                                               ; preds = %96
  %99 = load ptr, ptr %19, align 8, !tbaa !5
  %100 = load ptr, ptr %99, align 8, !tbaa !5
  %101 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %100, ptr %101, align 8, !tbaa !5
  store i32 0, ptr %14, align 4, !tbaa !9
  store i32 2, ptr %15, align 4
  br label %107

102:                                              ; preds = %94, %90, %88, %84, %80, %77
  %103 = landingpad { ptr, i32 }
          cleanup
  %104 = extractvalue { ptr, i32 } %103, 0
  store ptr %104, ptr %10, align 8
  %105 = extractvalue { ptr, i32 } %103, 1
  store i32 %105, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  br label %117

106:                                              ; preds = %96, %86
  store i32 0, ptr %15, align 4
  br label %107

107:                                              ; preds = %106, %98
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  %108 = load i32, ptr %15, align 4
  switch i32 %108, label %112 [
    i32 0, label %109
  ]

109:                                              ; preds = %107
  br label %110

110:                                              ; preds = %109
  %111 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPPN7UapkiNS4Cert7CerItemESt6vectorIS4_SaIS4_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %17) #5
  br label %74

112:                                              ; preds = %107, %76
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  br label %113

113:                                              ; preds = %112
  %114 = load i32, ptr %14, align 4, !tbaa !9
  store i32 %114, ptr %4, align 4
  store i32 1, ptr %15, align 4
  br label %115

115:                                              ; preds = %113, %64, %36
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @_ZN7UapkiNS7SmartBAD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @_ZN7UapkiNS7SmartBAD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @_ZN7UapkiNS7SmartBAD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @_ZNSt10lock_guardISt5mutexED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  %116 = load i32, ptr %4, align 4
  ret i32 %116

117:                                              ; preds = %102, %50
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @_ZN7UapkiNS7SmartBAD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %13) #5
  br label %118

118:                                              ; preds = %117, %46
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @_ZN7UapkiNS7SmartBAD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %12) #5
  br label %119

119:                                              ; preds = %118, %42
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @_ZN7UapkiNS7SmartBAD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %9) #5
  br label %120

120:                                              ; preds = %119, %38
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @_ZNSt10lock_guardISt5mutexED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  br label %121

121:                                              ; preds = %120
  %122 = load ptr, ptr %10, align 8
  %123 = load i32, ptr %11, align 4
  %124 = insertvalue { ptr, i32 } poison, ptr %122, 0
  %125 = insertvalue { ptr, i32 } %124, i32 %123, 1
  resume { ptr, i32 } %125
}

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZNK7UapkiNS7SmartBA4sizeEv(ptr noundef nonnull align 8 dereferenceable(8)) #1 align 2

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

!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"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !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"

%"class.std::lock_guard" = type { ptr }
%"class.UapkiNS::SmartBA" = type { ptr }
%"class.__gnu_cxx::__normal_iterator.23" = type { ptr }

declare i32 @__gxx_personality_v0(...)

; 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 uwtable
declare dso_local void @_ZNSt10lock_guardISt5mutexEC2ERS0_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #1 align 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 nounwind uwtable
declare dso_local void @_ZNSt10lock_guardISt5mutexED2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorIPN7UapkiNS4Cert7CerItemESaIS3_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorIPN7UapkiNS4Cert7CerItemESaIS3_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPPN7UapkiNS4Cert7CerItemESt6vectorIS4_SaIS4_EEEEbRKNS_17__normal_iteratorIT_T0_EESE_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPPN7UapkiNS4Cert7CerItemESt6vectorIS4_SaIS4_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPPN7UapkiNS4Cert7CerItemESt6vectorIS4_SaIS4_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN7UapkiNS7SmartBAC2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN7UapkiNS7SmartBAadEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK7UapkiNS7SmartBA3getEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN7UapkiNS7SmartBAD2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK7UapkiNS4Cert7CerItem15getSerialNumberEv(ptr noundef nonnull align 8 dereferenceable(401)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK7UapkiNS4Cert7CerItem9getIssuerEv(ptr noundef nonnull align 8 dereferenceable(401)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare hidden noundef i32 @_ZN7UapkiNS4CertL26get_cert_by_keyid_internalERKSt6vectorIPNS0_7CerItemESaIS3_EEPK12ByteArray_stPS3_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN7UapkiNS4Cert8CerStore12getCertBySIDEPK12ByteArray_stPPNS0_7CerItemE(ptr noundef nonnull align 8 dereferenceable(96) %0, ptr noundef %1, ptr noundef %2) local_unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"class.std::lock_guard", align 8
  %5 = alloca %"class.UapkiNS::SmartBA", align 8
  %6 = alloca %"class.UapkiNS::SmartBA", align 8
  %7 = alloca %"class.UapkiNS::SmartBA", align 8
  %8 = alloca %"class.__gnu_cxx::__normal_iterator.23", align 8
  %9 = alloca %"class.__gnu_cxx::__normal_iterator.23", align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  call void @_ZNSt10lock_guardISt5mutexEC2ERS0_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(40) %0)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  call void @_ZN7UapkiNS7SmartBAC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #5
  call void @_ZN7UapkiNS7SmartBAC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #5
  call void @_ZN7UapkiNS7SmartBAC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %7)
  %10 = call noundef ptr @_ZN7UapkiNS7SmartBAadEv(ptr noundef nonnull align 8 dereferenceable(8) %5)
  %11 = call noundef ptr @_ZN7UapkiNS7SmartBAadEv(ptr noundef nonnull align 8 dereferenceable(8) %7)
  %12 = call noundef ptr @_ZN7UapkiNS7SmartBAadEv(ptr noundef nonnull align 8 dereferenceable(8) %6)
  %13 = invoke noundef i32 @_ZN7UapkiNS4Cert8parseSIDEPK12ByteArray_stPPS1_S5_S5_(ptr noundef %1, ptr noundef %10, ptr noundef %11, ptr noundef %12)
          to label %14 unwind label %15

14:                                               ; preds = %3
  %.not = icmp eq i32 %13, 0
  br i1 %.not, label %17, label %49

15:                                               ; preds = %21, %17, %3
  %16 = landingpad { ptr, i32 }
          cleanup
  br label %50

17:                                               ; preds = %14
  %18 = invoke noundef i64 @_ZNK7UapkiNS7SmartBA4sizeEv(ptr noundef nonnull align 8 dereferenceable(8) %6)
          to label %19 unwind label %15

19:                                               ; preds = %17
  %.not21 = icmp eq i64 %18, 0
  %20 = getelementptr inbounds i8, ptr %0, i64 72
  br i1 %.not21, label %24, label %21

21:                                               ; preds = %19
  %22 = call noundef ptr @_ZNK7UapkiNS7SmartBA3getEv(ptr noundef nonnull align 8 dereferenceable(8) %6)
  %23 = invoke noundef i32 @_ZN7UapkiNS4CertL26get_cert_by_keyid_internalERKSt6vectorIPNS0_7CerItemESaIS3_EEPK12ByteArray_stPS3_(ptr noundef nonnull align 8 dereferenceable(24) %20, ptr noundef %22, ptr noundef %2)
          to label %49 unwind label %15

24:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #5
  %25 = call ptr @_ZNSt6vectorIPN7UapkiNS4Cert7CerItemESaIS3_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %20) #5
  store ptr %25, ptr %8, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #5
  %26 = call ptr @_ZNSt6vectorIPN7UapkiNS4Cert7CerItemESaIS3_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %20) #5
  store ptr %26, ptr %9, align 8
  %27 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPPN7UapkiNS4Cert7CerItemESt6vectorIS4_SaIS4_EEEEbRKNS_17__normal_iteratorIT_T0_EESE_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9) #5
  br i1 %27, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %24, %46
  %28 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPPN7UapkiNS4Cert7CerItemESt6vectorIS4_SaIS4_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #5
  %29 = call noundef ptr @_ZNK7UapkiNS7SmartBA3getEv(ptr noundef nonnull align 8 dereferenceable(8) %7)
  %30 = load ptr, ptr %28, align 8, !tbaa !5
  %31 = call noundef ptr @_ZNK7UapkiNS4Cert7CerItem15getSerialNumberEv(ptr noundef nonnull align 8 dereferenceable(401) %30)
  %32 = invoke i32 @ba_cmp(ptr noundef %29, ptr noundef %31)
          to label %33 unwind label %42

33:                                               ; preds = %.lr.ph
  %34 = icmp eq i32 %32, 0
  br i1 %34, label %35, label %46

35:                                               ; preds = %33
  %36 = call noundef ptr @_ZNK7UapkiNS7SmartBA3getEv(ptr noundef nonnull align 8 dereferenceable(8) %5)
  %37 = load ptr, ptr %28, align 8, !tbaa !5
  %38 = call noundef ptr @_ZNK7UapkiNS4Cert7CerItem9getIssuerEv(ptr noundef nonnull align 8 dereferenceable(401) %37)
  %39 = invoke i32 @ba_cmp(ptr noundef %36, ptr noundef %38)
          to label %40 unwind label %42

40:                                               ; preds = %35
  %41 = icmp eq i32 %39, 0
  br i1 %41, label %44, label %46

42:                                               ; preds = %35, %.lr.ph
  %43 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #5
  br label %50

44:                                               ; preds = %40
  %45 = load ptr, ptr %28, align 8, !tbaa !5
  store ptr %45, ptr %2, align 8, !tbaa !5
  br label %.loopexit

46:                                               ; preds = %40, %33
  %47 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPPN7UapkiNS4Cert7CerItemESt6vectorIS4_SaIS4_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #5
  %48 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPPN7UapkiNS4Cert7CerItemESt6vectorIS4_SaIS4_EEEEbRKNS_17__normal_iteratorIT_T0_EESE_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9) #5
  br i1 %48, label %.lr.ph, label %.loopexit

.loopexit:                                        ; preds = %46, %24, %44
  %.2 = phi i32 [ 0, %44 ], [ 4161, %24 ], [ 4161, %46 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #5
  br label %49

49:                                               ; preds = %21, %14, %.loopexit
  %.0 = phi i32 [ %.2, %.loopexit ], [ %13, %14 ], [ %23, %21 ]
  call void @_ZN7UapkiNS7SmartBAD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #5
  call void @_ZN7UapkiNS7SmartBAD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  call void @_ZN7UapkiNS7SmartBAD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  call void @_ZNSt10lock_guardISt5mutexED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  ret i32 %.0

50:                                               ; preds = %42, %15
  %.pn = phi { ptr, i32 } [ %16, %15 ], [ %43, %42 ]
  call void @_ZN7UapkiNS7SmartBAD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #5
  call void @_ZN7UapkiNS7SmartBAD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  call void @_ZN7UapkiNS7SmartBAD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  call void @_ZNSt10lock_guardISt5mutexED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  resume { ptr, i32 } %.pn
}

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZNK7UapkiNS7SmartBA4sizeEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1 align 2

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

!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,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass