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

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"struct.UapkiNS::Pagination" = type { i64, i64, i64, i64 }
%"class.std::vector.3" = type { %"struct.std::_Vector_base.4" }
%"struct.std::_Vector_base.4" = type { %"struct.std::_Vector_base<UapkiNS::Cert::CerItem *, std::allocator<UapkiNS::Cert::CerItem *>>::_Vector_impl" }
%"struct.std::_Vector_base<UapkiNS::Cert::CerItem *, std::allocator<UapkiNS::Cert::CerItem *>>::_Vector_impl" = type { %"struct.std::_Vector_base<UapkiNS::Cert::CerItem *, std::allocator<UapkiNS::Cert::CerItem *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<UapkiNS::Cert::CerItem *, std::allocator<UapkiNS::Cert::CerItem *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.UapkiNS::VectorBA" = type { %"class.std::vector.13" }
%"class.std::vector.13" = type { %"struct.std::_Vector_base.14" }
%"struct.std::_Vector_base.14" = type { %"struct.std::_Vector_base<ByteArray_st *, std::allocator<ByteArray_st *>>::_Vector_impl" }
%"struct.std::_Vector_base<ByteArray_st *, std::allocator<ByteArray_st *>>::_Vector_impl" = type { %"struct.std::_Vector_base<ByteArray_st *, std::allocator<ByteArray_st *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<ByteArray_st *, std::allocator<ByteArray_st *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

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

; Function Attrs: mustprogress uwtable
define dso_local i32 @uapki_list_certs(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 %"struct.UapkiNS::Pagination", align 8
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca %"class.std::vector.3", align 8
  %16 = alloca ptr, align 8
  %17 = alloca i32, align 4
  %18 = alloca i64, align 8
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  %21 = alloca %"class.UapkiNS::VectorBA", align 8
  %22 = alloca %"class.std::vector.3", align 8
  %23 = alloca ptr, align 8
  %24 = alloca ptr, align 8
  %25 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %26 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %27 = alloca ptr, align 8
  %28 = alloca ptr, align 8
  %29 = alloca i64, align 8
  %30 = alloca ptr, align 8
  %31 = 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) #5
  store i32 0, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %32 = call noundef ptr @_ZN7UapkiNS10get_configEv()
  store ptr %32, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %33 = call noundef ptr @_ZN7UapkiNS12get_cerstoreEv()
  store ptr %33, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #5
  %34 = load ptr, ptr %4, align 8, !tbaa !5
  %35 = call noundef zeroext i1 @_ZN12ParsonHelper20jsonObjectGetBooleanEP13json_object_tPKcb(ptr noundef %34, ptr noundef @.str, i1 noundef zeroext false)
  %36 = zext i1 %35 to i8
  store i8 %36, ptr %9, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 1, ptr %10) #5
  %37 = load ptr, ptr %4, align 8, !tbaa !5
  %38 = call noundef zeroext i1 @_ZN12ParsonHelper20jsonObjectGetBooleanEP13json_object_tPKcb(ptr noundef %37, ptr noundef @.str.1, i1 noundef zeroext false)
  %39 = zext i1 %38 to i8
  store i8 %39, ptr %10, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 32, ptr %11) #5
  call void @_ZN7UapkiNS10PaginationC1Ev(ptr noundef nonnull align 8 dereferenceable(32) %11)
  %40 = load ptr, ptr %7, align 8, !tbaa !5
  %41 = icmp ne ptr %40, null
  br i1 %41, label %42, label %45

42:                                               ; preds = %2
  %43 = load ptr, ptr %8, align 8, !tbaa !5
  %44 = icmp ne ptr %43, null
  br i1 %44, label %46, label %45

45:                                               ; preds = %42, %2
  store i32 4097, ptr %3, align 4
  store i32 1, ptr %12, align 4
  br label %319

46:                                               ; preds = %42
  %47 = load ptr, ptr %7, align 8, !tbaa !5
  %48 = call noundef zeroext i1 @_ZNK7UapkiNS13LibraryConfig13isInitializedEv(ptr noundef nonnull align 8 dereferenceable(97) %47)
  br i1 %48, label %50, label %49

49:                                               ; preds = %46
  store i32 4105, ptr %3, align 4
  store i32 1, ptr %12, align 4
  br label %319

50:                                               ; preds = %46
  %51 = load ptr, ptr %4, align 8, !tbaa !5
  %52 = call noundef zeroext i1 @_ZN7UapkiNS10Pagination11parseParamsEP13json_object_t(ptr noundef nonnull align 8 dereferenceable(32) %11, ptr noundef %51)
  br i1 %52, label %54, label %53

53:                                               ; preds = %50
  store i32 4101, ptr %3, align 4
  store i32 1, ptr %12, align 4
  br label %319

54:                                               ; preds = %50
  %55 = load ptr, ptr %5, align 8, !tbaa !5
  %56 = call ptr @json_value_init_array()
  %57 = call i32 @json_object_set_value(ptr noundef %55, ptr noundef @.str.2, ptr noundef %56)
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %58 = load ptr, ptr %5, align 8, !tbaa !5
  %59 = call ptr @json_object_get_array(ptr noundef %58, ptr noundef @.str.2)
  store ptr %59, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  store ptr null, ptr %14, align 8, !tbaa !5
  %60 = load i8, ptr %10, align 1, !tbaa !11, !range !13, !noundef !14
  %61 = trunc i8 %60 to i1
  br i1 %61, label %62, label %68

62:                                               ; preds = %54
  %63 = load ptr, ptr %5, align 8, !tbaa !5
  %64 = call ptr @json_value_init_array()
  %65 = call i32 @json_object_set_value(ptr noundef %63, ptr noundef @.str.3, ptr noundef %64)
  %66 = load ptr, ptr %5, align 8, !tbaa !5
  %67 = call ptr @json_object_get_array(ptr noundef %66, ptr noundef @.str.3)
  store ptr %67, ptr %14, align 8, !tbaa !5
  br label %68

68:                                               ; preds = %62, %54
  %69 = load i8, ptr %9, align 1, !tbaa !11, !range !13, !noundef !14
  %70 = trunc i8 %69 to i1
  br i1 %70, label %161, label %71

71:                                               ; preds = %68
  call void @llvm.lifetime.start.p0(i64 24, ptr %15) #5
  %72 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN7UapkiNS4Cert8CerStore11getCerItemsEv(ptr dead_on_unwind writable sret(%"class.std::vector.3") align 8 %15, ptr noundef nonnull align 8 dereferenceable(96) %72)
  %73 = call noundef i64 @_ZNKSt6vectorIPN7UapkiNS4Cert7CerItemESaIS3_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %15) #5
  %74 = getelementptr inbounds %"struct.UapkiNS::Pagination", ptr %11, i32 0, i32 0
  store i64 %73, ptr %74, align 8, !tbaa !15
  invoke void @_ZN7UapkiNS10Pagination10calcParamsEv(ptr noundef nonnull align 8 dereferenceable(32) %11)
          to label %75 unwind label %84

75:                                               ; preds = %71
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  %76 = getelementptr inbounds %"struct.UapkiNS::Pagination", ptr %11, i32 0, i32 1
  %77 = load i64, ptr %76, align 8, !tbaa !18
  store i64 %77, ptr %18, align 8, !tbaa !19
  br label %78

78:                                               ; preds = %150, %75
  %79 = load i64, ptr %18, align 8, !tbaa !19
  %80 = getelementptr inbounds %"struct.UapkiNS::Pagination", ptr %11, i32 0, i32 2
  %81 = load i64, ptr %80, align 8, !tbaa !20
  %82 = icmp ult i64 %79, %81
  br i1 %82, label %88, label %83

83:                                               ; preds = %78
  store i32 2, ptr %12, align 4
  br label %154

84:                                               ; preds = %71
  %85 = landingpad { ptr, i32 }
          cleanup
  %86 = extractvalue { ptr, i32 } %85, 0
  store ptr %86, ptr %16, align 8
  %87 = extractvalue { ptr, i32 } %85, 1
  store i32 %87, ptr %17, align 4
  br label %160

88:                                               ; preds = %78
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  %89 = load i64, ptr %18, align 8, !tbaa !19
  %90 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIPN7UapkiNS4Cert7CerItemESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %15, i64 noundef %89) #5
  %91 = load ptr, ptr %90, align 8, !tbaa !5
  store ptr %91, ptr %19, align 8, !tbaa !5
  br label %92

92:                                               ; preds = %88
  %93 = load ptr, ptr %13, align 8, !tbaa !5
  %94 = load ptr, ptr %19, align 8, !tbaa !5
  %95 = invoke noundef ptr @_ZNK7UapkiNS4Cert7CerItem9getCertIdEv(ptr noundef nonnull align 8 dereferenceable(401) %94)
          to label %96 unwind label %104

96:                                               ; preds = %92
  %97 = invoke i32 @json_array_append_base64(ptr noundef %93, ptr noundef %95)
          to label %98 unwind label %104

98:                                               ; preds = %96
  store i32 %97, ptr %6, align 4, !tbaa !9
  %99 = load i32, ptr %6, align 4, !tbaa !9
  %100 = icmp ne i32 %99, 0
  br i1 %100, label %101, label %108

101:                                              ; preds = %98
  %102 = load i32, ptr %6, align 4, !tbaa !9
  invoke void @stacktrace_add(ptr noundef @.str.4, i64 noundef 216, i32 noundef %102)
          to label %103 unwind label %104

103:                                              ; preds = %101
  store i32 7, ptr %12, align 4
  br label %147

104:                                              ; preds = %116, %113, %101, %96, %92
  %105 = landingpad { ptr, i32 }
          cleanup
  %106 = extractvalue { ptr, i32 } %105, 0
  store ptr %106, ptr %16, align 8
  %107 = extractvalue { ptr, i32 } %105, 1
  store i32 %107, ptr %17, align 4
  br label %153

108:                                              ; preds = %98
  br label %109

109:                                              ; preds = %108
  br label %110

110:                                              ; preds = %109
  %111 = load i8, ptr %10, align 1, !tbaa !11, !range !13, !noundef !14
  %112 = trunc i8 %111 to i1
  br i1 %112, label %113, label %146

113:                                              ; preds = %110
  %114 = load ptr, ptr %14, align 8, !tbaa !5
  %115 = invoke ptr @json_value_init_object()
          to label %116 unwind label %104

116:                                              ; preds = %113
  %117 = invoke i32 @json_array_append_value(ptr noundef %114, ptr noundef %115)
          to label %118 unwind label %104

118:                                              ; preds = %116
  %119 = icmp ne i32 %117, 0
  br i1 %119, label %120, label %121

120:                                              ; preds = %118
  store i32 4113, ptr %6, align 4, !tbaa !9
  store i32 7, ptr %12, align 4
  br label %147

121:                                              ; preds = %118
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #5
  %122 = load ptr, ptr %14, align 8, !tbaa !5
  %123 = load i64, ptr %18, align 8, !tbaa !19
  %124 = invoke ptr @json_array_get_object(ptr noundef %122, i64 noundef %123)
          to label %125 unwind label %136

125:                                              ; preds = %121
  store ptr %124, ptr %20, align 8, !tbaa !5
  br label %126

126:                                              ; preds = %125
  %127 = load ptr, ptr %20, align 8, !tbaa !5
  %128 = load ptr, ptr %19, align 8, !tbaa !5
  %129 = invoke noundef i32 @_ZL12info_to_jsonP13json_object_tPKN7UapkiNS4Cert7CerItemE(ptr noundef %127, ptr noundef %128)
          to label %130 unwind label %136

130:                                              ; preds = %126
  store i32 %129, ptr %6, align 4, !tbaa !9
  %131 = load i32, ptr %6, align 4, !tbaa !9
  %132 = icmp ne i32 %131, 0
  br i1 %132, label %133, label %140

133:                                              ; preds = %130
  %134 = load i32, ptr %6, align 4, !tbaa !9
  invoke void @stacktrace_add(ptr noundef @.str.4, i64 noundef 220, i32 noundef %134)
          to label %135 unwind label %136

135:                                              ; preds = %133
  store i32 7, ptr %12, align 4
  br label %143

136:                                              ; preds = %133, %126, %121
  %137 = landingpad { ptr, i32 }
          cleanup
  %138 = extractvalue { ptr, i32 } %137, 0
  store ptr %138, ptr %16, align 8
  %139 = extractvalue { ptr, i32 } %137, 1
  store i32 %139, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  br label %153

140:                                              ; preds = %130
  br label %141

141:                                              ; preds = %140
  br label %142

142:                                              ; preds = %141
  store i32 0, ptr %12, align 4
  br label %143

143:                                              ; preds = %142, %135
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  %144 = load i32, ptr %12, align 4
  switch i32 %144, label %147 [
    i32 0, label %145
  ]

145:                                              ; preds = %143
  br label %146

146:                                              ; preds = %145, %110
  store i32 0, ptr %12, align 4
  br label %147

147:                                              ; preds = %146, %143, %120, %103
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  %148 = load i32, ptr %12, align 4
  switch i32 %148, label %154 [
    i32 0, label %149
  ]

149:                                              ; preds = %147
  br label %150

150:                                              ; preds = %149
  %151 = load i64, ptr %18, align 8, !tbaa !19
  %152 = add i64 %151, 1
  store i64 %152, ptr %18, align 8, !tbaa !19
  br label %78, !llvm.loop !21

153:                                              ; preds = %136, %104
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  br label %160

154:                                              ; preds = %147, %83
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  %155 = load i32, ptr %12, align 4
  switch i32 %155, label %157 [
    i32 2, label %156
  ]

156:                                              ; preds = %154
  store i32 0, ptr %12, align 4
  br label %157

157:                                              ; preds = %156, %154
  call void @_ZNSt6vectorIPN7UapkiNS4Cert7CerItemESaIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %15) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %15) #5
  %158 = load i32, ptr %12, align 4
  switch i32 %158, label %317 [
    i32 0, label %159
    i32 7, label %315
  ]

159:                                              ; preds = %157
  br label %304

160:                                              ; preds = %153, %84
  call void @_ZNSt6vectorIPN7UapkiNS4Cert7CerItemESaIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %15) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %15) #5
  br label %318

161:                                              ; preds = %68
  call void @llvm.lifetime.start.p0(i64 24, ptr %21) #5
  call void @_ZN7UapkiNS8VectorBAC2Em(ptr noundef nonnull align 8 dereferenceable(24) %21, i64 noundef 0)
  call void @llvm.lifetime.start.p0(i64 24, ptr %22) #5
  call void @_ZNSt6vectorIPN7UapkiNS4Cert7CerItemESaIS3_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %22) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #5
  %162 = invoke noundef ptr @_ZN11CmProviders13openedStorageEv()
          to label %163 unwind label %167

163:                                              ; preds = %161
  store ptr %162, ptr %23, align 8, !tbaa !5
  %164 = load ptr, ptr %23, align 8, !tbaa !5
  %165 = icmp ne ptr %164, null
  br i1 %165, label %171, label %166

166:                                              ; preds = %163
  store i32 4121, ptr %3, align 4
  store i32 1, ptr %12, align 4
  br label %300

167:                                              ; preds = %221, %184, %178, %171, %161
  %168 = landingpad { ptr, i32 }
          cleanup
  %169 = extractvalue { ptr, i32 } %168, 0
  store ptr %169, ptr %16, align 8
  %170 = extractvalue { ptr, i32 } %168, 1
  store i32 %170, ptr %17, align 4
  br label %303

171:                                              ; preds = %163
  %172 = load ptr, ptr %23, align 8, !tbaa !5
  %173 = invoke noundef i32 @_ZN14CmStorageProxy22sessionGetCertificatesERSt6vectorIP12ByteArray_stSaIS2_EE(ptr noundef nonnull align 8 dereferenceable(168) %172, ptr noundef nonnull align 8 dereferenceable(24) %21)
          to label %174 unwind label %167

174:                                              ; preds = %171
  store i32 %173, ptr %6, align 4, !tbaa !9
  %175 = load i32, ptr %6, align 4, !tbaa !9
  %176 = icmp eq i32 %175, 4118
  br i1 %176, label %177, label %190

177:                                              ; preds = %174
  br label %178

178:                                              ; preds = %177
  %179 = load ptr, ptr %23, align 8, !tbaa !5
  %180 = invoke noundef i32 @_ZN14CmStorageProxy18keyGetCertificatesERSt6vectorIP12ByteArray_stSaIS2_EE(ptr noundef nonnull align 8 dereferenceable(168) %179, ptr noundef nonnull align 8 dereferenceable(24) %21)
          to label %181 unwind label %167

181:                                              ; preds = %178
  store i32 %180, ptr %6, align 4, !tbaa !9
  %182 = load i32, ptr %6, align 4, !tbaa !9
  %183 = icmp ne i32 %182, 0
  br i1 %183, label %184, label %187

184:                                              ; preds = %181
  %185 = load i32, ptr %6, align 4, !tbaa !9
  invoke void @stacktrace_add(ptr noundef @.str.4, i64 noundef 233, i32 noundef %185)
          to label %186 unwind label %167

186:                                              ; preds = %184
  store i32 7, ptr %12, align 4
  br label %300

187:                                              ; preds = %181
  br label %188

188:                                              ; preds = %187
  br label %189

189:                                              ; preds = %188
  br label %190

190:                                              ; preds = %189, %174
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #5
  store ptr %21, ptr %24, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #5
  %191 = load ptr, ptr %24, align 8, !tbaa !5
  %192 = call ptr @_ZNSt6vectorIP12ByteArray_stSaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %191) #5
  %193 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %25, i32 0, i32 0
  store ptr %192, ptr %193, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #5
  %194 = load ptr, ptr %24, align 8, !tbaa !5
  %195 = call ptr @_ZNSt6vectorIP12ByteArray_stSaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %194) #5
  %196 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %26, i32 0, i32 0
  store ptr %195, ptr %196, align 8
  br label %197

197:                                              ; preds = %219, %190
  %198 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPP12ByteArray_stSt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %25, ptr noundef nonnull align 8 dereferenceable(8) %26) #5
  br i1 %198, label %200, label %199

199:                                              ; preds = %197
  store i32 12, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #5
  br label %221

200:                                              ; preds = %197
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #5
  %201 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPP12ByteArray_stSt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %25) #5
  store ptr %201, ptr %27, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #5
  store ptr null, ptr %28, align 8, !tbaa !5
  %202 = load ptr, ptr %8, align 8, !tbaa !5
  %203 = load ptr, ptr %27, align 8, !tbaa !5
  %204 = load ptr, ptr %203, align 8, !tbaa !5
  %205 = invoke noundef i32 @_ZN7UapkiNS4Cert8CerStore16getCertByEncodedEPK12ByteArray_stPPNS0_7CerItemE(ptr noundef nonnull align 8 dereferenceable(96) %202, ptr noundef %204, ptr noundef %28)
          to label %206 unwind label %214

206:                                              ; preds = %200
  store i32 %205, ptr %6, align 4, !tbaa !9
  %207 = load i32, ptr %6, align 4, !tbaa !9
  %208 = icmp eq i32 %207, 0
  br i1 %208, label %209, label %218

209:                                              ; preds = %206
  invoke void @_ZNSt6vectorIPN7UapkiNS4Cert7CerItemESaIS3_EE9push_backERKS3_(ptr noundef nonnull align 8 dereferenceable(24) %22, ptr noundef nonnull align 8 dereferenceable(8) %28)
          to label %210 unwind label %214

210:                                              ; preds = %209
  %211 = getelementptr inbounds %"struct.UapkiNS::Pagination", ptr %11, i32 0, i32 0
  %212 = load i64, ptr %211, align 8, !tbaa !15
  %213 = add i64 %212, 1
  store i64 %213, ptr %211, align 8, !tbaa !15
  br label %218

214:                                              ; preds = %209, %200
  %215 = landingpad { ptr, i32 }
          cleanup
  %216 = extractvalue { ptr, i32 } %215, 0
  store ptr %216, ptr %16, align 8
  %217 = extractvalue { ptr, i32 } %215, 1
  store i32 %217, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #5
  br label %303

218:                                              ; preds = %210, %206
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #5
  br label %219

219:                                              ; preds = %218
  %220 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPP12ByteArray_stSt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %25) #5
  br label %197

221:                                              ; preds = %199
  invoke void @_ZN7UapkiNS10Pagination10calcParamsEv(ptr noundef nonnull align 8 dereferenceable(32) %11)
          to label %222 unwind label %167

222:                                              ; preds = %221
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #5
  %223 = getelementptr inbounds %"struct.UapkiNS::Pagination", ptr %11, i32 0, i32 1
  %224 = load i64, ptr %223, align 8, !tbaa !18
  store i64 %224, ptr %29, align 8, !tbaa !19
  br label %225

225:                                              ; preds = %293, %222
  %226 = load i64, ptr %29, align 8, !tbaa !19
  %227 = getelementptr inbounds %"struct.UapkiNS::Pagination", ptr %11, i32 0, i32 2
  %228 = load i64, ptr %227, align 8, !tbaa !20
  %229 = icmp ult i64 %226, %228
  br i1 %229, label %231, label %230

230:                                              ; preds = %225
  store i32 14, ptr %12, align 4
  br label %297

231:                                              ; preds = %225
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #5
  %232 = load i64, ptr %29, align 8, !tbaa !19
  %233 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN7UapkiNS4Cert7CerItemESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %22, i64 noundef %232) #5
  %234 = load ptr, ptr %233, align 8, !tbaa !5
  store ptr %234, ptr %30, align 8, !tbaa !5
  br label %235

235:                                              ; preds = %231
  %236 = load ptr, ptr %13, align 8, !tbaa !5
  %237 = load ptr, ptr %30, align 8, !tbaa !5
  %238 = invoke noundef ptr @_ZNK7UapkiNS4Cert7CerItem9getCertIdEv(ptr noundef nonnull align 8 dereferenceable(401) %237)
          to label %239 unwind label %247

239:                                              ; preds = %235
  %240 = invoke i32 @json_array_append_base64(ptr noundef %236, ptr noundef %238)
          to label %241 unwind label %247

241:                                              ; preds = %239
  store i32 %240, ptr %6, align 4, !tbaa !9
  %242 = load i32, ptr %6, align 4, !tbaa !9
  %243 = icmp ne i32 %242, 0
  br i1 %243, label %244, label %251

244:                                              ; preds = %241
  %245 = load i32, ptr %6, align 4, !tbaa !9
  invoke void @stacktrace_add(ptr noundef @.str.4, i64 noundef 248, i32 noundef %245)
          to label %246 unwind label %247

246:                                              ; preds = %244
  store i32 7, ptr %12, align 4
  br label %290

247:                                              ; preds = %259, %256, %244, %239, %235
  %248 = landingpad { ptr, i32 }
          cleanup
  %249 = extractvalue { ptr, i32 } %248, 0
  store ptr %249, ptr %16, align 8
  %250 = extractvalue { ptr, i32 } %248, 1
  store i32 %250, ptr %17, align 4
  br label %296

251:                                              ; preds = %241
  br label %252

252:                                              ; preds = %251
  br label %253

253:                                              ; preds = %252
  %254 = load i8, ptr %10, align 1, !tbaa !11, !range !13, !noundef !14
  %255 = trunc i8 %254 to i1
  br i1 %255, label %256, label %289

256:                                              ; preds = %253
  %257 = load ptr, ptr %14, align 8, !tbaa !5
  %258 = invoke ptr @json_value_init_object()
          to label %259 unwind label %247

259:                                              ; preds = %256
  %260 = invoke i32 @json_array_append_value(ptr noundef %257, ptr noundef %258)
          to label %261 unwind label %247

261:                                              ; preds = %259
  %262 = icmp ne i32 %260, 0
  br i1 %262, label %263, label %264

263:                                              ; preds = %261
  store i32 4113, ptr %6, align 4, !tbaa !9
  store i32 7, ptr %12, align 4
  br label %290

264:                                              ; preds = %261
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #5
  %265 = load ptr, ptr %14, align 8, !tbaa !5
  %266 = load i64, ptr %29, align 8, !tbaa !19
  %267 = invoke ptr @json_array_get_object(ptr noundef %265, i64 noundef %266)
          to label %268 unwind label %279

268:                                              ; preds = %264
  store ptr %267, ptr %31, align 8, !tbaa !5
  br label %269

269:                                              ; preds = %268
  %270 = load ptr, ptr %31, align 8, !tbaa !5
  %271 = load ptr, ptr %30, align 8, !tbaa !5
  %272 = invoke noundef i32 @_ZL12info_to_jsonP13json_object_tPKN7UapkiNS4Cert7CerItemE(ptr noundef %270, ptr noundef %271)
          to label %273 unwind label %279

273:                                              ; preds = %269
  store i32 %272, ptr %6, align 4, !tbaa !9
  %274 = load i32, ptr %6, align 4, !tbaa !9
  %275 = icmp ne i32 %274, 0
  br i1 %275, label %276, label %283

276:                                              ; preds = %273
  %277 = load i32, ptr %6, align 4, !tbaa !9
  invoke void @stacktrace_add(ptr noundef @.str.4, i64 noundef 252, i32 noundef %277)
          to label %278 unwind label %279

278:                                              ; preds = %276
  store i32 7, ptr %12, align 4
  br label %286

279:                                              ; preds = %276, %269, %264
  %280 = landingpad { ptr, i32 }
          cleanup
  %281 = extractvalue { ptr, i32 } %280, 0
  store ptr %281, ptr %16, align 8
  %282 = extractvalue { ptr, i32 } %280, 1
  store i32 %282, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #5
  br label %296

283:                                              ; preds = %273
  br label %284

284:                                              ; preds = %283
  br label %285

285:                                              ; preds = %284
  store i32 0, ptr %12, align 4
  br label %286

286:                                              ; preds = %285, %278
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #5
  %287 = load i32, ptr %12, align 4
  switch i32 %287, label %290 [
    i32 0, label %288
  ]

288:                                              ; preds = %286
  br label %289

289:                                              ; preds = %288, %253
  store i32 0, ptr %12, align 4
  br label %290

290:                                              ; preds = %289, %286, %263, %246
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #5
  %291 = load i32, ptr %12, align 4
  switch i32 %291, label %297 [
    i32 0, label %292
  ]

292:                                              ; preds = %290
  br label %293

293:                                              ; preds = %292
  %294 = load i64, ptr %29, align 8, !tbaa !19
  %295 = add i64 %294, 1
  store i64 %295, ptr %29, align 8, !tbaa !19
  br label %225, !llvm.loop !23

296:                                              ; preds = %279, %247
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #5
  br label %303

297:                                              ; preds = %290, %230
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #5
  %298 = load i32, ptr %12, align 4
  switch i32 %298, label %300 [
    i32 14, label %299
  ]

299:                                              ; preds = %297
  store i32 0, ptr %12, align 4
  br label %300

300:                                              ; preds = %299, %297, %186, %166
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #5
  call void @_ZNSt6vectorIPN7UapkiNS4Cert7CerItemESaIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %22) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %22) #5
  call void @_ZN7UapkiNS8VectorBAD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %21) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %21) #5
  %301 = load i32, ptr %12, align 4
  switch i32 %301, label %317 [
    i32 0, label %302
    i32 7, label %315
  ]

302:                                              ; preds = %300
  br label %304

303:                                              ; preds = %296, %214, %167
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #5
  call void @_ZNSt6vectorIPN7UapkiNS4Cert7CerItemESaIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %22) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %22) #5
  call void @_ZN7UapkiNS8VectorBAD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %21) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %21) #5
  br label %318

304:                                              ; preds = %302, %159
  br label %305

305:                                              ; preds = %304
  %306 = load ptr, ptr %5, align 8, !tbaa !5
  %307 = call noundef i32 @_ZN7UapkiNS10Pagination9setResultEP13json_object_t(ptr noundef nonnull align 8 dereferenceable(32) %11, ptr noundef %306)
  store i32 %307, ptr %6, align 4, !tbaa !9
  %308 = load i32, ptr %6, align 4, !tbaa !9
  %309 = icmp ne i32 %308, 0
  br i1 %309, label %310, label %312

310:                                              ; preds = %305
  %311 = load i32, ptr %6, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str.4, i64 noundef 257, i32 noundef %311)
  br label %315

312:                                              ; preds = %305
  br label %313

313:                                              ; preds = %312
  br label %314

314:                                              ; preds = %313
  br label %315

315:                                              ; preds = %314, %310, %300, %157
  %316 = load i32, ptr %6, align 4, !tbaa !9
  store i32 %316, ptr %3, align 4
  store i32 1, ptr %12, align 4
  br label %317

317:                                              ; preds = %315, %300, %157
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  br label %319

318:                                              ; preds = %303, %160
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %321

319:                                              ; preds = %317, %53, %49, %45
  call void @llvm.lifetime.end.p0(i64 32, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  %320 = load i32, ptr %3, align 4
  ret i32 %320

321:                                              ; preds = %318
  %322 = load ptr, ptr %16, align 8
  %323 = load i32, ptr %17, align 4
  %324 = insertvalue { ptr, i32 } poison, ptr %322, 0
  %325 = insertvalue { ptr, i32 } %324, i32 %323, 1
  resume { ptr, i32 } %325
}

; 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

declare void @_ZN7UapkiNS10PaginationC1Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #2

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

declare noundef zeroext i1 @_ZN7UapkiNS10Pagination11parseParamsEP13json_object_t(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef) #2

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

declare ptr @json_value_init_array() #2

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

declare void @_ZN7UapkiNS4Cert8CerStore11getCerItemsEv(ptr dead_on_unwind writable sret(%"class.std::vector.3") align 8, ptr noundef nonnull align 8 dereferenceable(96)) #2

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

declare void @_ZN7UapkiNS10Pagination10calcParamsEv(ptr noundef nonnull align 8 dereferenceable(32)) #2

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

declare ptr @json_value_init_object() #2

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

; Function Attrs: mustprogress uwtable
declare hidden noundef i32 @_ZL12info_to_jsonP13json_object_tPKN7UapkiNS4Cert7CerItemE(ptr noundef, ptr noundef) #0

; 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 @_ZNSt6vectorIPN7UapkiNS4Cert7CerItemESaIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7UapkiNS8VectorBAC2Em(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) unnamed_addr #0 align 2

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

declare noundef ptr @_ZN11CmProviders13openedStorageEv() #2

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIPN7UapkiNS4Cert7CerItemESaIS3_EE9push_backERKS3_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(8)) #0 align 2

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

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

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

declare noundef i32 @_ZN7UapkiNS10Pagination9setResultEP13json_object_t(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef) #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 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }

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

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


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"struct.UapkiNS::Pagination" = type { i64, i64, i64, i64 }
%"class.std::vector.3" = type { %"struct.std::_Vector_base.4" }
%"struct.std::_Vector_base.4" = type { %"struct.std::_Vector_base<UapkiNS::Cert::CerItem *, std::allocator<UapkiNS::Cert::CerItem *>>::_Vector_impl" }
%"struct.std::_Vector_base<UapkiNS::Cert::CerItem *, std::allocator<UapkiNS::Cert::CerItem *>>::_Vector_impl" = type { %"struct.std::_Vector_base<UapkiNS::Cert::CerItem *, std::allocator<UapkiNS::Cert::CerItem *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<UapkiNS::Cert::CerItem *, std::allocator<UapkiNS::Cert::CerItem *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.UapkiNS::VectorBA" = type { %"class.std::vector.13" }
%"class.std::vector.13" = type { %"struct.std::_Vector_base.14" }
%"struct.std::_Vector_base.14" = type { %"struct.std::_Vector_base<ByteArray_st *, std::allocator<ByteArray_st *>>::_Vector_impl" }
%"struct.std::_Vector_base<ByteArray_st *, std::allocator<ByteArray_st *>>::_Vector_impl" = type { %"struct.std::_Vector_base<ByteArray_st *, std::allocator<ByteArray_st *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<ByteArray_st *, std::allocator<ByteArray_st *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @uapki_list_certs(ptr noundef %0, ptr noundef %1) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"struct.UapkiNS::Pagination", align 8
  %4 = alloca %"class.std::vector.3", align 8
  %5 = alloca %"class.UapkiNS::VectorBA", align 8
  %6 = alloca %"class.std::vector.3", align 8
  %7 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %8 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %9 = alloca ptr, align 8
  %10 = tail call noundef ptr @_ZN7UapkiNS10get_configEv()
  %11 = tail call noundef ptr @_ZN7UapkiNS12get_cerstoreEv()
  %12 = tail call noundef zeroext i1 @_ZN12ParsonHelper20jsonObjectGetBooleanEP13json_object_tPKcb(ptr noundef %0, ptr noundef nonnull @.str, i1 noundef zeroext false)
  %13 = 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 32, ptr nonnull %3) #5
  call void @_ZN7UapkiNS10PaginationC1Ev(ptr noundef nonnull align 8 dereferenceable(32) %3)
  %14 = icmp ne ptr %10, null
  %15 = icmp ne ptr %11, null
  %or.cond = and i1 %14, %15
  br i1 %or.cond, label %16, label %134

16:                                               ; preds = %2
  %17 = call noundef zeroext i1 @_ZNK7UapkiNS13LibraryConfig13isInitializedEv(ptr noundef nonnull align 8 dereferenceable(97) %10)
  br i1 %17, label %18, label %134

18:                                               ; preds = %16
  %19 = call noundef zeroext i1 @_ZN7UapkiNS10Pagination11parseParamsEP13json_object_t(ptr noundef nonnull align 8 dereferenceable(32) %3, ptr noundef %0)
  br i1 %19, label %20, label %134

20:                                               ; preds = %18
  %21 = call ptr @json_value_init_array()
  %22 = call i32 @json_object_set_value(ptr noundef %1, ptr noundef nonnull @.str.2, ptr noundef %21)
  %23 = call ptr @json_object_get_array(ptr noundef %1, ptr noundef nonnull @.str.2)
  br i1 %13, label %24, label %28

24:                                               ; preds = %20
  %25 = call ptr @json_value_init_array()
  %26 = call i32 @json_object_set_value(ptr noundef %1, ptr noundef nonnull @.str.3, ptr noundef %25)
  %27 = call ptr @json_object_get_array(ptr noundef %1, ptr noundef nonnull @.str.3)
  br label %28

28:                                               ; preds = %24, %20
  %.086 = phi ptr [ %27, %24 ], [ null, %20 ]
  br i1 %12, label %66, label %29

29:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #5
  call void @_ZN7UapkiNS4Cert8CerStore11getCerItemsEv(ptr dead_on_unwind nonnull writable sret(%"class.std::vector.3") align 8 %4, ptr noundef nonnull align 8 dereferenceable(96) %11)
  %30 = call noundef i64 @_ZNKSt6vectorIPN7UapkiNS4Cert7CerItemESaIS3_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #5
  store i64 %30, ptr %3, align 8, !tbaa !5
  invoke void @_ZN7UapkiNS10Pagination10calcParamsEv(ptr noundef nonnull align 8 dereferenceable(32) %3)
          to label %31 unwind label %55

31:                                               ; preds = %29
  %32 = getelementptr inbounds i8, ptr %3, i64 8
  %33 = load i64, ptr %32, align 8, !tbaa !10
  %34 = getelementptr inbounds i8, ptr %3, i64 16
  %35 = load i64, ptr %34, align 8, !tbaa !11
  %36 = icmp ult i64 %33, %35
  br i1 %36, label %.lr.ph, label %.thread143

.lr.ph:                                           ; preds = %31
  br i1 %13, label %.lr.ph.split.us, label %.lr.ph.split

.lr.ph.split.us:                                  ; preds = %.lr.ph, %.thread.us
  %.097207.us = phi i64 [ %52, %.thread.us ], [ %33, %.lr.ph ]
  %37 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIPN7UapkiNS4Cert7CerItemESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %.097207.us) #5
  %38 = load ptr, ptr %37, align 8, !tbaa !12
  %39 = call noundef ptr @_ZNK7UapkiNS4Cert7CerItem9getCertIdEv(ptr noundef nonnull align 8 dereferenceable(401) %38)
  %40 = invoke i32 @json_array_append_base64(ptr noundef %23, ptr noundef %39)
          to label %41 unwind label %.loopexit188.split.us

41:                                               ; preds = %.lr.ph.split.us
  %.not.us = icmp eq i32 %40, 0
  br i1 %.not.us, label %42, label %.split.us

42:                                               ; preds = %41
  %43 = invoke ptr @json_value_init_object()
          to label %44 unwind label %.loopexit188.split.us

44:                                               ; preds = %42
  %45 = invoke i32 @json_array_append_value(ptr noundef %.086, ptr noundef %43)
          to label %46 unwind label %.loopexit188.split.us

46:                                               ; preds = %44
  %.not111.us = icmp eq i32 %45, 0
  br i1 %.not111.us, label %47, label %.thread145

47:                                               ; preds = %46
  %48 = invoke ptr @json_array_get_object(ptr noundef %.086, i64 noundef %.097207.us)
          to label %49 unwind label %.loopexit193.split.us

49:                                               ; preds = %47
  %50 = invoke noundef i32 @_ZL12info_to_jsonP13json_object_tPKN7UapkiNS4Cert7CerItemE(ptr noundef %48, ptr noundef nonnull %38)
          to label %51 unwind label %.loopexit193.split.us

51:                                               ; preds = %49
  %.not112.us = icmp eq i32 %50, 0
  br i1 %.not112.us, label %.thread.us, label %.split211.us

.thread.us:                                       ; preds = %51
  %52 = add nuw i64 %.097207.us, 1
  %53 = load i64, ptr %34, align 8, !tbaa !11
  %54 = icmp ult i64 %52, %53
  br i1 %54, label %.lr.ph.split.us, label %.thread143, !llvm.loop !14

.loopexit188.split.us:                            ; preds = %44, %42, %.lr.ph.split.us
  %lpad.loopexit190.us = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit188

.loopexit193.split.us:                            ; preds = %49, %47
  %lpad.loopexit195.us = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit188

.thread143:                                       ; preds = %.thread, %.thread.us, %31
  call void @_ZNSt6vectorIPN7UapkiNS4Cert7CerItemESaIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #5
  br label %130

55:                                               ; preds = %29
  %56 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit188

.lr.ph.split:                                     ; preds = %.lr.ph, %.thread
  %.097207 = phi i64 [ %62, %.thread ], [ %33, %.lr.ph ]
  %57 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIPN7UapkiNS4Cert7CerItemESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %.097207) #5
  %58 = load ptr, ptr %57, align 8, !tbaa !12
  %59 = call noundef ptr @_ZNK7UapkiNS4Cert7CerItem9getCertIdEv(ptr noundef nonnull align 8 dereferenceable(401) %58)
  %60 = invoke i32 @json_array_append_base64(ptr noundef %23, ptr noundef %59)
          to label %61 unwind label %.loopexit188.split

61:                                               ; preds = %.lr.ph.split
  %.not = icmp eq i32 %60, 0
  br i1 %.not, label %.thread, label %.split.us

.split.us:                                        ; preds = %61, %41
  %.us-phi208 = phi i32 [ %40, %41 ], [ %60, %61 ]
  invoke void @stacktrace_add(ptr noundef nonnull @.str.4, i64 noundef 216, i32 noundef %.us-phi208)
          to label %.thread145 unwind label %.loopexit.split-lp189

.loopexit188.split:                               ; preds = %.lr.ph.split
  %lpad.loopexit190 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit188

.loopexit.split-lp189:                            ; preds = %.split.us
  %lpad.loopexit.split-lp191 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit188

.thread:                                          ; preds = %61
  %62 = add nuw i64 %.097207, 1
  %63 = load i64, ptr %34, align 8, !tbaa !11
  %64 = icmp ult i64 %62, %63
  br i1 %64, label %.lr.ph.split, label %.thread143, !llvm.loop !14

.split211.us:                                     ; preds = %51
  invoke void @stacktrace_add(ptr noundef nonnull @.str.4, i64 noundef 220, i32 noundef %50)
          to label %65 unwind label %.loopexit.split-lp194

.loopexit.split-lp194:                            ; preds = %.split211.us
  %lpad.loopexit.split-lp196 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit188

.thread145:                                       ; preds = %46, %.split.us
  %.277.ph132 = phi i32 [ %.us-phi208, %.split.us ], [ 4113, %46 ]
  call void @_ZNSt6vectorIPN7UapkiNS4Cert7CerItemESaIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #5
  br label %134

65:                                               ; preds = %.split211.us
  call void @_ZNSt6vectorIPN7UapkiNS4Cert7CerItemESaIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #5
  br label %134

.loopexit188:                                     ; preds = %.loopexit193.split.us, %.loopexit.split-lp194, %.loopexit.split-lp189, %.loopexit188.split.us, %.loopexit188.split, %55
  %.pn.pn = phi { ptr, i32 } [ %56, %55 ], [ %lpad.loopexit.split-lp191, %.loopexit.split-lp189 ], [ %lpad.loopexit190, %.loopexit188.split ], [ %lpad.loopexit190.us, %.loopexit188.split.us ], [ %lpad.loopexit195.us, %.loopexit193.split.us ], [ %lpad.loopexit.split-lp196, %.loopexit.split-lp194 ]
  call void @_ZNSt6vectorIPN7UapkiNS4Cert7CerItemESaIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #5
  br label %133

66:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #5
  call void @_ZN7UapkiNS8VectorBAC2Em(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef 0)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #5
  call void @_ZNSt6vectorIPN7UapkiNS4Cert7CerItemESaIS3_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  %67 = invoke noundef ptr @_ZN11CmProviders13openedStorageEv()
          to label %68 unwind label %69

68:                                               ; preds = %66
  %.not115 = icmp eq ptr %67, null
  br i1 %.not115, label %.thread167, label %71

.thread167:                                       ; preds = %68
  call void @_ZNSt6vectorIPN7UapkiNS4Cert7CerItemESaIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #5
  call void @_ZN7UapkiNS8VectorBAD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #5
  br label %134

69:                                               ; preds = %._crit_edge, %78, %75, %71, %66
  %70 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit

71:                                               ; preds = %68
  %72 = invoke noundef i32 @_ZN14CmStorageProxy22sessionGetCertificatesERSt6vectorIP12ByteArray_stSaIS2_EE(ptr noundef nonnull align 8 dereferenceable(168) %67, ptr noundef nonnull align 8 dereferenceable(24) %5)
          to label %73 unwind label %69

73:                                               ; preds = %71
  %74 = icmp eq i32 %72, 4118
  br i1 %74, label %75, label %79

75:                                               ; preds = %73
  %76 = invoke noundef i32 @_ZN14CmStorageProxy18keyGetCertificatesERSt6vectorIP12ByteArray_stSaIS2_EE(ptr noundef nonnull align 8 dereferenceable(168) %67, ptr noundef nonnull align 8 dereferenceable(24) %5)
          to label %77 unwind label %69

77:                                               ; preds = %75
  %.not116 = icmp eq i32 %76, 0
  br i1 %.not116, label %79, label %78

78:                                               ; preds = %77
  invoke void @stacktrace_add(ptr noundef nonnull @.str.4, i64 noundef 233, i32 noundef %76)
          to label %.thread173 unwind label %69

.thread173:                                       ; preds = %78
  call void @_ZNSt6vectorIPN7UapkiNS4Cert7CerItemESaIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #5
  call void @_ZN7UapkiNS8VectorBAD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #5
  br label %134

79:                                               ; preds = %77, %73
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #5
  %80 = call ptr @_ZNSt6vectorIP12ByteArray_stSaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  store ptr %80, ptr %7, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #5
  %81 = call ptr @_ZNSt6vectorIP12ByteArray_stSaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  store ptr %81, ptr %8, align 8
  %82 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPP12ByteArray_stSt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8) #5
  br i1 %82, label %.lr.ph213, label %._crit_edge

._crit_edge:                                      ; preds = %94, %79
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #5
  invoke void @_ZN7UapkiNS10Pagination10calcParamsEv(ptr noundef nonnull align 8 dereferenceable(32) %3)
          to label %97 unwind label %69

.lr.ph213:                                        ; preds = %79, %94
  %83 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPP12ByteArray_stSt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #5
  store ptr null, ptr %9, align 8, !tbaa !12
  %84 = load ptr, ptr %83, align 8, !tbaa !12
  %85 = invoke noundef i32 @_ZN7UapkiNS4Cert8CerStore16getCertByEncodedEPK12ByteArray_stPPNS0_7CerItemE(ptr noundef nonnull align 8 dereferenceable(96) %11, ptr noundef %84, ptr noundef nonnull %9)
          to label %86 unwind label %92

86:                                               ; preds = %.lr.ph213
  %87 = icmp eq i32 %85, 0
  br i1 %87, label %88, label %94

88:                                               ; preds = %86
  invoke void @_ZNSt6vectorIPN7UapkiNS4Cert7CerItemESaIS3_EE9push_backERKS3_(ptr noundef nonnull align 8 dereferenceable(24) %6, ptr noundef nonnull align 8 dereferenceable(8) %9)
          to label %89 unwind label %92

89:                                               ; preds = %88
  %90 = load i64, ptr %3, align 8, !tbaa !5
  %91 = add i64 %90, 1
  store i64 %91, ptr %3, align 8, !tbaa !5
  br label %94

92:                                               ; preds = %88, %.lr.ph213
  %93 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #5
  br label %.loopexit

94:                                               ; preds = %89, %86
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #5
  %95 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPP12ByteArray_stSt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #5
  %96 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPP12ByteArray_stSt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8) #5
  br i1 %96, label %.lr.ph213, label %._crit_edge

97:                                               ; preds = %._crit_edge
  %98 = getelementptr inbounds i8, ptr %3, i64 8
  %99 = load i64, ptr %98, align 8, !tbaa !10
  %100 = getelementptr inbounds i8, ptr %3, i64 16
  %101 = load i64, ptr %100, align 8, !tbaa !11
  %102 = icmp ult i64 %99, %101
  br i1 %102, label %.lr.ph216, label %.thread170

.lr.ph216:                                        ; preds = %97
  br i1 %13, label %.lr.ph216.split.us, label %.lr.ph216.split

.lr.ph216.split.us:                               ; preds = %.lr.ph216, %.thread150.us
  %.078214.us = phi i64 [ %118, %.thread150.us ], [ %99, %.lr.ph216 ]
  %103 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN7UapkiNS4Cert7CerItemESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %.078214.us) #5
  %104 = load ptr, ptr %103, align 8, !tbaa !12
  %105 = call noundef ptr @_ZNK7UapkiNS4Cert7CerItem9getCertIdEv(ptr noundef nonnull align 8 dereferenceable(401) %104)
  %106 = invoke i32 @json_array_append_base64(ptr noundef %23, ptr noundef %105)
          to label %107 unwind label %.loopexit.split.us

107:                                              ; preds = %.lr.ph216.split.us
  %.not117.us = icmp eq i32 %106, 0
  br i1 %.not117.us, label %108, label %.split219.us

108:                                              ; preds = %107
  %109 = invoke ptr @json_value_init_object()
          to label %110 unwind label %.loopexit.split.us

110:                                              ; preds = %108
  %111 = invoke i32 @json_array_append_value(ptr noundef %.086, ptr noundef %109)
          to label %112 unwind label %.loopexit.split.us

112:                                              ; preds = %110
  %.not118.us = icmp eq i32 %111, 0
  br i1 %.not118.us, label %113, label %.thread176

113:                                              ; preds = %112
  %114 = invoke ptr @json_array_get_object(ptr noundef %.086, i64 noundef %.078214.us)
          to label %115 unwind label %.loopexit183.split.us

115:                                              ; preds = %113
  %116 = invoke noundef i32 @_ZL12info_to_jsonP13json_object_tPKN7UapkiNS4Cert7CerItemE(ptr noundef %114, ptr noundef nonnull %104)
          to label %117 unwind label %.loopexit183.split.us

117:                                              ; preds = %115
  %.not119.us = icmp eq i32 %116, 0
  br i1 %.not119.us, label %.thread150.us, label %.split223.us

.thread150.us:                                    ; preds = %117
  %118 = add nuw i64 %.078214.us, 1
  %119 = load i64, ptr %100, align 8, !tbaa !11
  %120 = icmp ult i64 %118, %119
  br i1 %120, label %.lr.ph216.split.us, label %.thread170, !llvm.loop !16

.loopexit.split.us:                               ; preds = %110, %108, %.lr.ph216.split.us
  %lpad.loopexit.us = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit

.loopexit183.split.us:                            ; preds = %115, %113
  %lpad.loopexit185.us = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit

.thread170:                                       ; preds = %.thread150, %.thread150.us, %97
  call void @_ZNSt6vectorIPN7UapkiNS4Cert7CerItemESaIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #5
  call void @_ZN7UapkiNS8VectorBAD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #5
  br label %130

.lr.ph216.split:                                  ; preds = %.lr.ph216, %.thread150
  %.078214 = phi i64 [ %126, %.thread150 ], [ %99, %.lr.ph216 ]
  %121 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN7UapkiNS4Cert7CerItemESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %.078214) #5
  %122 = load ptr, ptr %121, align 8, !tbaa !12
  %123 = call noundef ptr @_ZNK7UapkiNS4Cert7CerItem9getCertIdEv(ptr noundef nonnull align 8 dereferenceable(401) %122)
  %124 = invoke i32 @json_array_append_base64(ptr noundef %23, ptr noundef %123)
          to label %125 unwind label %.loopexit.split

125:                                              ; preds = %.lr.ph216.split
  %.not117 = icmp eq i32 %124, 0
  br i1 %.not117, label %.thread150, label %.split219.us

.split219.us:                                     ; preds = %125, %107
  %.us-phi220 = phi i32 [ %106, %107 ], [ %124, %125 ]
  invoke void @stacktrace_add(ptr noundef nonnull @.str.4, i64 noundef 248, i32 noundef %.us-phi220)
          to label %.thread176 unwind label %.loopexit.split-lp

.loopexit.split:                                  ; preds = %.lr.ph216.split
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit

.loopexit.split-lp:                               ; preds = %.split219.us
  %lpad.loopexit.split-lp = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit

.thread150:                                       ; preds = %125
  %126 = add nuw i64 %.078214, 1
  %127 = load i64, ptr %100, align 8, !tbaa !11
  %128 = icmp ult i64 %126, %127
  br i1 %128, label %.lr.ph216.split, label %.thread170, !llvm.loop !16

.split223.us:                                     ; preds = %117
  invoke void @stacktrace_add(ptr noundef nonnull @.str.4, i64 noundef 252, i32 noundef %116)
          to label %129 unwind label %.loopexit.split-lp184

.loopexit.split-lp184:                            ; preds = %.split223.us
  %lpad.loopexit.split-lp186 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit

.thread176:                                       ; preds = %112, %.split219.us
  %.8.ph156 = phi i32 [ %.us-phi220, %.split219.us ], [ 4113, %112 ]
  call void @_ZNSt6vectorIPN7UapkiNS4Cert7CerItemESaIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #5
  call void @_ZN7UapkiNS8VectorBAD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #5
  br label %134

129:                                              ; preds = %.split223.us
  call void @_ZNSt6vectorIPN7UapkiNS4Cert7CerItemESaIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #5
  call void @_ZN7UapkiNS8VectorBAD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #5
  br label %134

.loopexit:                                        ; preds = %.loopexit183.split.us, %.loopexit.split-lp184, %.loopexit.split-lp, %.loopexit.split.us, %.loopexit.split, %92, %69
  %.pn122 = phi { ptr, i32 } [ %70, %69 ], [ %93, %92 ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ], [ %lpad.loopexit, %.loopexit.split ], [ %lpad.loopexit.us, %.loopexit.split.us ], [ %lpad.loopexit185.us, %.loopexit183.split.us ], [ %lpad.loopexit.split-lp186, %.loopexit.split-lp184 ]
  call void @_ZNSt6vectorIPN7UapkiNS4Cert7CerItemESaIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #5
  call void @_ZN7UapkiNS8VectorBAD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #5
  br label %133

130:                                              ; preds = %.thread170, %.thread143
  %131 = call noundef i32 @_ZN7UapkiNS10Pagination9setResultEP13json_object_t(ptr noundef nonnull align 8 dereferenceable(32) %3, ptr noundef %1)
  %.not125 = icmp eq i32 %131, 0
  br i1 %.not125, label %134, label %132

132:                                              ; preds = %130
  call void @stacktrace_add(ptr noundef nonnull @.str.4, i64 noundef 257, i32 noundef %131)
  br label %134

133:                                              ; preds = %.loopexit, %.loopexit188
  %.pn122.pn = phi { ptr, i32 } [ %.pn122, %.loopexit ], [ %.pn.pn, %.loopexit188 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #5
  resume { ptr, i32 } %.pn122.pn

134:                                              ; preds = %132, %130, %.thread145, %.thread173, %.thread176, %65, %129, %.thread167, %18, %16, %2
  %.2 = phi i32 [ 4097, %2 ], [ 4105, %16 ], [ 4101, %18 ], [ 4121, %.thread167 ], [ %116, %129 ], [ %131, %132 ], [ 0, %130 ], [ %50, %65 ], [ %.277.ph132, %.thread145 ], [ %76, %.thread173 ], [ %.8.ph156, %.thread176 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #5
  ret i32 %.2
}

; 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

declare void @_ZN7UapkiNS10PaginationC1Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #2

; 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

declare noundef zeroext i1 @_ZN7UapkiNS10Pagination11parseParamsEP13json_object_t(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef) local_unnamed_addr #2

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

declare ptr @json_value_init_array() local_unnamed_addr #2

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

declare void @_ZN7UapkiNS4Cert8CerStore11getCerItemsEv(ptr dead_on_unwind writable sret(%"class.std::vector.3") align 8, ptr noundef nonnull align 8 dereferenceable(96)) local_unnamed_addr #2

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

declare void @_ZN7UapkiNS10Pagination10calcParamsEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #2

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

declare ptr @json_value_init_object() local_unnamed_addr #2

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

; Function Attrs: mustprogress uwtable
declare hidden noundef i32 @_ZL12info_to_jsonP13json_object_tPKN7UapkiNS4Cert7CerItemE(ptr noundef, ptr noundef) local_unnamed_addr #0

; 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 @_ZNSt6vectorIPN7UapkiNS4Cert7CerItemESaIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7UapkiNS8VectorBAC2Em(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) unnamed_addr #0 align 2

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

declare noundef ptr @_ZN11CmProviders13openedStorageEv() local_unnamed_addr #2

declare noundef i32 @_ZN14CmStorageProxy22sessionGetCertificatesERSt6vectorIP12ByteArray_stSaIS2_EE(ptr noundef nonnull align 8 dereferenceable(168), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2

declare noundef i32 @_ZN14CmStorageProxy18keyGetCertificatesERSt6vectorIP12ByteArray_stSaIS2_EE(ptr noundef nonnull align 8 dereferenceable(168), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIPN7UapkiNS4Cert7CerItemESaIS3_EE9push_backERKS3_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #0 align 2

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

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

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

declare noundef i32 @_ZN7UapkiNS10Pagination9setResultEP13json_object_t(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef) local_unnamed_addr #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 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 0}
!6 = !{!"_ZTSN7UapkiNS10PaginationE", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24}
!7 = !{!"long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!6, !7, i64 8}
!11 = !{!6, !7, i64 16}
!12 = !{!13, !13, i64 0}
!13 = !{!"any pointer", !8, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass