; LLVM IR from specinfo-ua/UAPKI :: library/uapki/src/api (remove-cert)

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

@.str = external hidden unnamed_addr constant [10 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local i32 @uapki_remove_cert(ptr noundef %0, ptr noundef %1) #0 personality ptr @__gxx_personality_v0 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i8, align 1
  %10 = alloca i8, align 1
  %11 = alloca %"class.UapkiNS::SmartBA", align 8
  %12 = alloca %"class.UapkiNS::SmartBA", align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca %"class.UapkiNS::SmartBA", align 8
  %16 = alloca ptr, align 8
  %17 = alloca i32, align 4
  %18 = alloca i8, align 1
  %19 = alloca i8, align 1
  %20 = alloca ptr, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 0, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %21 = call noundef ptr @_ZN7UapkiNS10get_configEv()
  store ptr %21, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %22 = call noundef ptr @_ZN7UapkiNS12get_cerstoreEv()
  store ptr %22, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #6
  %23 = load ptr, ptr %4, align 8, !tbaa !5
  %24 = call noundef zeroext i1 @_ZN12ParsonHelper20jsonObjectGetBooleanEP13json_object_tPKcb(ptr noundef %23, ptr noundef @.str, i1 noundef zeroext false)
  %25 = zext i1 %24 to i8
  store i8 %25, ptr %9, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 1, ptr %10) #6
  %26 = load ptr, ptr %4, align 8, !tbaa !5
  %27 = call noundef zeroext i1 @_ZN12ParsonHelper20jsonObjectGetBooleanEP13json_object_tPKcb(ptr noundef %26, ptr noundef @.str.1, i1 noundef zeroext false)
  %28 = zext i1 %27 to i8
  store i8 %28, ptr %10, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  call void @_ZN7UapkiNS7SmartBAC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %11)
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  invoke void @_ZN7UapkiNS7SmartBAC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %12)
          to label %29 unwind label %37

29:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  invoke void @_ZN7UapkiNS7SmartBAC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %15)
          to label %30 unwind label %41

30:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  store ptr null, ptr %16, align 8, !tbaa !5
  %31 = load ptr, ptr %7, align 8, !tbaa !5
  %32 = icmp ne ptr %31, null
  br i1 %32, label %33, label %36

33:                                               ; preds = %30
  %34 = load ptr, ptr %8, align 8, !tbaa !5
  %35 = icmp ne ptr %34, null
  br i1 %35, label %45, label %36

36:                                               ; preds = %33, %30
  store i32 4097, ptr %3, align 4
  store i32 1, ptr %17, align 4
  br label %276

37:                                               ; preds = %2
  %38 = landingpad { ptr, i32 }
          cleanup
  %39 = extractvalue { ptr, i32 } %38, 0
  store ptr %39, ptr %13, align 8
  %40 = extractvalue { ptr, i32 } %38, 1
  store i32 %40, ptr %14, align 4
  br label %280

41:                                               ; preds = %29
  %42 = landingpad { ptr, i32 }
          cleanup
  %43 = extractvalue { ptr, i32 } %42, 0
  store ptr %43, ptr %13, align 8
  %44 = extractvalue { ptr, i32 } %42, 1
  store i32 %44, ptr %14, align 4
  br label %279

45:                                               ; preds = %33
  %46 = load ptr, ptr %7, align 8, !tbaa !5
  %47 = invoke noundef zeroext i1 @_ZNK7UapkiNS13LibraryConfig13isInitializedEv(ptr noundef nonnull align 8 dereferenceable(97) %46)
          to label %48 unwind label %50

48:                                               ; preds = %45
  br i1 %47, label %54, label %49

49:                                               ; preds = %48
  store i32 4105, ptr %3, align 4
  store i32 1, ptr %17, align 4
  br label %276

50:                                               ; preds = %136, %130, %123, %114, %108, %103, %100, %96, %93, %87, %78, %72, %67, %64, %60, %57, %45
  %51 = landingpad { ptr, i32 }
          cleanup
  %52 = extractvalue { ptr, i32 } %51, 0
  store ptr %52, ptr %13, align 8
  %53 = extractvalue { ptr, i32 } %51, 1
  store i32 %53, ptr %14, align 4
  br label %278

54:                                               ; preds = %48
  %55 = load i8, ptr %10, align 1, !tbaa !11, !range !13, !noundef !14
  %56 = trunc i8 %55 to i1
  br i1 %56, label %144, label %57

57:                                               ; preds = %54
  %58 = load ptr, ptr %4, align 8, !tbaa !5
  %59 = invoke ptr @json_object_get_base64(ptr noundef %58, ptr noundef @.str.2)
          to label %60 unwind label %50

60:                                               ; preds = %57
  %61 = invoke noundef zeroext i1 @_ZN7UapkiNS7SmartBA3setEP12ByteArray_st(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef %59)
          to label %62 unwind label %50

62:                                               ; preds = %60
  br i1 %61, label %63, label %93

63:                                               ; preds = %62
  br label %64

64:                                               ; preds = %63
  %65 = load ptr, ptr %8, align 8, !tbaa !5
  %66 = invoke noundef ptr @_ZNK7UapkiNS7SmartBA3getEv(ptr noundef nonnull align 8 dereferenceable(8) %11)
          to label %67 unwind label %50

67:                                               ; preds = %64
  %68 = invoke noundef i32 @_ZN7UapkiNS4Cert8CerStore15getCertByCertIdEPK12ByteArray_stPPNS0_7CerItemE(ptr noundef nonnull align 8 dereferenceable(96) %65, ptr noundef %66, ptr noundef %16)
          to label %69 unwind label %50

69:                                               ; preds = %67
  store i32 %68, ptr %6, align 4, !tbaa !9
  %70 = load i32, ptr %6, align 4, !tbaa !9
  %71 = icmp ne i32 %70, 0
  br i1 %71, label %72, label %75

72:                                               ; preds = %69
  %73 = load i32, ptr %6, align 4, !tbaa !9
  invoke void @stacktrace_add(ptr noundef @.str.3, i64 noundef 57, i32 noundef %73)
          to label %74 unwind label %50

74:                                               ; preds = %72
  br label %274

75:                                               ; preds = %69
  br label %76

76:                                               ; preds = %75
  br label %77

77:                                               ; preds = %76
  br label %78

78:                                               ; preds = %77
  %79 = load ptr, ptr %8, align 8, !tbaa !5
  %80 = load ptr, ptr %16, align 8, !tbaa !5
  %81 = load i8, ptr %9, align 1, !tbaa !11, !range !13, !noundef !14
  %82 = trunc i8 %81 to i1
  %83 = invoke noundef i32 @_ZN7UapkiNS4Cert8CerStore10removeCertEPNS0_7CerItemEb(ptr noundef nonnull align 8 dereferenceable(96) %79, ptr noundef %80, i1 noundef zeroext %82)
          to label %84 unwind label %50

84:                                               ; preds = %78
  store i32 %83, ptr %6, align 4, !tbaa !9
  %85 = load i32, ptr %6, align 4, !tbaa !9
  %86 = icmp ne i32 %85, 0
  br i1 %86, label %87, label %90

87:                                               ; preds = %84
  %88 = load i32, ptr %6, align 4, !tbaa !9
  invoke void @stacktrace_add(ptr noundef @.str.3, i64 noundef 58, i32 noundef %88)
          to label %89 unwind label %50

89:                                               ; preds = %87
  br label %274

90:                                               ; preds = %84
  br label %91

91:                                               ; preds = %90
  br label %92

92:                                               ; preds = %91
  br label %143

93:                                               ; preds = %62
  %94 = load ptr, ptr %4, align 8, !tbaa !5
  %95 = invoke ptr @json_object_get_base64(ptr noundef %94, ptr noundef @.str.4)
          to label %96 unwind label %50

96:                                               ; preds = %93
  %97 = invoke noundef zeroext i1 @_ZN7UapkiNS7SmartBA3setEP12ByteArray_st(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef %95)
          to label %98 unwind label %50

98:                                               ; preds = %96
  br i1 %97, label %99, label %129

99:                                               ; preds = %98
  br label %100

100:                                              ; preds = %99
  %101 = load ptr, ptr %8, align 8, !tbaa !5
  %102 = invoke noundef ptr @_ZNK7UapkiNS7SmartBA3getEv(ptr noundef nonnull align 8 dereferenceable(8) %12)
          to label %103 unwind label %50

103:                                              ; preds = %100
  %104 = invoke noundef i32 @_ZN7UapkiNS4Cert8CerStore16getCertByEncodedEPK12ByteArray_stPPNS0_7CerItemE(ptr noundef nonnull align 8 dereferenceable(96) %101, ptr noundef %102, ptr noundef %16)
          to label %105 unwind label %50

105:                                              ; preds = %103
  store i32 %104, ptr %6, align 4, !tbaa !9
  %106 = load i32, ptr %6, align 4, !tbaa !9
  %107 = icmp ne i32 %106, 0
  br i1 %107, label %108, label %111

108:                                              ; preds = %105
  %109 = load i32, ptr %6, align 4, !tbaa !9
  invoke void @stacktrace_add(ptr noundef @.str.3, i64 noundef 61, i32 noundef %109)
          to label %110 unwind label %50

110:                                              ; preds = %108
  br label %274

111:                                              ; preds = %105
  br label %112

112:                                              ; preds = %111
  br label %113

113:                                              ; preds = %112
  br label %114

114:                                              ; preds = %113
  %115 = load ptr, ptr %8, align 8, !tbaa !5
  %116 = load ptr, ptr %16, align 8, !tbaa !5
  %117 = load i8, ptr %9, align 1, !tbaa !11, !range !13, !noundef !14
  %118 = trunc i8 %117 to i1
  %119 = invoke noundef i32 @_ZN7UapkiNS4Cert8CerStore10removeCertEPNS0_7CerItemEb(ptr noundef nonnull align 8 dereferenceable(96) %115, ptr noundef %116, i1 noundef zeroext %118)
          to label %120 unwind label %50

120:                                              ; preds = %114
  store i32 %119, ptr %6, align 4, !tbaa !9
  %121 = load i32, ptr %6, align 4, !tbaa !9
  %122 = icmp ne i32 %121, 0
  br i1 %122, label %123, label %126

123:                                              ; preds = %120
  %124 = load i32, ptr %6, align 4, !tbaa !9
  invoke void @stacktrace_add(ptr noundef @.str.3, i64 noundef 62, i32 noundef %124)
          to label %125 unwind label %50

125:                                              ; preds = %123
  br label %274

126:                                              ; preds = %120
  br label %127

127:                                              ; preds = %126
  br label %128

128:                                              ; preds = %127
  br label %142

129:                                              ; preds = %98
  br label %130

130:                                              ; preds = %129
  %131 = load ptr, ptr %8, align 8, !tbaa !5
  %132 = invoke noundef i32 @_ZN7UapkiNS4Cert8CerStore17removeMarkedCertsEv(ptr noundef nonnull align 8 dereferenceable(96) %131)
          to label %133 unwind label %50

133:                                              ; preds = %130
  store i32 %132, ptr %6, align 4, !tbaa !9
  %134 = load i32, ptr %6, align 4, !tbaa !9
  %135 = icmp ne i32 %134, 0
  br i1 %135, label %136, label %139

136:                                              ; preds = %133
  %137 = load i32, ptr %6, align 4, !tbaa !9
  invoke void @stacktrace_add(ptr noundef @.str.3, i64 noundef 65, i32 noundef %137)
          to label %138 unwind label %50

138:                                              ; preds = %136
  br label %274

139:                                              ; preds = %133
  br label %140

140:                                              ; preds = %139
  br label %141

141:                                              ; preds = %140
  br label %142

142:                                              ; preds = %141, %128
  br label %143

143:                                              ; preds = %142, %92
  br label %273

144:                                              ; preds = %54
  call void @llvm.lifetime.start.p0(i64 1, ptr %18) #6
  %145 = load ptr, ptr %4, align 8, !tbaa !5
  %146 = invoke noundef zeroext i1 @_ZN12ParsonHelper18jsonObjectHasValueEP13json_object_tPKci(ptr noundef %145, ptr noundef @.str.4, i32 noundef 2)
          to label %147 unwind label %165

147:                                              ; preds = %144
  %148 = zext i1 %146 to i8
  store i8 %148, ptr %18, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 1, ptr %19) #6
  %149 = load ptr, ptr %4, align 8, !tbaa !5
  %150 = invoke noundef zeroext i1 @_ZN12ParsonHelper18jsonObjectHasValueEP13json_object_tPKci(ptr noundef %149, ptr noundef @.str.2, i32 noundef 2)
          to label %151 unwind label %169

151:                                              ; preds = %147
  %152 = zext i1 %150 to i8
  store i8 %152, ptr %19, align 1, !tbaa !11
  %153 = load i8, ptr %18, align 1, !tbaa !11, !range !13, !noundef !14
  %154 = trunc i8 %153 to i1
  br i1 %154, label %155, label %158

155:                                              ; preds = %151
  %156 = load i8, ptr %19, align 1, !tbaa !11, !range !13, !noundef !14
  %157 = trunc i8 %156 to i1
  br i1 %157, label %164, label %158

158:                                              ; preds = %155, %151
  %159 = load i8, ptr %18, align 1, !tbaa !11, !range !13, !noundef !14
  %160 = trunc i8 %159 to i1
  br i1 %160, label %173, label %161

161:                                              ; preds = %158
  %162 = load i8, ptr %19, align 1, !tbaa !11, !range !13, !noundef !14
  %163 = trunc i8 %162 to i1
  br i1 %163, label %173, label %164

164:                                              ; preds = %161, %155
  store i32 4101, ptr %3, align 4
  store i32 1, ptr %17, align 4
  br label %268

165:                                              ; preds = %144
  %166 = landingpad { ptr, i32 }
          cleanup
  %167 = extractvalue { ptr, i32 } %166, 0
  store ptr %167, ptr %13, align 8
  %168 = extractvalue { ptr, i32 } %166, 1
  store i32 %168, ptr %14, align 4
  br label %272

169:                                              ; preds = %147
  %170 = landingpad { ptr, i32 }
          cleanup
  %171 = extractvalue { ptr, i32 } %170, 0
  store ptr %171, ptr %13, align 8
  %172 = extractvalue { ptr, i32 } %170, 1
  store i32 %172, ptr %14, align 4
  br label %271

173:                                              ; preds = %161, %158
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #6
  %174 = invoke noundef ptr @_ZN11CmProviders13openedStorageEv()
          to label %175 unwind label %179

175:                                              ; preds = %173
  store ptr %174, ptr %20, align 8, !tbaa !5
  %176 = load ptr, ptr %20, align 8, !tbaa !5
  %177 = icmp ne ptr %176, null
  br i1 %177, label %183, label %178

178:                                              ; preds = %175
  store i32 4121, ptr %3, align 4
  store i32 1, ptr %17, align 4
  br label %267

179:                                              ; preds = %261, %256, %253, %247, %243, %239, %237, %234, %229, %224, %221, %217, %214, %207, %205, %202, %197, %192, %190, %186, %183, %173
  %180 = landingpad { ptr, i32 }
          cleanup
  %181 = extractvalue { ptr, i32 } %180, 0
  store ptr %181, ptr %13, align 8
  %182 = extractvalue { ptr, i32 } %180, 1
  store i32 %182, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  br label %271

183:                                              ; preds = %175
  %184 = load ptr, ptr %4, align 8, !tbaa !5
  %185 = invoke ptr @json_object_get_base64(ptr noundef %184, ptr noundef @.str.4)
          to label %186 unwind label %179

186:                                              ; preds = %183
  %187 = invoke noundef zeroext i1 @_ZN7UapkiNS7SmartBA3setEP12ByteArray_st(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef %185)
          to label %188 unwind label %179

188:                                              ; preds = %186
  br i1 %187, label %189, label %214

189:                                              ; preds = %188
  br label %190

190:                                              ; preds = %189
  %191 = invoke noundef ptr @_ZNK7UapkiNS7SmartBA3getEv(ptr noundef nonnull align 8 dereferenceable(8) %12)
          to label %192 unwind label %179

192:                                              ; preds = %190
  %193 = invoke noundef i32 @_ZN7UapkiNS4Cert9parseCertEPK12ByteArray_stPPNS0_7CerItemE(ptr noundef %191, ptr noundef %16)
          to label %194 unwind label %179

194:                                              ; preds = %192
  store i32 %193, ptr %6, align 4, !tbaa !9
  %195 = load i32, ptr %6, align 4, !tbaa !9
  %196 = icmp ne i32 %195, 0
  br i1 %196, label %197, label %200

197:                                              ; preds = %194
  %198 = load i32, ptr %6, align 4, !tbaa !9
  invoke void @stacktrace_add(ptr noundef @.str.3, i64 noundef 82, i32 noundef %198)
          to label %199 unwind label %179

199:                                              ; preds = %197
  store i32 4, ptr %17, align 4
  br label %267

200:                                              ; preds = %194
  br label %201

201:                                              ; preds = %200
  br label %202

202:                                              ; preds = %201
  %203 = load ptr, ptr %16, align 8, !tbaa !5
  %204 = invoke noundef ptr @_ZNK7UapkiNS4Cert7CerItem8getKeyIdEv(ptr noundef nonnull align 8 dereferenceable(401) %203)
          to label %205 unwind label %179

205:                                              ; preds = %202
  %206 = invoke ptr @ba_copy_with_alloc(ptr noundef %204, i64 noundef 0, i64 noundef 0)
          to label %207 unwind label %179

207:                                              ; preds = %205
  %208 = invoke noundef zeroext i1 @_ZN7UapkiNS7SmartBA3setEP12ByteArray_st(ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef %206)
          to label %209 unwind label %179

209:                                              ; preds = %207
  %210 = load ptr, ptr %16, align 8, !tbaa !5
  %211 = icmp eq ptr %210, null
  br i1 %211, label %213, label %212

212:                                              ; preds = %209
  call void @_ZN7UapkiNS4Cert7CerItemD1Ev(ptr noundef nonnull align 8 dereferenceable(401) %210) #6
  call void @_ZdlPvm(ptr noundef %210, i64 noundef 408) #7
  br label %213

213:                                              ; preds = %212, %209
  br label %243

214:                                              ; preds = %188
  %215 = load ptr, ptr %4, align 8, !tbaa !5
  %216 = invoke ptr @json_object_get_base64(ptr noundef %215, ptr noundef @.str.2)
          to label %217 unwind label %179

217:                                              ; preds = %214
  %218 = invoke noundef zeroext i1 @_ZN7UapkiNS7SmartBA3setEP12ByteArray_st(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef %216)
          to label %219 unwind label %179

219:                                              ; preds = %217
  br i1 %218, label %220, label %242

220:                                              ; preds = %219
  br label %221

221:                                              ; preds = %220
  %222 = load ptr, ptr %8, align 8, !tbaa !5
  %223 = invoke noundef ptr @_ZNK7UapkiNS7SmartBA3getEv(ptr noundef nonnull align 8 dereferenceable(8) %11)
          to label %224 unwind label %179

224:                                              ; preds = %221
  %225 = invoke noundef i32 @_ZN7UapkiNS4Cert8CerStore15getCertByCertIdEPK12ByteArray_stPPNS0_7CerItemE(ptr noundef nonnull align 8 dereferenceable(96) %222, ptr noundef %223, ptr noundef %16)
          to label %226 unwind label %179

226:                                              ; preds = %224
  store i32 %225, ptr %6, align 4, !tbaa !9
  %227 = load i32, ptr %6, align 4, !tbaa !9
  %228 = icmp ne i32 %227, 0
  br i1 %228, label %229, label %232

229:                                              ; preds = %226
  %230 = load i32, ptr %6, align 4, !tbaa !9
  invoke void @stacktrace_add(ptr noundef @.str.3, i64 noundef 87, i32 noundef %230)
          to label %231 unwind label %179

231:                                              ; preds = %229
  store i32 4, ptr %17, align 4
  br label %267

232:                                              ; preds = %226
  br label %233

233:                                              ; preds = %232
  br label %234

234:                                              ; preds = %233
  %235 = load ptr, ptr %16, align 8, !tbaa !5
  %236 = invoke noundef ptr @_ZNK7UapkiNS4Cert7CerItem8getKeyIdEv(ptr noundef nonnull align 8 dereferenceable(401) %235)
          to label %237 unwind label %179

237:                                              ; preds = %234
  %238 = invoke ptr @ba_copy_with_alloc(ptr noundef %236, i64 noundef 0, i64 noundef 0)
          to label %239 unwind label %179

239:                                              ; preds = %237
  %240 = invoke noundef zeroext i1 @_ZN7UapkiNS7SmartBA3setEP12ByteArray_st(ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef %238)
          to label %241 unwind label %179

241:                                              ; preds = %239
  br label %242

242:                                              ; preds = %241, %219
  br label %243

243:                                              ; preds = %242, %213
  %244 = invoke noundef zeroext i1 @_ZNK7UapkiNS7SmartBA5emptyEv(ptr noundef nonnull align 8 dereferenceable(8) %15)
          to label %245 unwind label %179

245:                                              ; preds = %243
  br i1 %244, label %246, label %252

246:                                              ; preds = %245
  br label %247

247:                                              ; preds = %246
  store i32 4097, ptr %6, align 4, !tbaa !9
  %248 = load i32, ptr %6, align 4, !tbaa !9
  invoke void @stacktrace_create(ptr noundef @.str.3, i64 noundef 92, i32 noundef %248, ptr noundef null)
          to label %249 unwind label %179

249:                                              ; preds = %247
  store i32 4, ptr %17, align 4
  br label %267

250:                                              ; No predecessors!
  br label %251

251:                                              ; preds = %250
  br label %252

252:                                              ; preds = %251, %245
  br label %253

253:                                              ; preds = %252
  %254 = load ptr, ptr %20, align 8, !tbaa !5
  %255 = invoke noundef ptr @_ZNK7UapkiNS7SmartBA3getEv(ptr noundef nonnull align 8 dereferenceable(8) %15)
          to label %256 unwind label %179

256:                                              ; preds = %253
  %257 = invoke noundef i32 @_ZN14CmStorageProxy24sessionDeleteCertificateEPK12ByteArray_st(ptr noundef nonnull align 8 dereferenceable(168) %254, ptr noundef %255)
          to label %258 unwind label %179

258:                                              ; preds = %256
  store i32 %257, ptr %6, align 4, !tbaa !9
  %259 = load i32, ptr %6, align 4, !tbaa !9
  %260 = icmp ne i32 %259, 0
  br i1 %260, label %261, label %264

261:                                              ; preds = %258
  %262 = load i32, ptr %6, align 4, !tbaa !9
  invoke void @stacktrace_add(ptr noundef @.str.3, i64 noundef 95, i32 noundef %262)
          to label %263 unwind label %179

263:                                              ; preds = %261
  store i32 4, ptr %17, align 4
  br label %267

264:                                              ; preds = %258
  br label %265

265:                                              ; preds = %264
  br label %266

266:                                              ; preds = %265
  store i32 0, ptr %17, align 4
  br label %267

267:                                              ; preds = %266, %263, %249, %231, %199, %178
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  br label %268

268:                                              ; preds = %267, %164
  call void @llvm.lifetime.end.p0(i64 1, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %18) #6
  %269 = load i32, ptr %17, align 4
  switch i32 %269, label %276 [
    i32 0, label %270
    i32 4, label %274
  ]

270:                                              ; preds = %268
  br label %273

271:                                              ; preds = %179, %169
  call void @llvm.lifetime.end.p0(i64 1, ptr %19) #6
  br label %272

272:                                              ; preds = %271, %165
  call void @llvm.lifetime.end.p0(i64 1, ptr %18) #6
  br label %278

273:                                              ; preds = %270, %143
  br label %274

274:                                              ; preds = %273, %268, %138, %125, %110, %89, %74
  %275 = load i32, ptr %6, align 4, !tbaa !9
  store i32 %275, ptr %3, align 4
  store i32 1, ptr %17, align 4
  br label %276

276:                                              ; preds = %274, %268, %49, %36
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @_ZN7UapkiNS7SmartBAD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @_ZN7UapkiNS7SmartBAD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @_ZN7UapkiNS7SmartBAD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  %277 = load i32, ptr %3, align 4
  ret i32 %277

278:                                              ; preds = %272, %50
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @_ZN7UapkiNS7SmartBAD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %15) #6
  br label %279

279:                                              ; preds = %278, %41
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @_ZN7UapkiNS7SmartBAD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %12) #6
  br label %280

280:                                              ; preds = %279, %37
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @_ZN7UapkiNS7SmartBAD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %281

281:                                              ; preds = %280
  %282 = load ptr, ptr %13, align 8
  %283 = load i32, ptr %14, align 4
  %284 = insertvalue { ptr, i32 } poison, ptr %282, 0
  %285 = insertvalue { ptr, i32 } %284, i32 %283, 1
  resume { ptr, i32 } %285
}

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

declare noundef ptr @_ZN7UapkiNS10get_configEv() #2

declare noundef ptr @_ZN7UapkiNS12get_cerstoreEv() #2

declare noundef zeroext i1 @_ZN12ParsonHelper20jsonObjectGetBooleanEP13json_object_tPKcb(ptr noundef, ptr noundef, i1 noundef zeroext) #2

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK7UapkiNS13LibraryConfig13isInitializedEv(ptr noundef nonnull align 8 dereferenceable(97)) #3 align 2

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

declare ptr @json_object_get_base64(ptr noundef, ptr noundef) #2

declare noundef i32 @_ZN7UapkiNS4Cert8CerStore15getCertByCertIdEPK12ByteArray_stPPNS0_7CerItemE(ptr noundef nonnull align 8 dereferenceable(96), ptr noundef, ptr noundef) #2

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

declare void @stacktrace_add(ptr noundef, i64 noundef, i32 noundef) #2

declare noundef i32 @_ZN7UapkiNS4Cert8CerStore10removeCertEPNS0_7CerItemEb(ptr noundef nonnull align 8 dereferenceable(96), ptr noundef, i1 noundef zeroext) #2

declare noundef i32 @_ZN7UapkiNS4Cert8CerStore16getCertByEncodedEPK12ByteArray_stPPNS0_7CerItemE(ptr noundef nonnull align 8 dereferenceable(96), ptr noundef, ptr noundef) #2

declare noundef i32 @_ZN7UapkiNS4Cert8CerStore17removeMarkedCertsEv(ptr noundef nonnull align 8 dereferenceable(96)) #2

declare noundef zeroext i1 @_ZN12ParsonHelper18jsonObjectHasValueEP13json_object_tPKci(ptr noundef, ptr noundef, i32 noundef) #2

declare noundef ptr @_ZN11CmProviders13openedStorageEv() #2

declare noundef i32 @_ZN7UapkiNS4Cert9parseCertEPK12ByteArray_stPPNS0_7CerItemE(ptr noundef, ptr noundef) #2

declare ptr @ba_copy_with_alloc(ptr noundef, i64 noundef, i64 noundef) #2

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

; Function Attrs: nounwind
declare void @_ZN7UapkiNS4Cert7CerItemD1Ev(ptr noundef nonnull align 8 dereferenceable(401)) unnamed_addr #4

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

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

declare void @stacktrace_create(ptr noundef, i64 noundef, i32 noundef, ptr noundef) #2

declare noundef i32 @_ZN14CmStorageProxy24sessionDeleteCertificateEPK12ByteArray_st(ptr noundef nonnull align 8 dereferenceable(168), ptr noundef) #2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN7UapkiNS7SmartBAD2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #3 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress 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 = { 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 = { 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 = { nounwind }
attributes #7 = { 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"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{i8 0, i8 2}
!14 = !{}


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

@.str = external hidden unnamed_addr constant [10 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @uapki_remove_cert(ptr noundef %0, ptr nocapture noundef readnone %1) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.UapkiNS::SmartBA", align 8
  %4 = alloca %"class.UapkiNS::SmartBA", align 8
  %5 = alloca %"class.UapkiNS::SmartBA", align 8
  %6 = alloca ptr, align 8
  %7 = tail call noundef ptr @_ZN7UapkiNS10get_configEv()
  %8 = tail call noundef ptr @_ZN7UapkiNS12get_cerstoreEv()
  %9 = tail call noundef zeroext i1 @_ZN12ParsonHelper20jsonObjectGetBooleanEP13json_object_tPKcb(ptr noundef %0, ptr noundef nonnull @.str, i1 noundef zeroext false)
  %10 = tail call noundef zeroext i1 @_ZN12ParsonHelper20jsonObjectGetBooleanEP13json_object_tPKcb(ptr noundef %0, ptr noundef nonnull @.str.1, i1 noundef zeroext false)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  call void @_ZN7UapkiNS7SmartBAC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %3)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  call void @_ZN7UapkiNS7SmartBAC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %4)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  call void @_ZN7UapkiNS7SmartBAC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #6
  store ptr null, ptr %6, align 8, !tbaa !5
  %11 = icmp ne ptr %7, null
  %12 = icmp ne ptr %8, null
  %or.cond = and i1 %11, %12
  br i1 %or.cond, label %13, label %106

13:                                               ; preds = %2
  %14 = call noundef zeroext i1 @_ZNK7UapkiNS13LibraryConfig13isInitializedEv(ptr noundef nonnull align 8 dereferenceable(97) %7)
  br i1 %14, label %17, label %106

15:                                               ; preds = %49, %46, %45, %41, %40, %36, %32, %31, %27, %26, %22, %18
  %16 = landingpad { ptr, i32 }
          cleanup
  br label %107

17:                                               ; preds = %13
  br i1 %10, label %50, label %18

18:                                               ; preds = %17
  %19 = invoke ptr @json_object_get_base64(ptr noundef %0, ptr noundef nonnull @.str.2)
          to label %20 unwind label %15

20:                                               ; preds = %18
  %21 = call noundef zeroext i1 @_ZN7UapkiNS7SmartBA3setEP12ByteArray_st(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef %19)
  br i1 %21, label %22, label %32

22:                                               ; preds = %20
  %23 = call noundef ptr @_ZNK7UapkiNS7SmartBA3getEv(ptr noundef nonnull align 8 dereferenceable(8) %3)
  %24 = invoke noundef i32 @_ZN7UapkiNS4Cert8CerStore15getCertByCertIdEPK12ByteArray_stPPNS0_7CerItemE(ptr noundef nonnull align 8 dereferenceable(96) %8, ptr noundef %23, ptr noundef nonnull %6)
          to label %25 unwind label %15

25:                                               ; preds = %22
  %.not76 = icmp eq i32 %24, 0
  br i1 %.not76, label %27, label %26

26:                                               ; preds = %25
  invoke void @stacktrace_add(ptr noundef nonnull @.str.3, i64 noundef 57, i32 noundef %24)
          to label %106 unwind label %15

27:                                               ; preds = %25
  %28 = load ptr, ptr %6, align 8, !tbaa !5
  %29 = invoke noundef i32 @_ZN7UapkiNS4Cert8CerStore10removeCertEPNS0_7CerItemEb(ptr noundef nonnull align 8 dereferenceable(96) %8, ptr noundef %28, i1 noundef zeroext %9)
          to label %30 unwind label %15

30:                                               ; preds = %27
  %.not77 = icmp eq i32 %29, 0
  br i1 %.not77, label %106, label %31

31:                                               ; preds = %30
  invoke void @stacktrace_add(ptr noundef nonnull @.str.3, i64 noundef 58, i32 noundef %29)
          to label %106 unwind label %15

32:                                               ; preds = %20
  %33 = invoke ptr @json_object_get_base64(ptr noundef %0, ptr noundef nonnull @.str.4)
          to label %34 unwind label %15

34:                                               ; preds = %32
  %35 = call noundef zeroext i1 @_ZN7UapkiNS7SmartBA3setEP12ByteArray_st(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef %33)
  br i1 %35, label %36, label %46

36:                                               ; preds = %34
  %37 = call noundef ptr @_ZNK7UapkiNS7SmartBA3getEv(ptr noundef nonnull align 8 dereferenceable(8) %4)
  %38 = invoke noundef i32 @_ZN7UapkiNS4Cert8CerStore16getCertByEncodedEPK12ByteArray_stPPNS0_7CerItemE(ptr noundef nonnull align 8 dereferenceable(96) %8, ptr noundef %37, ptr noundef nonnull %6)
          to label %39 unwind label %15

39:                                               ; preds = %36
  %.not74 = icmp eq i32 %38, 0
  br i1 %.not74, label %41, label %40

40:                                               ; preds = %39
  invoke void @stacktrace_add(ptr noundef nonnull @.str.3, i64 noundef 61, i32 noundef %38)
          to label %106 unwind label %15

41:                                               ; preds = %39
  %42 = load ptr, ptr %6, align 8, !tbaa !5
  %43 = invoke noundef i32 @_ZN7UapkiNS4Cert8CerStore10removeCertEPNS0_7CerItemEb(ptr noundef nonnull align 8 dereferenceable(96) %8, ptr noundef %42, i1 noundef zeroext %9)
          to label %44 unwind label %15

44:                                               ; preds = %41
  %.not75 = icmp eq i32 %43, 0
  br i1 %.not75, label %106, label %45

45:                                               ; preds = %44
  invoke void @stacktrace_add(ptr noundef nonnull @.str.3, i64 noundef 62, i32 noundef %43)
          to label %106 unwind label %15

46:                                               ; preds = %34
  %47 = invoke noundef i32 @_ZN7UapkiNS4Cert8CerStore17removeMarkedCertsEv(ptr noundef nonnull align 8 dereferenceable(96) %8)
          to label %48 unwind label %15

48:                                               ; preds = %46
  %.not = icmp eq i32 %47, 0
  br i1 %.not, label %106, label %49

49:                                               ; preds = %48
  invoke void @stacktrace_add(ptr noundef nonnull @.str.3, i64 noundef 65, i32 noundef %47)
          to label %106 unwind label %15

50:                                               ; preds = %17
  %51 = invoke noundef zeroext i1 @_ZN12ParsonHelper18jsonObjectHasValueEP13json_object_tPKci(ptr noundef %0, ptr noundef nonnull @.str.4, i32 noundef 2)
          to label %52 unwind label %55

52:                                               ; preds = %50
  %53 = invoke noundef zeroext i1 @_ZN12ParsonHelper18jsonObjectHasValueEP13json_object_tPKci(ptr noundef %0, ptr noundef nonnull @.str.2, i32 noundef 2)
          to label %54 unwind label %57

54:                                               ; preds = %52
  %or.cond88 = xor i1 %51, %53
  br i1 %or.cond88, label %59, label %106

55:                                               ; preds = %50
  %56 = landingpad { ptr, i32 }
          cleanup
  br label %107

57:                                               ; preds = %52
  %58 = landingpad { ptr, i32 }
          cleanup
  br label %107

59:                                               ; preds = %54
  %60 = invoke noundef ptr @_ZN11CmProviders13openedStorageEv()
          to label %61 unwind label %62

61:                                               ; preds = %59
  %.not78 = icmp eq ptr %60, null
  br i1 %.not78, label %106, label %64

62:                                               ; preds = %105, %101, %100, %97, %91, %90, %86, %82, %73, %72, %68, %64, %59
  %63 = landingpad { ptr, i32 }
          cleanup
  br label %107

64:                                               ; preds = %61
  %65 = invoke ptr @json_object_get_base64(ptr noundef %0, ptr noundef nonnull @.str.4)
          to label %66 unwind label %62

66:                                               ; preds = %64
  %67 = call noundef zeroext i1 @_ZN7UapkiNS7SmartBA3setEP12ByteArray_st(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef %65)
  br i1 %67, label %68, label %82

68:                                               ; preds = %66
  %69 = call noundef ptr @_ZNK7UapkiNS7SmartBA3getEv(ptr noundef nonnull align 8 dereferenceable(8) %4)
  %70 = invoke noundef i32 @_ZN7UapkiNS4Cert9parseCertEPK12ByteArray_stPPNS0_7CerItemE(ptr noundef %69, ptr noundef nonnull %6)
          to label %71 unwind label %62

71:                                               ; preds = %68
  %.not80 = icmp eq i32 %70, 0
  br i1 %.not80, label %73, label %72

72:                                               ; preds = %71
  invoke void @stacktrace_add(ptr noundef nonnull @.str.3, i64 noundef 82, i32 noundef %70)
          to label %106 unwind label %62

73:                                               ; preds = %71
  %74 = load ptr, ptr %6, align 8, !tbaa !5
  %75 = call noundef ptr @_ZNK7UapkiNS4Cert7CerItem8getKeyIdEv(ptr noundef nonnull align 8 dereferenceable(401) %74)
  %76 = invoke ptr @ba_copy_with_alloc(ptr noundef %75, i64 noundef 0, i64 noundef 0)
          to label %77 unwind label %62

77:                                               ; preds = %73
  %78 = call noundef zeroext i1 @_ZN7UapkiNS7SmartBA3setEP12ByteArray_st(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef %76)
  %79 = load ptr, ptr %6, align 8, !tbaa !5
  %80 = icmp eq ptr %79, null
  br i1 %80, label %97, label %81

81:                                               ; preds = %77
  call void @_ZN7UapkiNS4Cert7CerItemD1Ev(ptr noundef nonnull align 8 dereferenceable(401) %79) #6
  call void @_ZdlPvm(ptr noundef nonnull %79, i64 noundef 408) #7
  br label %97

82:                                               ; preds = %66
  %83 = invoke ptr @json_object_get_base64(ptr noundef %0, ptr noundef nonnull @.str.2)
          to label %84 unwind label %62

84:                                               ; preds = %82
  %85 = call noundef zeroext i1 @_ZN7UapkiNS7SmartBA3setEP12ByteArray_st(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef %83)
  br i1 %85, label %86, label %97

86:                                               ; preds = %84
  %87 = call noundef ptr @_ZNK7UapkiNS7SmartBA3getEv(ptr noundef nonnull align 8 dereferenceable(8) %3)
  %88 = invoke noundef i32 @_ZN7UapkiNS4Cert8CerStore15getCertByCertIdEPK12ByteArray_stPPNS0_7CerItemE(ptr noundef nonnull align 8 dereferenceable(96) %8, ptr noundef %87, ptr noundef nonnull %6)
          to label %89 unwind label %62

89:                                               ; preds = %86
  %.not79 = icmp eq i32 %88, 0
  br i1 %.not79, label %91, label %90

90:                                               ; preds = %89
  invoke void @stacktrace_add(ptr noundef nonnull @.str.3, i64 noundef 87, i32 noundef %88)
          to label %106 unwind label %62

91:                                               ; preds = %89
  %92 = load ptr, ptr %6, align 8, !tbaa !5
  %93 = call noundef ptr @_ZNK7UapkiNS4Cert7CerItem8getKeyIdEv(ptr noundef nonnull align 8 dereferenceable(401) %92)
  %94 = invoke ptr @ba_copy_with_alloc(ptr noundef %93, i64 noundef 0, i64 noundef 0)
          to label %95 unwind label %62

95:                                               ; preds = %91
  %96 = call noundef zeroext i1 @_ZN7UapkiNS7SmartBA3setEP12ByteArray_st(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef %94)
  br label %97

97:                                               ; preds = %84, %95, %77, %81
  %98 = invoke noundef zeroext i1 @_ZNK7UapkiNS7SmartBA5emptyEv(ptr noundef nonnull align 8 dereferenceable(8) %5)
          to label %99 unwind label %62

99:                                               ; preds = %97
  br i1 %98, label %100, label %101

100:                                              ; preds = %99
  invoke void @stacktrace_create(ptr noundef nonnull @.str.3, i64 noundef 92, i32 noundef 4097, ptr noundef null)
          to label %106 unwind label %62

101:                                              ; preds = %99
  %102 = call noundef ptr @_ZNK7UapkiNS7SmartBA3getEv(ptr noundef nonnull align 8 dereferenceable(8) %5)
  %103 = invoke noundef i32 @_ZN14CmStorageProxy24sessionDeleteCertificateEPK12ByteArray_st(ptr noundef nonnull align 8 dereferenceable(168) %60, ptr noundef %102)
          to label %104 unwind label %62

104:                                              ; preds = %101
  %.not81 = icmp eq i32 %103, 0
  br i1 %.not81, label %106, label %105

105:                                              ; preds = %104
  invoke void @stacktrace_add(ptr noundef nonnull @.str.3, i64 noundef 95, i32 noundef %103)
          to label %106 unwind label %62

106:                                              ; preds = %104, %105, %100, %90, %72, %54, %61, %26, %31, %40, %45, %49, %30, %48, %44, %13, %2
  %.2 = phi i32 [ 4097, %2 ], [ 4105, %13 ], [ %24, %26 ], [ %29, %31 ], [ 0, %30 ], [ %38, %40 ], [ %43, %45 ], [ 0, %44 ], [ %47, %49 ], [ 0, %48 ], [ 4101, %54 ], [ 4121, %61 ], [ 0, %104 ], [ %103, %105 ], [ 4097, %100 ], [ %88, %90 ], [ %70, %72 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  call void @_ZN7UapkiNS7SmartBAD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  call void @_ZN7UapkiNS7SmartBAD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  call void @_ZN7UapkiNS7SmartBAD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  ret i32 %.2

107:                                              ; preds = %55, %62, %57, %15
  %.pn.pn.pn = phi { ptr, i32 } [ %16, %15 ], [ %56, %55 ], [ %63, %62 ], [ %58, %57 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  call void @_ZN7UapkiNS7SmartBAD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  call void @_ZN7UapkiNS7SmartBAD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  call void @_ZN7UapkiNS7SmartBAD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  resume { ptr, i32 } %.pn.pn.pn
}

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

declare noundef ptr @_ZN7UapkiNS10get_configEv() local_unnamed_addr #2

declare noundef ptr @_ZN7UapkiNS12get_cerstoreEv() local_unnamed_addr #2

declare noundef zeroext i1 @_ZN12ParsonHelper20jsonObjectGetBooleanEP13json_object_tPKcb(ptr noundef, ptr noundef, i1 noundef zeroext) local_unnamed_addr #2

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK7UapkiNS13LibraryConfig13isInitializedEv(ptr noundef nonnull align 8 dereferenceable(97)) local_unnamed_addr #3 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 #3 align 2

declare ptr @json_object_get_base64(ptr noundef, ptr noundef) local_unnamed_addr #2

declare noundef i32 @_ZN7UapkiNS4Cert8CerStore15getCertByCertIdEPK12ByteArray_stPPNS0_7CerItemE(ptr noundef nonnull align 8 dereferenceable(96), ptr noundef, ptr noundef) local_unnamed_addr #2

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

declare void @stacktrace_add(ptr noundef, i64 noundef, i32 noundef) local_unnamed_addr #2

declare noundef i32 @_ZN7UapkiNS4Cert8CerStore10removeCertEPNS0_7CerItemEb(ptr noundef nonnull align 8 dereferenceable(96), ptr noundef, i1 noundef zeroext) local_unnamed_addr #2

declare noundef i32 @_ZN7UapkiNS4Cert8CerStore16getCertByEncodedEPK12ByteArray_stPPNS0_7CerItemE(ptr noundef nonnull align 8 dereferenceable(96), ptr noundef, ptr noundef) local_unnamed_addr #2

declare noundef i32 @_ZN7UapkiNS4Cert8CerStore17removeMarkedCertsEv(ptr noundef nonnull align 8 dereferenceable(96)) local_unnamed_addr #2

declare noundef zeroext i1 @_ZN12ParsonHelper18jsonObjectHasValueEP13json_object_tPKci(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

declare noundef ptr @_ZN11CmProviders13openedStorageEv() local_unnamed_addr #2

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

declare ptr @ba_copy_with_alloc(ptr noundef, i64 noundef, i64 noundef) local_unnamed_addr #2

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

; Function Attrs: nounwind
declare void @_ZN7UapkiNS4Cert7CerItemD1Ev(ptr noundef nonnull align 8 dereferenceable(401)) unnamed_addr #4

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

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

declare void @stacktrace_create(ptr noundef, i64 noundef, i32 noundef, ptr noundef) local_unnamed_addr #2

declare noundef i32 @_ZN14CmStorageProxy24sessionDeleteCertificateEPK12ByteArray_st(ptr noundef nonnull align 8 dereferenceable(168), ptr noundef) local_unnamed_addr #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 nounwind uwtable
declare dso_local void @_ZN7UapkiNS7SmartBAD2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #3 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 = { "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 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 = { 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 = { 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 = { nounwind }
attributes #7 = { 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,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass