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

; 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::Crl::CrlItem *, std::allocator<UapkiNS::Crl::CrlItem *>>::_Vector_impl" }
%"struct.std::_Vector_base<UapkiNS::Crl::CrlItem *, std::allocator<UapkiNS::Crl::CrlItem *>>::_Vector_impl" = type { %"struct.std::_Vector_base<UapkiNS::Crl::CrlItem *, std::allocator<UapkiNS::Crl::CrlItem *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<UapkiNS::Crl::CrlItem *, std::allocator<UapkiNS::Crl::CrlItem *>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@.str = external hidden unnamed_addr constant [13 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [11 x i8], align 1

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

27:                                               ; preds = %2
  %28 = load ptr, ptr %8, align 8, !tbaa !5
  %29 = icmp ne ptr %28, null
  br i1 %29, label %31, label %30

30:                                               ; preds = %27, %2
  store i32 4097, ptr %3, align 4
  store i32 1, ptr %11, align 4
  br label %182

31:                                               ; preds = %27
  %32 = load ptr, ptr %7, align 8, !tbaa !5
  %33 = call noundef zeroext i1 @_ZNK7UapkiNS13LibraryConfig13isInitializedEv(ptr noundef nonnull align 8 dereferenceable(97) %32)
  br i1 %33, label %35, label %34

34:                                               ; preds = %31
  store i32 4105, ptr %3, align 4
  store i32 1, ptr %11, align 4
  br label %182

35:                                               ; preds = %31
  %36 = load ptr, ptr %4, align 8, !tbaa !5
  %37 = call noundef zeroext i1 @_ZN7UapkiNS10Pagination11parseParamsEP13json_object_t(ptr noundef nonnull align 8 dereferenceable(32) %10, ptr noundef %36)
  br i1 %37, label %39, label %38

38:                                               ; preds = %35
  store i32 4101, ptr %3, align 4
  store i32 1, ptr %11, align 4
  br label %182

39:                                               ; preds = %35
  %40 = load ptr, ptr %5, align 8, !tbaa !5
  %41 = call ptr @json_value_init_array()
  %42 = call i32 @json_object_set_value(ptr noundef %40, ptr noundef @.str.1, ptr noundef %41)
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  %43 = load ptr, ptr %5, align 8, !tbaa !5
  %44 = call ptr @json_object_get_array(ptr noundef %43, ptr noundef @.str.1)
  store ptr %44, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  store ptr null, ptr %13, align 8, !tbaa !5
  %45 = load i8, ptr %9, align 1, !tbaa !11, !range !13, !noundef !14
  %46 = trunc i8 %45 to i1
  br i1 %46, label %47, label %53

47:                                               ; preds = %39
  %48 = load ptr, ptr %5, align 8, !tbaa !5
  %49 = call ptr @json_value_init_array()
  %50 = call i32 @json_object_set_value(ptr noundef %48, ptr noundef @.str.2, ptr noundef %49)
  %51 = load ptr, ptr %5, align 8, !tbaa !5
  %52 = call ptr @json_object_get_array(ptr noundef %51, ptr noundef @.str.2)
  store ptr %52, ptr %13, align 8, !tbaa !5
  br label %53

53:                                               ; preds = %47, %39
  call void @llvm.lifetime.start.p0(i64 24, ptr %14) #4
  %54 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN7UapkiNS3Crl8CrlStore11getCrlItemsEv(ptr dead_on_unwind writable sret(%"class.std::vector.3") align 8 %14, ptr noundef nonnull align 8 dereferenceable(144) %54)
  %55 = call noundef i64 @_ZNKSt6vectorIPN7UapkiNS3Crl7CrlItemESaIS3_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %14) #4
  %56 = getelementptr inbounds %"struct.UapkiNS::Pagination", ptr %10, i32 0, i32 0
  store i64 %55, ptr %56, align 8, !tbaa !15
  invoke void @_ZN7UapkiNS10Pagination10calcParamsEv(ptr noundef nonnull align 8 dereferenceable(32) %10)
          to label %57 unwind label %66

57:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  %58 = getelementptr inbounds %"struct.UapkiNS::Pagination", ptr %10, i32 0, i32 1
  %59 = load i64, ptr %58, align 8, !tbaa !18
  store i64 %59, ptr %17, align 8, !tbaa !19
  br label %60

60:                                               ; preds = %159, %57
  %61 = load i64, ptr %17, align 8, !tbaa !19
  %62 = getelementptr inbounds %"struct.UapkiNS::Pagination", ptr %10, i32 0, i32 2
  %63 = load i64, ptr %62, align 8, !tbaa !20
  %64 = icmp ult i64 %61, %63
  br i1 %64, label %70, label %65

65:                                               ; preds = %60
  store i32 2, ptr %11, align 4
  br label %163

66:                                               ; preds = %172, %166, %53
  %67 = landingpad { ptr, i32 }
          cleanup
  %68 = extractvalue { ptr, i32 } %67, 0
  store ptr %68, ptr %15, align 8
  %69 = extractvalue { ptr, i32 } %67, 1
  store i32 %69, ptr %16, align 4
  br label %181

70:                                               ; preds = %60
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #4
  %71 = load i64, ptr %17, align 8, !tbaa !19
  %72 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIPN7UapkiNS3Crl7CrlItemESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %14, i64 noundef %71) #4
  %73 = load ptr, ptr %72, align 8, !tbaa !5
  store ptr %73, ptr %18, align 8, !tbaa !5
  br label %74

74:                                               ; preds = %70
  %75 = load ptr, ptr %12, align 8, !tbaa !5
  %76 = load ptr, ptr %18, align 8, !tbaa !5
  %77 = invoke noundef ptr @_ZNK7UapkiNS3Crl7CrlItem8getCrlIdEv(ptr noundef nonnull align 8 dereferenceable(268) %76)
          to label %78 unwind label %86

78:                                               ; preds = %74
  %79 = invoke i32 @json_array_append_base64(ptr noundef %75, ptr noundef %77)
          to label %80 unwind label %86

80:                                               ; preds = %78
  store i32 %79, ptr %6, align 4, !tbaa !9
  %81 = load i32, ptr %6, align 4, !tbaa !9
  %82 = icmp ne i32 %81, 0
  br i1 %82, label %83, label %90

83:                                               ; preds = %80
  %84 = load i32, ptr %6, align 4, !tbaa !9
  invoke void @stacktrace_add(ptr noundef @.str.3, i64 noundef 69, i32 noundef %84)
          to label %85 unwind label %86

85:                                               ; preds = %83
  store i32 7, ptr %11, align 4
  br label %156

86:                                               ; preds = %98, %95, %83, %78, %74
  %87 = landingpad { ptr, i32 }
          cleanup
  %88 = extractvalue { ptr, i32 } %87, 0
  store ptr %88, ptr %15, align 8
  %89 = extractvalue { ptr, i32 } %87, 1
  store i32 %89, ptr %16, align 4
  br label %162

90:                                               ; preds = %80
  br label %91

91:                                               ; preds = %90
  br label %92

92:                                               ; preds = %91
  %93 = load i8, ptr %9, align 1, !tbaa !11, !range !13, !noundef !14
  %94 = trunc i8 %93 to i1
  br i1 %94, label %95, label %155

95:                                               ; preds = %92
  %96 = load ptr, ptr %13, align 8, !tbaa !5
  %97 = invoke ptr @json_value_init_object()
          to label %98 unwind label %86

98:                                               ; preds = %95
  %99 = invoke i32 @json_array_append_value(ptr noundef %96, ptr noundef %97)
          to label %100 unwind label %86

100:                                              ; preds = %98
  %101 = icmp ne i32 %99, 0
  br i1 %101, label %102, label %103

102:                                              ; preds = %100
  store i32 4113, ptr %6, align 4, !tbaa !9
  store i32 7, ptr %11, align 4
  br label %156

103:                                              ; preds = %100
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #4
  %104 = load ptr, ptr %13, align 8, !tbaa !5
  %105 = load i64, ptr %17, align 8, !tbaa !19
  %106 = invoke ptr @json_array_get_object(ptr noundef %104, i64 noundef %105)
          to label %107 unwind label %120

107:                                              ; preds = %103
  store ptr %106, ptr %19, align 8, !tbaa !5
  br label %108

108:                                              ; preds = %107
  %109 = load ptr, ptr %19, align 8, !tbaa !5
  %110 = load ptr, ptr %18, align 8, !tbaa !5
  %111 = invoke noundef ptr @_ZNK7UapkiNS3Crl7CrlItem8getCrlIdEv(ptr noundef nonnull align 8 dereferenceable(268) %110)
          to label %112 unwind label %120

112:                                              ; preds = %108
  %113 = invoke i32 @json_object_set_base64(ptr noundef %109, ptr noundef @.str.4, ptr noundef %111)
          to label %114 unwind label %120

114:                                              ; preds = %112
  store i32 %113, ptr %6, align 4, !tbaa !9
  %115 = load i32, ptr %6, align 4, !tbaa !9
  %116 = icmp ne i32 %115, 0
  br i1 %116, label %117, label %124

117:                                              ; preds = %114
  %118 = load i32, ptr %6, align 4, !tbaa !9
  invoke void @stacktrace_add(ptr noundef @.str.3, i64 noundef 73, i32 noundef %118)
          to label %119 unwind label %120

119:                                              ; preds = %117
  store i32 7, ptr %11, align 4
  br label %152

120:                                              ; preds = %144, %139, %134, %127, %117, %112, %108, %103
  %121 = landingpad { ptr, i32 }
          cleanup
  %122 = extractvalue { ptr, i32 } %121, 0
  store ptr %122, ptr %15, align 8
  %123 = extractvalue { ptr, i32 } %121, 1
  store i32 %123, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #4
  br label %162

124:                                              ; preds = %114
  br label %125

125:                                              ; preds = %124
  br label %126

126:                                              ; preds = %125
  br label %127

127:                                              ; preds = %126
  %128 = load ptr, ptr %19, align 8, !tbaa !5
  %129 = load ptr, ptr %18, align 8, !tbaa !5
  %130 = invoke noundef i32 @_ZN7UapkiNS3Crl10infoToJsonEP13json_object_tPKNS0_7CrlItemE(ptr noundef %128, ptr noundef %129)
          to label %131 unwind label %120

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

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

136:                                              ; preds = %134
  store i32 7, ptr %11, align 4
  br label %152

137:                                              ; preds = %131
  br label %138

138:                                              ; preds = %137
  br label %139

139:                                              ; preds = %138
  %140 = load ptr, ptr %18, align 8, !tbaa !5
  %141 = invoke noundef i32 @_ZNK7UapkiNS3Crl7CrlItem12getActualityEv(ptr noundef nonnull align 8 dereferenceable(268) %140)
          to label %142 unwind label %120

142:                                              ; preds = %139
  %143 = icmp eq i32 %141, 2
  br i1 %143, label %144, label %151

144:                                              ; preds = %142
  %145 = load ptr, ptr %19, align 8, !tbaa !5
  %146 = invoke noundef i32 @_ZN12ParsonHelper20jsonObjectSetBooleanEP13json_object_tPKcb(ptr noundef %145, ptr noundef @.str.5, i1 noundef zeroext true)
          to label %147 unwind label %120

147:                                              ; preds = %144
  %148 = icmp ne i32 %146, 0
  br i1 %148, label %149, label %150

149:                                              ; preds = %147
  store i32 4113, ptr %6, align 4, !tbaa !9
  store i32 7, ptr %11, align 4
  br label %152

150:                                              ; preds = %147
  br label %151

151:                                              ; preds = %150, %142
  store i32 0, ptr %11, align 4
  br label %152

152:                                              ; preds = %151, %149, %136, %119
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #4
  %153 = load i32, ptr %11, align 4
  switch i32 %153, label %156 [
    i32 0, label %154
  ]

154:                                              ; preds = %152
  br label %155

155:                                              ; preds = %154, %92
  store i32 0, ptr %11, align 4
  br label %156

156:                                              ; preds = %155, %152, %102, %85
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  %157 = load i32, ptr %11, align 4
  switch i32 %157, label %163 [
    i32 0, label %158
  ]

158:                                              ; preds = %156
  br label %159

159:                                              ; preds = %158
  %160 = load i64, ptr %17, align 8, !tbaa !19
  %161 = add i64 %160, 1
  store i64 %161, ptr %17, align 8, !tbaa !19
  br label %60, !llvm.loop !21

162:                                              ; preds = %120, %86
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  br label %181

163:                                              ; preds = %156, %65
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  %164 = load i32, ptr %11, align 4
  switch i32 %164, label %180 [
    i32 2, label %165
    i32 7, label %178
  ]

165:                                              ; preds = %163
  br label %166

166:                                              ; preds = %165
  %167 = load ptr, ptr %5, align 8, !tbaa !5
  %168 = invoke noundef i32 @_ZN7UapkiNS10Pagination9setResultEP13json_object_t(ptr noundef nonnull align 8 dereferenceable(32) %10, ptr noundef %167)
          to label %169 unwind label %66

169:                                              ; preds = %166
  store i32 %168, ptr %6, align 4, !tbaa !9
  %170 = load i32, ptr %6, align 4, !tbaa !9
  %171 = icmp ne i32 %170, 0
  br i1 %171, label %172, label %175

172:                                              ; preds = %169
  %173 = load i32, ptr %6, align 4, !tbaa !9
  invoke void @stacktrace_add(ptr noundef @.str.3, i64 noundef 81, i32 noundef %173)
          to label %174 unwind label %66

174:                                              ; preds = %172
  br label %178

175:                                              ; preds = %169
  br label %176

176:                                              ; preds = %175
  br label %177

177:                                              ; preds = %176
  br label %178

178:                                              ; preds = %177, %174, %163
  %179 = load i32, ptr %6, align 4, !tbaa !9
  store i32 %179, ptr %3, align 4
  store i32 1, ptr %11, align 4
  br label %180

180:                                              ; preds = %178, %163
  call void @_ZNSt6vectorIPN7UapkiNS3Crl7CrlItemESaIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %14) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  br label %182

181:                                              ; preds = %162, %66
  call void @_ZNSt6vectorIPN7UapkiNS3Crl7CrlItemESaIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %14) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  br label %184

182:                                              ; preds = %180, %38, %34, %30
  call void @llvm.lifetime.end.p0(i64 32, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  %183 = load i32, ptr %3, align 4
  ret i32 %183

184:                                              ; preds = %181
  %185 = load ptr, ptr %15, align 8
  %186 = load i32, ptr %16, align 4
  %187 = insertvalue { ptr, i32 } poison, ptr %185, 0
  %188 = insertvalue { ptr, i32 } %187, i32 %186, 1
  resume { ptr, i32 } %188
}

; 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_crlstoreEv() #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 @_ZN7UapkiNS3Crl8CrlStore11getCrlItemsEv(ptr dead_on_unwind writable sret(%"class.std::vector.3") align 8, ptr noundef nonnull align 8 dereferenceable(144)) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIPN7UapkiNS3Crl7CrlItemESaIS3_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 @_ZNKSt6vectorIPN7UapkiNS3Crl7CrlItemESaIS3_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 @_ZNK7UapkiNS3Crl7CrlItem8getCrlIdEv(ptr noundef nonnull align 8 dereferenceable(268)) #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

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

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

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

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

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

declare noundef i32 @_ZN7UapkiNS10Pagination9setResultEP13json_object_t(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIPN7UapkiNS3Crl7CrlItemESaIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) 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 }

!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"}


; 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::Crl::CrlItem *, std::allocator<UapkiNS::Crl::CrlItem *>>::_Vector_impl" }
%"struct.std::_Vector_base<UapkiNS::Crl::CrlItem *, std::allocator<UapkiNS::Crl::CrlItem *>>::_Vector_impl" = type { %"struct.std::_Vector_base<UapkiNS::Crl::CrlItem *, std::allocator<UapkiNS::Crl::CrlItem *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<UapkiNS::Crl::CrlItem *, std::allocator<UapkiNS::Crl::CrlItem *>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@.str = external hidden unnamed_addr constant [13 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [11 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local i32 @uapki_list_crls(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 = tail call noundef ptr @_ZN7UapkiNS10get_configEv()
  %6 = tail call noundef ptr @_ZN7UapkiNS12get_crlstoreEv()
  %7 = tail call noundef zeroext i1 @_ZN12ParsonHelper20jsonObjectGetBooleanEP13json_object_tPKcb(ptr noundef %0, ptr noundef nonnull @.str, i1 noundef zeroext false)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %3) #4
  call void @_ZN7UapkiNS10PaginationC1Ev(ptr noundef nonnull align 8 dereferenceable(32) %3)
  %8 = icmp ne ptr %5, null
  %9 = icmp ne ptr %6, null
  %or.cond = and i1 %8, %9
  br i1 %or.cond, label %10, label %73

10:                                               ; preds = %2
  %11 = call noundef zeroext i1 @_ZNK7UapkiNS13LibraryConfig13isInitializedEv(ptr noundef nonnull align 8 dereferenceable(97) %5)
  br i1 %11, label %12, label %73

12:                                               ; preds = %10
  %13 = call noundef zeroext i1 @_ZN7UapkiNS10Pagination11parseParamsEP13json_object_t(ptr noundef nonnull align 8 dereferenceable(32) %3, ptr noundef %0)
  br i1 %13, label %14, label %73

14:                                               ; preds = %12
  %15 = call ptr @json_value_init_array()
  %16 = call i32 @json_object_set_value(ptr noundef %1, ptr noundef nonnull @.str.1, ptr noundef %15)
  %17 = call ptr @json_object_get_array(ptr noundef %1, ptr noundef nonnull @.str.1)
  br i1 %7, label %18, label %22

18:                                               ; preds = %14
  %19 = call ptr @json_value_init_array()
  %20 = call i32 @json_object_set_value(ptr noundef %1, ptr noundef nonnull @.str.2, ptr noundef %19)
  %21 = call ptr @json_object_get_array(ptr noundef %1, ptr noundef nonnull @.str.2)
  br label %22

22:                                               ; preds = %18, %14
  %.050 = phi ptr [ %21, %18 ], [ null, %14 ]
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #4
  call void @_ZN7UapkiNS3Crl8CrlStore11getCrlItemsEv(ptr dead_on_unwind nonnull writable sret(%"class.std::vector.3") align 8 %4, ptr noundef nonnull align 8 dereferenceable(144) %6)
  %23 = call noundef i64 @_ZNKSt6vectorIPN7UapkiNS3Crl7CrlItemESaIS3_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #4
  store i64 %23, ptr %3, align 8, !tbaa !5
  invoke void @_ZN7UapkiNS10Pagination10calcParamsEv(ptr noundef nonnull align 8 dereferenceable(32) %3)
          to label %24 unwind label %59

24:                                               ; preds = %22
  %25 = getelementptr inbounds i8, ptr %3, i64 8
  %26 = load i64, ptr %25, align 8, !tbaa !10
  %27 = getelementptr inbounds i8, ptr %3, i64 16
  %28 = load i64, ptr %27, align 8, !tbaa !11
  %29 = icmp ult i64 %26, %28
  br i1 %29, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %24
  br i1 %7, label %.lr.ph.split.us, label %.lr.ph.split

.lr.ph.split.us:                                  ; preds = %.lr.ph, %55
  %.04599.us = phi i64 [ %56, %55 ], [ %26, %.lr.ph ]
  %30 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIPN7UapkiNS3Crl7CrlItemESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %.04599.us) #4
  %31 = load ptr, ptr %30, align 8, !tbaa !12
  %32 = call noundef ptr @_ZNK7UapkiNS3Crl7CrlItem8getCrlIdEv(ptr noundef nonnull align 8 dereferenceable(268) %31)
  %33 = invoke i32 @json_array_append_base64(ptr noundef %17, ptr noundef %32)
          to label %34 unwind label %.loopexit.split.us

34:                                               ; preds = %.lr.ph.split.us
  %.not.us = icmp eq i32 %33, 0
  br i1 %.not.us, label %35, label %.split.us

35:                                               ; preds = %34
  %36 = invoke ptr @json_value_init_object()
          to label %37 unwind label %.loopexit.split.us

37:                                               ; preds = %35
  %38 = invoke i32 @json_array_append_value(ptr noundef %.050, ptr noundef %36)
          to label %39 unwind label %.loopexit.split.us

39:                                               ; preds = %37
  %.not63.us = icmp eq i32 %38, 0
  br i1 %.not63.us, label %40, label %.thread83

40:                                               ; preds = %39
  %41 = invoke ptr @json_array_get_object(ptr noundef %.050, i64 noundef %.04599.us)
          to label %42 unwind label %.loopexit87.split.us

42:                                               ; preds = %40
  %43 = call noundef ptr @_ZNK7UapkiNS3Crl7CrlItem8getCrlIdEv(ptr noundef nonnull align 8 dereferenceable(268) %31)
  %44 = invoke i32 @json_object_set_base64(ptr noundef %41, ptr noundef nonnull @.str.4, ptr noundef %43)
          to label %45 unwind label %.loopexit87.split.us

45:                                               ; preds = %42
  %.not64.us = icmp eq i32 %44, 0
  br i1 %.not64.us, label %46, label %.split103.us

46:                                               ; preds = %45
  %47 = invoke noundef i32 @_ZN7UapkiNS3Crl10infoToJsonEP13json_object_tPKNS0_7CrlItemE(ptr noundef %41, ptr noundef nonnull %31)
          to label %48 unwind label %.loopexit87.split.us

48:                                               ; preds = %46
  %.not65.us = icmp eq i32 %47, 0
  br i1 %.not65.us, label %49, label %.split106.us

49:                                               ; preds = %48
  %50 = call noundef i32 @_ZNK7UapkiNS3Crl7CrlItem12getActualityEv(ptr noundef nonnull align 8 dereferenceable(268) %31)
  %51 = icmp eq i32 %50, 2
  br i1 %51, label %52, label %55

52:                                               ; preds = %49
  %53 = invoke noundef i32 @_ZN12ParsonHelper20jsonObjectSetBooleanEP13json_object_tPKcb(ptr noundef %41, ptr noundef nonnull @.str.5, i1 noundef zeroext true)
          to label %54 unwind label %.loopexit87.split.us

54:                                               ; preds = %52
  %.not66.us = icmp eq i32 %53, 0
  br i1 %.not66.us, label %55, label %.thread83

55:                                               ; preds = %54, %49
  %56 = add nuw i64 %.04599.us, 1
  %57 = load i64, ptr %27, align 8, !tbaa !11
  %58 = icmp ult i64 %56, %57
  br i1 %58, label %.lr.ph.split.us, label %._crit_edge, !llvm.loop !14

.loopexit.split.us:                               ; preds = %37, %35, %.lr.ph.split.us
  %lpad.loopexit.us = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit

.loopexit87.split.us:                             ; preds = %52, %46, %42, %40
  %lpad.loopexit89.us = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit

59:                                               ; preds = %72, %._crit_edge, %22
  %60 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit

.lr.ph.split:                                     ; preds = %.lr.ph, %66
  %.04599 = phi i64 [ %67, %66 ], [ %26, %.lr.ph ]
  %61 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIPN7UapkiNS3Crl7CrlItemESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %.04599) #4
  %62 = load ptr, ptr %61, align 8, !tbaa !12
  %63 = call noundef ptr @_ZNK7UapkiNS3Crl7CrlItem8getCrlIdEv(ptr noundef nonnull align 8 dereferenceable(268) %62)
  %64 = invoke i32 @json_array_append_base64(ptr noundef %17, ptr noundef %63)
          to label %65 unwind label %.loopexit.split

65:                                               ; preds = %.lr.ph.split
  %.not = icmp eq i32 %64, 0
  br i1 %.not, label %66, label %.split.us

.split.us:                                        ; preds = %65, %34
  %.us-phi100 = phi i32 [ %33, %34 ], [ %64, %65 ]
  invoke void @stacktrace_add(ptr noundef nonnull @.str.3, i64 noundef 69, i32 noundef %.us-phi100)
          to label %.thread83 unwind label %.loopexit.split-lp

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

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

66:                                               ; preds = %65
  %67 = add nuw i64 %.04599, 1
  %68 = load i64, ptr %27, align 8, !tbaa !11
  %69 = icmp ult i64 %67, %68
  br i1 %69, label %.lr.ph.split, label %._crit_edge, !llvm.loop !14

.split103.us:                                     ; preds = %45
  invoke void @stacktrace_add(ptr noundef nonnull @.str.3, i64 noundef 73, i32 noundef %44)
          to label %.thread83 unwind label %.loopexit.split-lp88

.loopexit.split-lp88:                             ; preds = %.split103.us, %.split106.us
  %lpad.loopexit.split-lp90 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit

.split106.us:                                     ; preds = %48
  invoke void @stacktrace_add(ptr noundef nonnull @.str.3, i64 noundef 74, i32 noundef %47)
          to label %.thread83 unwind label %.loopexit.split-lp88

._crit_edge:                                      ; preds = %66, %55, %24
  %70 = invoke noundef i32 @_ZN7UapkiNS10Pagination9setResultEP13json_object_t(ptr noundef nonnull align 8 dereferenceable(32) %3, ptr noundef %1)
          to label %71 unwind label %59

71:                                               ; preds = %._crit_edge
  %.not68 = icmp eq i32 %70, 0
  br i1 %.not68, label %.thread83, label %72

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

.thread83:                                        ; preds = %54, %39, %.split106.us, %.split103.us, %.split.us, %72, %71
  %.0 = phi i32 [ %70, %72 ], [ 0, %71 ], [ %.us-phi100, %.split.us ], [ %47, %.split106.us ], [ %44, %.split103.us ], [ 4113, %39 ], [ 4113, %54 ]
  call void @_ZNSt6vectorIPN7UapkiNS3Crl7CrlItemESaIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #4
  br label %73

.loopexit:                                        ; preds = %.loopexit87.split.us, %.loopexit.split-lp88, %.loopexit.split-lp, %.loopexit.split.us, %.loopexit.split, %59
  %.pn69 = phi { ptr, i32 } [ %60, %59 ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ], [ %lpad.loopexit, %.loopexit.split ], [ %lpad.loopexit.us, %.loopexit.split.us ], [ %lpad.loopexit89.us, %.loopexit87.split.us ], [ %lpad.loopexit.split-lp90, %.loopexit.split-lp88 ]
  call void @_ZNSt6vectorIPN7UapkiNS3Crl7CrlItemESaIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #4
  resume { ptr, i32 } %.pn69

73:                                               ; preds = %12, %10, %2, %.thread83
  %.1 = phi i32 [ %.0, %.thread83 ], [ 4097, %2 ], [ 4105, %10 ], [ 4101, %12 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #4
  ret i32 %.1
}

; 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_crlstoreEv() 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 @_ZN7UapkiNS3Crl8CrlStore11getCrlItemsEv(ptr dead_on_unwind writable sret(%"class.std::vector.3") align 8, ptr noundef nonnull align 8 dereferenceable(144)) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIPN7UapkiNS3Crl7CrlItemESaIS3_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 @_ZNKSt6vectorIPN7UapkiNS3Crl7CrlItemESaIS3_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 @_ZNK7UapkiNS3Crl7CrlItem8getCrlIdEv(ptr noundef nonnull align 8 dereferenceable(268)) 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

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

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

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

declare noundef i32 @_ZN12ParsonHelper20jsonObjectSetBooleanEP13json_object_tPKcb(ptr noundef, ptr noundef, i1 noundef zeroext) 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

declare noundef i32 @_ZN7UapkiNS10Pagination9setResultEP13json_object_t(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIPN7UapkiNS3Crl7CrlItemESaIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) 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 }

!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"}


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