; LLVM IR from specinfo-ua/UAPKI :: library/cm-pkcs12/src/cm-pkcs12.ll (ZN8CmPkcs124openEPKcjPhPP17CM_SESSION_API_ST)

; 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.UapkiNS::SmartBA" = type { 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::allocator" = type { i8 }
%struct.SessionPkcs12Context = type { %struct.CM_KEY_API_ST, %class.FileStorage, ptr, ptr, i32, %"struct.UapkiNS::AlgorithmIdentifier" }
%struct.CM_KEY_API_ST = type { i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%class.FileStorage = type { ptr, %"class.std::__cxx11::basic_string", i8, i8, %"class.std::__cxx11::basic_string", i8, %"class.std::vector", ptr, %struct.FileStorageParam }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<StoreBag *, std::allocator<StoreBag *>>::_Vector_impl" }
%"struct.std::_Vector_base<StoreBag *, std::allocator<StoreBag *>>::_Vector_impl" = type { %"struct.std::_Vector_base<StoreBag *, std::allocator<StoreBag *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<StoreBag *, std::allocator<StoreBag *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.FileStorageParam = type { ptr, ptr, ptr, i64 }
%"struct.UapkiNS::AlgorithmIdentifier" = type { %"class.std::__cxx11::basic_string", ptr }
%struct.CM_SESSION_API_ST = type { i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }

@_ZN8CmPkcs1218FILENAME_ON_MEMORYE = external global ptr, align 8

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN8CmPkcs124openEPKcjPhPP17CM_SESSION_API_ST(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef %1, i32 noundef %2, ptr noundef %3, ptr noundef %4) #0 align 2 personality ptr @__gxx_personality_v0 {
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca %"class.UapkiNS::SmartBA", align 8
  %18 = alloca %"class.std::__cxx11::basic_string", align 8
  %19 = alloca %"class.std::allocator", align 1
  %20 = alloca %"class.std::__cxx11::basic_string", align 8
  %21 = alloca %"class.std::allocator", align 1
  %22 = alloca ptr, align 8
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  store i32 %2, ptr %9, align 4, !tbaa !9
  store ptr %3, ptr %10, align 8, !tbaa !5
  store ptr %4, ptr %11, align 8, !tbaa !5
  %23 = load ptr, ptr %7, align 8
  %24 = load ptr, ptr %8, align 8, !tbaa !5
  %25 = icmp ne ptr %24, null
  br i1 %25, label %26, label %33

26:                                               ; preds = %5
  %27 = load ptr, ptr %8, align 8, !tbaa !5
  %28 = call i64 @strlen(ptr noundef %27) #9
  %29 = icmp eq i64 %28, 0
  br i1 %29, label %33, label %30

30:                                               ; preds = %26
  %31 = load ptr, ptr %11, align 8, !tbaa !5
  %32 = icmp ne ptr %31, null
  br i1 %32, label %34, label %33

33:                                               ; preds = %30, %26, %5
  store i32 1026, ptr %6, align 4
  br label %168

34:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #10
  %35 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 376) #11
  invoke void @_ZN20SessionPkcs12ContextC1Ev(ptr noundef nonnull align 8 dereferenceable(376) %35)
          to label %36 unwind label %40

36:                                               ; preds = %34
  store ptr %35, ptr %12, align 8, !tbaa !5
  %37 = load ptr, ptr %12, align 8, !tbaa !5
  %38 = icmp ne ptr %37, null
  br i1 %38, label %44, label %39

39:                                               ; preds = %36
  store i32 1025, ptr %6, align 4
  store i32 1, ptr %15, align 4
  br label %166

40:                                               ; preds = %34
  %41 = landingpad { ptr, i32 }
          cleanup
  %42 = extractvalue { ptr, i32 } %41, 0
  store ptr %42, ptr %13, align 8
  %43 = extractvalue { ptr, i32 } %41, 1
  store i32 %43, ptr %14, align 4
  call void @_ZdlPvm(ptr noundef %35, i64 noundef 376) #12
  br label %167

44:                                               ; preds = %36
  %45 = load ptr, ptr %12, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.SessionPkcs12Context, ptr %45, i32 0, i32 1
  %47 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN11FileStorage12storageParamEv(ptr noundef nonnull align 8 dereferenceable(152) %46)
  %48 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN8CmPkcs1215getDefaultParamEv(ptr noundef nonnull align 8 dereferenceable(32) %23)
  call void @_ZN16FileStorageParam10setDefaultEPKS_(ptr noundef nonnull align 8 dereferenceable(32) %47, ptr noundef %48)
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #10
  store i32 1026, ptr %16, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #10
  call void @_ZN7UapkiNS7SmartBAC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %17)
  %49 = load i32, ptr %9, align 4, !tbaa !9
  switch i32 %49, label %129 [
    i32 0, label %50
    i32 1, label %50
    i32 2, label %103
  ]

50:                                               ; preds = %44, %44
  %51 = load ptr, ptr %8, align 8, !tbaa !5
  %52 = load ptr, ptr @_ZN8CmPkcs1218FILENAME_ON_MEMORYE, align 8, !tbaa !5
  %53 = call i32 @strcmp(ptr noundef %51, ptr noundef %52) #9
  %54 = icmp eq i32 %53, 0
  br i1 %54, label %55, label %82

55:                                               ; preds = %50
  %56 = load ptr, ptr %10, align 8, !tbaa !5
  %57 = invoke noundef ptr @_ZN7UapkiNS7SmartBAadEv(ptr noundef nonnull align 8 dereferenceable(8) %17)
          to label %58 unwind label %77

58:                                               ; preds = %55
  %59 = invoke noundef i32 @_ZN8CmPkcs1210parseBytesEPhPP12ByteArray_st(ptr noundef %56, ptr noundef %57)
          to label %60 unwind label %77

60:                                               ; preds = %58
  store i32 %59, ptr %16, align 4, !tbaa !9
  %61 = load i32, ptr %16, align 4, !tbaa !9
  %62 = icmp eq i32 %61, 0
  br i1 %62, label %63, label %81

63:                                               ; preds = %60
  %64 = invoke noundef i64 @_ZNK7UapkiNS7SmartBA4sizeEv(ptr noundef nonnull align 8 dereferenceable(8) %17)
          to label %65 unwind label %77

65:                                               ; preds = %63
  %66 = icmp ugt i64 %64, 0
  br i1 %66, label %67, label %81

67:                                               ; preds = %65
  %68 = load ptr, ptr %12, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.SessionPkcs12Context, ptr %68, i32 0, i32 1
  %70 = invoke noundef ptr @_ZNK7UapkiNS7SmartBA3getEv(ptr noundef nonnull align 8 dereferenceable(8) %17)
          to label %71 unwind label %77

71:                                               ; preds = %67
  %72 = load i32, ptr %9, align 4, !tbaa !9
  %73 = icmp eq i32 %72, 1
  invoke void @_ZN11FileStorage14loadFromBufferEP12ByteArray_stb(ptr noundef nonnull align 8 dereferenceable(152) %69, ptr noundef %70, i1 noundef zeroext %73)
          to label %74 unwind label %77

74:                                               ; preds = %71
  %75 = invoke noundef zeroext i1 @_ZN7UapkiNS7SmartBA3setEP12ByteArray_st(ptr noundef nonnull align 8 dereferenceable(8) %17, ptr noundef null)
          to label %76 unwind label %77

76:                                               ; preds = %74
  br label %81

77:                                               ; preds = %108, %103, %74, %71, %67, %63, %58, %55
  %78 = landingpad { ptr, i32 }
          cleanup
  %79 = extractvalue { ptr, i32 } %78, 0
  store ptr %79, ptr %13, align 8
  %80 = extractvalue { ptr, i32 } %78, 1
  store i32 %80, ptr %14, align 4
  br label %165

81:                                               ; preds = %76, %65, %60
  br label %102

82:                                               ; preds = %50
  %83 = load ptr, ptr %12, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.SessionPkcs12Context, ptr %83, i32 0, i32 1
  call void @llvm.lifetime.start.p0(i64 32, ptr %18) #10
  %85 = load ptr, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %19) #10
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %19) #10
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %18, ptr noundef %85, ptr noundef nonnull align 1 dereferenceable(1) %19)
          to label %86 unwind label %93

86:                                               ; preds = %82
  %87 = load i32, ptr %9, align 4, !tbaa !9
  %88 = icmp eq i32 %87, 1
  %89 = invoke noundef i32 @_ZN11FileStorage12loadFromFileERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEb(ptr noundef nonnull align 8 dereferenceable(152) %84, ptr noundef nonnull align 8 dereferenceable(32) %18, i1 noundef zeroext %88)
          to label %90 unwind label %97

90:                                               ; preds = %86
  %91 = invoke noundef i32 @_ZL14err_to_cmerrori(i32 noundef %89)
          to label %92 unwind label %97

92:                                               ; preds = %90
  store i32 %91, ptr %16, align 4, !tbaa !9
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %18) #10
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %19) #10
  call void @llvm.lifetime.end.p0(i64 1, ptr %19) #10
  call void @llvm.lifetime.end.p0(i64 32, ptr %18) #10
  br label %102

93:                                               ; preds = %82
  %94 = landingpad { ptr, i32 }
          cleanup
  %95 = extractvalue { ptr, i32 } %94, 0
  store ptr %95, ptr %13, align 8
  %96 = extractvalue { ptr, i32 } %94, 1
  store i32 %96, ptr %14, align 4
  br label %101

97:                                               ; preds = %90, %86
  %98 = landingpad { ptr, i32 }
          cleanup
  %99 = extractvalue { ptr, i32 } %98, 0
  store ptr %99, ptr %13, align 8
  %100 = extractvalue { ptr, i32 } %98, 1
  store i32 %100, ptr %14, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %18) #10
  br label %101

101:                                              ; preds = %97, %93
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %19) #10
  call void @llvm.lifetime.end.p0(i64 1, ptr %19) #10
  call void @llvm.lifetime.end.p0(i64 32, ptr %18) #10
  br label %165

102:                                              ; preds = %92, %81
  br label %130

103:                                              ; preds = %44
  %104 = load ptr, ptr %10, align 8, !tbaa !5
  %105 = load ptr, ptr %12, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.SessionPkcs12Context, ptr %105, i32 0, i32 1
  %107 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZN11FileStorage12storageParamEv(ptr noundef nonnull align 8 dereferenceable(152) %106)
          to label %108 unwind label %77

108:                                              ; preds = %103
  %109 = invoke noundef i32 @_ZN8CmPkcs1211parseConfigEPhR16FileStorageParam(ptr noundef %104, ptr noundef nonnull align 8 dereferenceable(32) %107)
          to label %110 unwind label %77

110:                                              ; preds = %108
  store i32 %109, ptr %16, align 4, !tbaa !9
  %111 = load i32, ptr %16, align 4, !tbaa !9
  %112 = icmp eq i32 %111, 0
  br i1 %112, label %113, label %128

113:                                              ; preds = %110
  %114 = load ptr, ptr %12, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.SessionPkcs12Context, ptr %114, i32 0, i32 1
  call void @llvm.lifetime.start.p0(i64 32, ptr %20) #10
  %116 = load ptr, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %21) #10
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %21) #10
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %20, ptr noundef %116, ptr noundef nonnull align 1 dereferenceable(1) %21)
          to label %117 unwind label %119

117:                                              ; preds = %113
  invoke void @_ZN11FileStorage6createERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(152) %115, ptr noundef nonnull align 8 dereferenceable(32) %20)
          to label %118 unwind label %123

118:                                              ; preds = %117
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %20) #10
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %21) #10
  call void @llvm.lifetime.end.p0(i64 1, ptr %21) #10
  call void @llvm.lifetime.end.p0(i64 32, ptr %20) #10
  br label %128

119:                                              ; preds = %113
  %120 = landingpad { ptr, i32 }
          cleanup
  %121 = extractvalue { ptr, i32 } %120, 0
  store ptr %121, ptr %13, align 8
  %122 = extractvalue { ptr, i32 } %120, 1
  store i32 %122, ptr %14, align 4
  br label %127

123:                                              ; preds = %117
  %124 = landingpad { ptr, i32 }
          cleanup
  %125 = extractvalue { ptr, i32 } %124, 0
  store ptr %125, ptr %13, align 8
  %126 = extractvalue { ptr, i32 } %124, 1
  store i32 %126, ptr %14, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %20) #10
  br label %127

127:                                              ; preds = %123, %119
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %21) #10
  call void @llvm.lifetime.end.p0(i64 1, ptr %21) #10
  call void @llvm.lifetime.end.p0(i64 32, ptr %20) #10
  br label %165

128:                                              ; preds = %118, %110
  br label %130

129:                                              ; preds = %44
  br label %130

130:                                              ; preds = %129, %128, %102
  %131 = load i32, ptr %16, align 4, !tbaa !9
  %132 = icmp ne i32 %131, 0
  br i1 %132, label %133, label %139

133:                                              ; preds = %130
  %134 = load ptr, ptr %12, align 8, !tbaa !5
  %135 = icmp eq ptr %134, null
  br i1 %135, label %137, label %136

136:                                              ; preds = %133
  call void @_ZN20SessionPkcs12ContextD1Ev(ptr noundef nonnull align 8 dereferenceable(376) %134) #10
  call void @_ZdlPvm(ptr noundef %134, i64 noundef 376) #12
  br label %137

137:                                              ; preds = %136, %133
  %138 = load i32, ptr %16, align 4, !tbaa !9
  store i32 %138, ptr %6, align 4
  store i32 1, ptr %15, align 4
  br label %164

139:                                              ; preds = %130
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #10
  %140 = call noalias ptr @calloc(i64 noundef 1, i64 noundef 144) #13
  store ptr %140, ptr %22, align 8, !tbaa !5
  %141 = load ptr, ptr %22, align 8, !tbaa !5
  %142 = icmp ne ptr %141, null
  br i1 %142, label %148, label %143

143:                                              ; preds = %139
  %144 = load ptr, ptr %12, align 8, !tbaa !5
  %145 = icmp eq ptr %144, null
  br i1 %145, label %147, label %146

146:                                              ; preds = %143
  call void @_ZN20SessionPkcs12ContextD1Ev(ptr noundef nonnull align 8 dereferenceable(376) %144) #10
  call void @_ZdlPvm(ptr noundef %144, i64 noundef 376) #12
  br label %147

147:                                              ; preds = %146, %143
  store i32 1025, ptr %6, align 4
  store i32 1, ptr %15, align 4
  br label %163

148:                                              ; preds = %139
  %149 = load ptr, ptr %22, align 8, !tbaa !5
  invoke void @_ZN8CmPkcs1217assignSessionFuncER17CM_SESSION_API_ST(ptr noundef nonnull align 8 dereferenceable(144) %149)
          to label %150 unwind label %159

150:                                              ; preds = %148
  %151 = load ptr, ptr %12, align 8, !tbaa !5
  %152 = load ptr, ptr %22, align 8, !tbaa !5
  %153 = getelementptr inbounds %struct.CM_SESSION_API_ST, ptr %152, i32 0, i32 2
  store ptr %151, ptr %153, align 8, !tbaa !5
  %154 = load ptr, ptr %12, align 8, !tbaa !5
  %155 = getelementptr inbounds %struct.SessionPkcs12Context, ptr %154, i32 0, i32 0
  invoke void @_ZN8CmPkcs1213assignKeyFuncER13CM_KEY_API_ST(ptr noundef nonnull align 8 dereferenceable(160) %155)
          to label %156 unwind label %159

156:                                              ; preds = %150
  %157 = load ptr, ptr %22, align 8, !tbaa !5
  %158 = load ptr, ptr %11, align 8, !tbaa !5
  store ptr %157, ptr %158, align 8, !tbaa !5
  store i32 0, ptr %6, align 4
  store i32 1, ptr %15, align 4
  br label %163

159:                                              ; preds = %150, %148
  %160 = landingpad { ptr, i32 }
          cleanup
  %161 = extractvalue { ptr, i32 } %160, 0
  store ptr %161, ptr %13, align 8
  %162 = extractvalue { ptr, i32 } %160, 1
  store i32 %162, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #10
  br label %165

163:                                              ; preds = %156, %147
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #10
  br label %164

164:                                              ; preds = %163, %137
  call void @_ZN7UapkiNS7SmartBAD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %17) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #10
  br label %166

165:                                              ; preds = %159, %127, %101, %77
  call void @_ZN7UapkiNS7SmartBAD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %17) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #10
  br label %167

166:                                              ; preds = %164, %39
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #10
  br label %168

167:                                              ; preds = %165, %40
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #10
  br label %170

168:                                              ; preds = %166, %33
  %169 = load i32, ptr %6, align 4
  ret i32 %169

170:                                              ; preds = %167
  %171 = load ptr, ptr %13, align 8
  %172 = load i32, ptr %14, align 4
  %173 = insertvalue { ptr, i32 } poison, ptr %171, 0
  %174 = insertvalue { ptr, i32 } %173, i32 %172, 1
  resume { ptr, i32 } %174
}

; Function Attrs: nounwind willreturn memory(read)
declare i64 @strlen(ptr noundef) #1

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

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) #3

declare void @_ZN20SessionPkcs12ContextC1Ev(ptr noundef nonnull align 8 dereferenceable(376)) unnamed_addr #4

declare i32 @__gxx_personality_v0(...)

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

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

declare void @_ZN16FileStorageParam10setDefaultEPKS_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef) #4

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN8CmPkcs1210parseBytesEPhPP12ByteArray_st(ptr noundef, ptr noundef) #0 align 2

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

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

declare void @_ZN11FileStorage14loadFromBufferEP12ByteArray_stb(ptr noundef nonnull align 8 dereferenceable(152), ptr noundef, i1 noundef zeroext) #4

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN7UapkiNS7SmartBA3setEP12ByteArray_st(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #6 align 2

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef i32 @_ZL14err_to_cmerrori(i32 noundef) #6

declare noundef i32 @_ZN11FileStorage12loadFromFileERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEb(ptr noundef nonnull align 8 dereferenceable(152), ptr noundef nonnull align 8 dereferenceable(32), i1 noundef zeroext) #4

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #6 align 2

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN8CmPkcs1211parseConfigEPhR16FileStorageParam(ptr noundef, ptr noundef nonnull align 8 dereferenceable(32)) #0 align 2

declare void @_ZN11FileStorage6createERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(152), ptr noundef nonnull align 8 dereferenceable(32)) #4

; Function Attrs: nounwind
declare void @_ZN20SessionPkcs12ContextD1Ev(ptr noundef nonnull align 8 dereferenceable(376)) unnamed_addr #7

; Function Attrs: nounwind allocsize(0,1)
declare noalias ptr @calloc(i64 noundef, i64 noundef) #8

declare void @_ZN8CmPkcs1217assignSessionFuncER17CM_SESSION_API_ST(ptr noundef nonnull align 8 dereferenceable(144)) #4

declare void @_ZN8CmPkcs1213assignKeyFuncER13CM_KEY_API_ST(ptr noundef nonnull align 8 dereferenceable(160)) #4

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

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

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

!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.UapkiNS::SmartBA" = type { 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::allocator" = type { i8 }

@_ZN8CmPkcs1218FILENAME_ON_MEMORYE = external local_unnamed_addr global ptr, align 8

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN8CmPkcs124openEPKcjPhPP17CM_SESSION_API_ST(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef %1, i32 noundef %2, ptr noundef %3, ptr noundef writeonly %4) local_unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %6 = alloca %"class.UapkiNS::SmartBA", align 8
  %7 = alloca %"class.std::__cxx11::basic_string", align 8
  %8 = alloca %"class.std::allocator", align 1
  %9 = alloca %"class.std::__cxx11::basic_string", align 8
  %10 = alloca %"class.std::allocator", align 1
  %.not = icmp eq ptr %1, null
  br i1 %.not, label %76, label %11

11:                                               ; preds = %5
  %char0 = load i8, ptr %1, align 1
  %12 = icmp ne i8 %char0, 0
  %13 = icmp ne ptr %4, null
  %or.cond = and i1 %13, %12
  br i1 %or.cond, label %14, label %76

14:                                               ; preds = %11
  %15 = tail call noalias noundef nonnull dereferenceable(376) ptr @_Znwm(i64 noundef 376) #9
  invoke void @_ZN20SessionPkcs12ContextC1Ev(ptr noundef nonnull align 8 dereferenceable(376) %15)
          to label %18 unwind label %16

16:                                               ; preds = %14
  %17 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZdlPvm(ptr noundef nonnull %15, i64 noundef 376) #10
  br label %75

18:                                               ; preds = %14
  %19 = getelementptr inbounds i8, ptr %15, i64 160
  %20 = tail call noundef nonnull align 8 dereferenceable(32) ptr @_ZN11FileStorage12storageParamEv(ptr noundef nonnull align 8 dereferenceable(152) %19)
  %21 = tail call noundef nonnull align 8 dereferenceable(32) ptr @_ZN8CmPkcs1215getDefaultParamEv(ptr noundef nonnull align 8 dereferenceable(32) %0)
  tail call void @_ZN16FileStorageParam10setDefaultEPKS_(ptr noundef nonnull align 8 dereferenceable(32) %20, ptr noundef nonnull %21)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #11
  call void @_ZN7UapkiNS7SmartBAC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6)
  switch i32 %2, label %.thread62 [
    i32 0, label %22
    i32 1, label %22
    i32 2, label %50
  ]

22:                                               ; preds = %18, %18
  %23 = load ptr, ptr @_ZN8CmPkcs1218FILENAME_ON_MEMORYE, align 8, !tbaa !5
  %24 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %1, ptr noundef nonnull dereferenceable(1) %23) #12
  %25 = icmp eq i32 %24, 0
  br i1 %25, label %26, label %41

26:                                               ; preds = %22
  %27 = call noundef ptr @_ZN7UapkiNS7SmartBAadEv(ptr noundef nonnull align 8 dereferenceable(8) %6)
  %28 = invoke noundef i32 @_ZN8CmPkcs1210parseBytesEPhPP12ByteArray_st(ptr noundef %3, ptr noundef %27)
          to label %29 unwind label %39

29:                                               ; preds = %26
  %30 = icmp eq i32 %28, 0
  br i1 %30, label %31, label %.thread62

31:                                               ; preds = %29
  %32 = invoke noundef i64 @_ZNK7UapkiNS7SmartBA4sizeEv(ptr noundef nonnull align 8 dereferenceable(8) %6)
          to label %33 unwind label %39

33:                                               ; preds = %31
  %.not53 = icmp eq i64 %32, 0
  br i1 %.not53, label %.thread, label %34

34:                                               ; preds = %33
  %35 = call noundef ptr @_ZNK7UapkiNS7SmartBA3getEv(ptr noundef nonnull align 8 dereferenceable(8) %6)
  %36 = icmp eq i32 %2, 1
  invoke void @_ZN11FileStorage14loadFromBufferEP12ByteArray_stb(ptr noundef nonnull align 8 dereferenceable(152) %19, ptr noundef %35, i1 noundef zeroext %36)
          to label %37 unwind label %39

37:                                               ; preds = %34
  %38 = call noundef zeroext i1 @_ZN7UapkiNS7SmartBA3setEP12ByteArray_st(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef null)
  br label %.thread

39:                                               ; preds = %50, %34, %31, %26
  %40 = landingpad { ptr, i32 }
          cleanup
  br label %74

41:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %7) #11
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %8) #11
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #11
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %7, ptr noundef nonnull %1, ptr noundef nonnull align 1 dereferenceable(1) %8)
          to label %42 unwind label %45

42:                                               ; preds = %41
  %43 = icmp eq i32 %2, 1
  %44 = invoke noundef i32 @_ZN11FileStorage12loadFromFileERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEb(ptr noundef nonnull align 8 dereferenceable(152) %19, ptr noundef nonnull align 8 dereferenceable(32) %7, i1 noundef zeroext %43)
          to label %63 unwind label %47

45:                                               ; preds = %41
  %46 = landingpad { ptr, i32 }
          cleanup
  br label %49

47:                                               ; preds = %42
  %48 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #11
  br label %49

49:                                               ; preds = %47, %45
  %.pn51 = phi { ptr, i32 } [ %48, %47 ], [ %46, %45 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #11
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %8) #11
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #11
  br label %74

50:                                               ; preds = %18
  %51 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN11FileStorage12storageParamEv(ptr noundef nonnull align 8 dereferenceable(152) %19)
  %52 = invoke noundef i32 @_ZN8CmPkcs1211parseConfigEPhR16FileStorageParam(ptr noundef %3, ptr noundef nonnull align 8 dereferenceable(32) %51)
          to label %53 unwind label %39

53:                                               ; preds = %50
  %54 = icmp eq i32 %52, 0
  br i1 %54, label %55, label %.thread62

55:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %9) #11
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %10) #11
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #11
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %9, ptr noundef nonnull %1, ptr noundef nonnull align 1 dereferenceable(1) %10)
          to label %56 unwind label %58

56:                                               ; preds = %55
  invoke void @_ZN11FileStorage6createERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(152) %19, ptr noundef nonnull align 8 dereferenceable(32) %9)
          to label %57 unwind label %60

57:                                               ; preds = %56
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #11
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #11
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %10) #11
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %9) #11
  br label %.thread

58:                                               ; preds = %55
  %59 = landingpad { ptr, i32 }
          cleanup
  br label %62

60:                                               ; preds = %56
  %61 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #11
  br label %62

62:                                               ; preds = %60, %58
  %.pn = phi { ptr, i32 } [ %61, %60 ], [ %59, %58 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #11
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %10) #11
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %9) #11
  br label %74

63:                                               ; preds = %42
  %64 = call noundef i32 @_ZL14err_to_cmerrori(i32 noundef %44)
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #11
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #11
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %8) #11
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #11
  %.not54 = icmp eq i32 %64, 0
  br i1 %.not54, label %.thread, label %.thread62

.thread62:                                        ; preds = %29, %53, %18, %63
  %.03465 = phi i32 [ %64, %63 ], [ %28, %29 ], [ %52, %53 ], [ 1026, %18 ]
  call void @_ZN20SessionPkcs12ContextD1Ev(ptr noundef nonnull align 8 dereferenceable(376) %15) #11
  call void @_ZdlPvm(ptr noundef nonnull %15, i64 noundef 376) #10
  br label %73

.thread:                                          ; preds = %33, %37, %57, %63
  %65 = call noalias dereferenceable_or_null(144) ptr @calloc(i64 noundef 1, i64 noundef 144) #13
  %.not55 = icmp eq ptr %65, null
  br i1 %.not55, label %66, label %67

66:                                               ; preds = %.thread
  call void @_ZN20SessionPkcs12ContextD1Ev(ptr noundef nonnull align 8 dereferenceable(376) %15) #11
  call void @_ZdlPvm(ptr noundef nonnull %15, i64 noundef 376) #10
  br label %73

67:                                               ; preds = %.thread
  invoke void @_ZN8CmPkcs1217assignSessionFuncER17CM_SESSION_API_ST(ptr noundef nonnull align 8 dereferenceable(144) %65)
          to label %68 unwind label %71

68:                                               ; preds = %67
  %69 = getelementptr inbounds i8, ptr %65, i64 16
  store ptr %15, ptr %69, align 8, !tbaa !5
  invoke void @_ZN8CmPkcs1213assignKeyFuncER13CM_KEY_API_ST(ptr noundef nonnull align 8 dereferenceable(160) %15)
          to label %70 unwind label %71

70:                                               ; preds = %68
  store ptr %65, ptr %4, align 8, !tbaa !5
  br label %73

71:                                               ; preds = %68, %67
  %72 = landingpad { ptr, i32 }
          cleanup
  br label %74

73:                                               ; preds = %66, %70, %.thread62
  %.1 = phi i32 [ %.03465, %.thread62 ], [ 0, %70 ], [ 1025, %66 ]
  call void @_ZN7UapkiNS7SmartBAD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #11
  br label %76

74:                                               ; preds = %71, %62, %49, %39
  %.pn56 = phi { ptr, i32 } [ %72, %71 ], [ %.pn, %62 ], [ %40, %39 ], [ %.pn51, %49 ]
  call void @_ZN7UapkiNS7SmartBAD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #11
  br label %75

75:                                               ; preds = %74, %16
  %.pn56.pn = phi { ptr, i32 } [ %.pn56, %74 ], [ %17, %16 ]
  resume { ptr, i32 } %.pn56.pn

76:                                               ; preds = %5, %11, %73
  %.3 = phi i32 [ %.1, %73 ], [ 1026, %11 ], [ 1026, %5 ]
  ret i32 %.3
}

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

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) local_unnamed_addr #2

declare void @_ZN20SessionPkcs12ContextC1Ev(ptr noundef nonnull align 8 dereferenceable(376)) unnamed_addr #3

declare i32 @__gxx_personality_v0(...)

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

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

declare void @_ZN16FileStorageParam10setDefaultEPKS_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef) local_unnamed_addr #3

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN8CmPkcs1210parseBytesEPhPP12ByteArray_st(ptr noundef, ptr noundef) local_unnamed_addr #0 align 2

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

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

declare void @_ZN11FileStorage14loadFromBufferEP12ByteArray_stb(ptr noundef nonnull align 8 dereferenceable(152), ptr noundef, i1 noundef zeroext) local_unnamed_addr #3

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN7UapkiNS7SmartBA3setEP12ByteArray_st(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #5 align 2

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef i32 @_ZL14err_to_cmerrori(i32 noundef) local_unnamed_addr #5

declare noundef i32 @_ZN11FileStorage12loadFromFileERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEb(ptr noundef nonnull align 8 dereferenceable(152), ptr noundef nonnull align 8 dereferenceable(32), i1 noundef zeroext) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #5 align 2

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN8CmPkcs1211parseConfigEPhR16FileStorageParam(ptr noundef, ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #0 align 2

declare void @_ZN11FileStorage6createERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(152), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #3

; Function Attrs: nounwind
declare void @_ZN20SessionPkcs12ContextD1Ev(ptr noundef nonnull align 8 dereferenceable(376)) unnamed_addr #7

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @calloc(i64 noundef, i64 noundef) local_unnamed_addr #8

declare void @_ZN8CmPkcs1217assignSessionFuncER17CM_SESSION_API_ST(ptr noundef nonnull align 8 dereferenceable(144)) local_unnamed_addr #3

declare void @_ZN8CmPkcs1213assignKeyFuncER13CM_KEY_API_ST(ptr noundef nonnull align 8 dereferenceable(160)) local_unnamed_addr #3

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

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

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nobuiltin allocsize(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 = { 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 #5 = { 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 #6 = { 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 #7 = { 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 #8 = { mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #9 = { builtin allocsize(0) }
attributes #10 = { builtin nounwind }
attributes #11 = { nounwind }
attributes #12 = { nounwind willreturn memory(read) }
attributes #13 = { nounwind allocsize(0,1) }

!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,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass