; LLVM IR from specinfo-ua/UAPKI :: library/common/pkix (extension-helper-json)

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

%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.UapkiNS::SmartBA" = type { ptr }
%struct.CertificatePolicies = type { %struct.anon.2, %struct.asn_struct_ctx_s }
%struct.anon.2 = type { ptr, i32, i32, ptr }
%struct.asn_struct_ctx_s = type { i16, i16, i32, ptr, i64 }
%struct.PolicyInformation = type { %struct.ASN__PRIMITIVE_TYPE_s, ptr, %struct.asn_struct_ctx_s }
%struct.ASN__PRIMITIVE_TYPE_s = type { ptr, i32 }
%"struct.PolicyInformation::policyQualifiers" = type { %struct.anon.3, %struct.asn_struct_ctx_s }
%struct.anon.3 = type { ptr, i32, i32, ptr }
%struct.PolicyQualifierInfo = type { %struct.ASN__PRIMITIVE_TYPE_s, %struct.ANY, %struct.asn_struct_ctx_s }
%struct.ANY = type { ptr, i32, %struct.asn_struct_ctx_s }

@.str = external hidden unnamed_addr constant [38 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [10 x i8], align 1
@OID_PKIX_PqiCps = external global ptr, align 8
@.str.17 = external hidden unnamed_addr constant [4 x i8], align 1

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

declare ptr @asn_decode_ba_with_alloc(ptr noundef, ptr noundef) #1

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

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

declare ptr @json_value_init_array() #1

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

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

declare ptr @json_value_init_object() #1

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

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

declare noundef i32 @_ZN7UapkiNS4Util11oidFromAsn1EPK21ASN__PRIMITIVE_TYPE_sRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef, ptr noundef nonnull align 8 dereferenceable(32)) #1

declare i32 @__gxx_personality_v0(...)

declare zeroext i1 @oid_is_equal(ptr noundef, ptr noundef) #1

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

declare i32 @json_object_set_string(ptr noundef, ptr noundef, ptr noundef) #1

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

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

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

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

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

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

declare void @asn_free(ptr noundef, ptr noundef) #1

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN7UapkiNS15ExtensionHelper18DecodeToJsonObject19certificatePoliciesEPK12ByteArray_stP13json_object_t(ptr noundef %0, ptr noundef %1) #3 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 ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca %"class.std::__cxx11::basic_string", align 8
  %15 = alloca %"class.std::__cxx11::basic_string", align 8
  %16 = alloca %"class.std::__cxx11::basic_string", align 8
  %17 = alloca %"class.UapkiNS::SmartBA", align 8
  %18 = alloca ptr, align 8
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca ptr, align 8
  %22 = 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
  store ptr null, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  store ptr null, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  store ptr null, ptr %9, align 8, !tbaa !5
  br label %23

23:                                               ; preds = %2
  %24 = call ptr @get_CertificatePolicies_desc()
  %25 = load ptr, ptr %4, align 8, !tbaa !5
  %26 = call ptr @asn_decode_ba_with_alloc(ptr noundef %24, ptr noundef %25)
  store ptr %26, ptr %7, align 8, !tbaa !5
  %27 = icmp eq ptr null, %26
  br i1 %27, label %28, label %30

28:                                               ; preds = %23
  store i32 2, ptr %6, align 4, !tbaa !9
  %29 = load i32, ptr %6, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str, i64 noundef 309, i32 noundef %29)
  br label %263

30:                                               ; preds = %23
  br label %31

31:                                               ; preds = %30
  br label %32

32:                                               ; preds = %31
  %33 = load ptr, ptr %5, align 8, !tbaa !5
  %34 = call ptr @json_value_init_array()
  %35 = call i32 @json_object_set_value(ptr noundef %33, ptr noundef @.str.12, ptr noundef %34)
  %36 = icmp ne i32 %35, 0
  br i1 %36, label %37, label %38

37:                                               ; preds = %32
  store i32 4113, ptr %6, align 4, !tbaa !9
  br label %263

38:                                               ; preds = %32
  %39 = load ptr, ptr %5, align 8, !tbaa !5
  %40 = call ptr @json_object_get_array(ptr noundef %39, ptr noundef @.str.12)
  store ptr %40, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  store i32 0, ptr %10, align 4, !tbaa !9
  br label %41

41:                                               ; preds = %255, %38
  %42 = load i32, ptr %10, align 4, !tbaa !9
  %43 = load ptr, ptr %7, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.CertificatePolicies, ptr %43, i32 0, i32 0
  %45 = getelementptr inbounds %struct.anon.2, ptr %44, i32 0, i32 1
  %46 = load i32, ptr %45, align 8, !tbaa !11
  %47 = icmp slt i32 %42, %46
  br i1 %47, label %49, label %48

48:                                               ; preds = %41
  store i32 5, ptr %11, align 4
  br label %260

49:                                               ; preds = %41
  %50 = load ptr, ptr %8, align 8, !tbaa !5
  %51 = call ptr @json_value_init_object()
  %52 = call i32 @json_array_append_value(ptr noundef %50, ptr noundef %51)
  %53 = icmp ne i32 %52, 0
  br i1 %53, label %54, label %55

54:                                               ; preds = %49
  store i32 4113, ptr %6, align 4, !tbaa !9
  store i32 4, ptr %11, align 4
  br label %260

55:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  %56 = load ptr, ptr %8, align 8, !tbaa !5
  %57 = load i32, ptr %10, align 4, !tbaa !9
  %58 = sext i32 %57 to i64
  %59 = call ptr @json_array_get_object(ptr noundef %56, i64 noundef %58)
  store ptr %59, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  %60 = load ptr, ptr %7, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.CertificatePolicies, ptr %60, i32 0, i32 0
  %62 = getelementptr inbounds %struct.anon.2, ptr %61, i32 0, i32 0
  %63 = load ptr, ptr %62, align 8, !tbaa !17
  %64 = load i32, ptr %10, align 4, !tbaa !9
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds ptr, ptr %63, i64 %65
  %67 = load ptr, ptr %66, align 8, !tbaa !5
  store ptr %67, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr %14) #4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %14) #4
  call void @llvm.lifetime.start.p0(i64 32, ptr %15) #4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %15) #4
  call void @llvm.lifetime.start.p0(i64 32, ptr %16) #4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %16) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  invoke void @_ZN7UapkiNS7SmartBAC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %17)
          to label %68 unwind label %79

68:                                               ; preds = %55
  br label %69

69:                                               ; preds = %68
  %70 = load ptr, ptr %13, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.PolicyInformation, ptr %70, i32 0, i32 0
  %72 = invoke noundef i32 @_ZN7UapkiNS4Util11oidFromAsn1EPK21ASN__PRIMITIVE_TYPE_sRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef %71, ptr noundef nonnull align 8 dereferenceable(32) %14)
          to label %73 unwind label %83

73:                                               ; preds = %69
  store i32 %72, ptr %6, align 4, !tbaa !9
  %74 = load i32, ptr %6, align 4, !tbaa !9
  %75 = icmp ne i32 %74, 0
  br i1 %75, label %76, label %87

76:                                               ; preds = %73
  %77 = load i32, ptr %6, align 4, !tbaa !9
  invoke void @stacktrace_add(ptr noundef @.str, i64 noundef 321, i32 noundef %77)
          to label %78 unwind label %83

78:                                               ; preds = %76
  store i32 4, ptr %11, align 4
  br label %252

79:                                               ; preds = %55
  %80 = landingpad { ptr, i32 }
          cleanup
  %81 = extractvalue { ptr, i32 } %80, 0
  store ptr %81, ptr %18, align 8
  %82 = extractvalue { ptr, i32 } %80, 1
  store i32 %82, ptr %19, align 4
  br label %259

83:                                               ; preds = %109, %104, %101, %89, %76, %69
  %84 = landingpad { ptr, i32 }
          cleanup
  %85 = extractvalue { ptr, i32 } %84, 0
  store ptr %85, ptr %18, align 8
  %86 = extractvalue { ptr, i32 } %84, 1
  store i32 %86, ptr %19, align 4
  br label %258

87:                                               ; preds = %73
  br label %88

88:                                               ; preds = %87
  br label %89

89:                                               ; preds = %88
  %90 = load ptr, ptr %12, align 8, !tbaa !5
  %91 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %14) #4
  %92 = invoke i32 @json_object_set_string(ptr noundef %90, ptr noundef @.str.13, ptr noundef %91)
          to label %93 unwind label %83

93:                                               ; preds = %89
  %94 = icmp ne i32 %92, 0
  br i1 %94, label %95, label %96

95:                                               ; preds = %93
  store i32 4113, ptr %6, align 4, !tbaa !9
  store i32 4, ptr %11, align 4
  br label %252

96:                                               ; preds = %93
  %97 = load ptr, ptr %13, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.PolicyInformation, ptr %97, i32 0, i32 1
  %99 = load ptr, ptr %98, align 8, !tbaa !18
  %100 = icmp ne ptr %99, null
  br i1 %100, label %101, label %251

101:                                              ; preds = %96
  %102 = load ptr, ptr %12, align 8, !tbaa !5
  %103 = invoke ptr @json_value_init_array()
          to label %104 unwind label %83

104:                                              ; preds = %101
  %105 = invoke i32 @json_object_set_value(ptr noundef %102, ptr noundef @.str.14, ptr noundef %103)
          to label %106 unwind label %83

106:                                              ; preds = %104
  %107 = icmp ne i32 %105, 0
  br i1 %107, label %108, label %109

108:                                              ; preds = %106
  store i32 4113, ptr %6, align 4, !tbaa !9
  store i32 4, ptr %11, align 4
  br label %252

109:                                              ; preds = %106
  %110 = load ptr, ptr %12, align 8, !tbaa !5
  %111 = invoke ptr @json_object_get_array(ptr noundef %110, ptr noundef @.str.14)
          to label %112 unwind label %83

112:                                              ; preds = %109
  store ptr %111, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #4
  store i32 0, ptr %20, align 4, !tbaa !9
  br label %113

113:                                              ; preds = %243, %112
  %114 = load i32, ptr %20, align 4, !tbaa !9
  %115 = load ptr, ptr %13, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.PolicyInformation, ptr %115, i32 0, i32 1
  %117 = load ptr, ptr %116, align 8, !tbaa !18
  %118 = getelementptr inbounds %"struct.PolicyInformation::policyQualifiers", ptr %117, i32 0, i32 0
  %119 = getelementptr inbounds %struct.anon.3, ptr %118, i32 0, i32 1
  %120 = load i32, ptr %119, align 8, !tbaa !21
  %121 = icmp slt i32 %114, %120
  br i1 %121, label %123, label %122

122:                                              ; preds = %113
  store i32 10, ptr %11, align 4
  br label %247

123:                                              ; preds = %113
  %124 = load ptr, ptr %9, align 8, !tbaa !5
  %125 = invoke ptr @json_value_init_object()
          to label %126 unwind label %131

126:                                              ; preds = %123
  %127 = invoke i32 @json_array_append_value(ptr noundef %124, ptr noundef %125)
          to label %128 unwind label %131

128:                                              ; preds = %126
  %129 = icmp ne i32 %127, 0
  br i1 %129, label %130, label %135

130:                                              ; preds = %128
  store i32 4113, ptr %6, align 4, !tbaa !9
  store i32 4, ptr %11, align 4
  br label %247

131:                                              ; preds = %126, %123
  %132 = landingpad { ptr, i32 }
          cleanup
  %133 = extractvalue { ptr, i32 } %132, 0
  store ptr %133, ptr %18, align 8
  %134 = extractvalue { ptr, i32 } %132, 1
  store i32 %134, ptr %19, align 4
  br label %249

135:                                              ; preds = %128
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #4
  %136 = load ptr, ptr %9, align 8, !tbaa !5
  %137 = load i32, ptr %20, align 4, !tbaa !9
  %138 = sext i32 %137 to i64
  %139 = invoke ptr @json_array_get_object(ptr noundef %136, i64 noundef %138)
          to label %140 unwind label %161

140:                                              ; preds = %135
  store ptr %139, ptr %21, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #4
  %141 = load ptr, ptr %13, align 8, !tbaa !5
  %142 = getelementptr inbounds %struct.PolicyInformation, ptr %141, i32 0, i32 1
  %143 = load ptr, ptr %142, align 8, !tbaa !18
  %144 = getelementptr inbounds %"struct.PolicyInformation::policyQualifiers", ptr %143, i32 0, i32 0
  %145 = getelementptr inbounds %struct.anon.3, ptr %144, i32 0, i32 0
  %146 = load ptr, ptr %145, align 8, !tbaa !24
  %147 = load i32, ptr %20, align 4, !tbaa !9
  %148 = sext i32 %147 to i64
  %149 = getelementptr inbounds ptr, ptr %146, i64 %148
  %150 = load ptr, ptr %149, align 8, !tbaa !5
  store ptr %150, ptr %22, align 8, !tbaa !5
  br label %151

151:                                              ; preds = %140
  %152 = load ptr, ptr %22, align 8, !tbaa !5
  %153 = getelementptr inbounds %struct.PolicyQualifierInfo, ptr %152, i32 0, i32 0
  %154 = invoke noundef i32 @_ZN7UapkiNS4Util11oidFromAsn1EPK21ASN__PRIMITIVE_TYPE_sRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef %153, ptr noundef nonnull align 8 dereferenceable(32) %15)
          to label %155 unwind label %165

155:                                              ; preds = %151
  store i32 %154, ptr %6, align 4, !tbaa !9
  %156 = load i32, ptr %6, align 4, !tbaa !9
  %157 = icmp ne i32 %156, 0
  br i1 %157, label %158, label %169

158:                                              ; preds = %155
  %159 = load i32, ptr %6, align 4, !tbaa !9
  invoke void @stacktrace_add(ptr noundef @.str, i64 noundef 333, i32 noundef %159)
          to label %160 unwind label %165

160:                                              ; preds = %158
  store i32 4, ptr %11, align 4
  br label %240

161:                                              ; preds = %135
  %162 = landingpad { ptr, i32 }
          cleanup
  %163 = extractvalue { ptr, i32 } %162, 0
  store ptr %163, ptr %18, align 8
  %164 = extractvalue { ptr, i32 } %162, 1
  store i32 %164, ptr %19, align 4
  br label %246

165:                                              ; preds = %230, %225, %220, %218, %212, %207, %202, %199, %193, %189, %178, %171, %158, %151
  %166 = landingpad { ptr, i32 }
          cleanup
  %167 = extractvalue { ptr, i32 } %166, 0
  store ptr %167, ptr %18, align 8
  %168 = extractvalue { ptr, i32 } %166, 1
  store i32 %168, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #4
  br label %246

169:                                              ; preds = %155
  br label %170

170:                                              ; preds = %169
  br label %171

171:                                              ; preds = %170
  %172 = load ptr, ptr %21, align 8, !tbaa !5
  %173 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %15) #4
  %174 = invoke i32 @json_object_set_string(ptr noundef %172, ptr noundef @.str.15, ptr noundef %173)
          to label %175 unwind label %165

175:                                              ; preds = %171
  %176 = icmp ne i32 %174, 0
  br i1 %176, label %177, label %178

177:                                              ; preds = %175
  store i32 4113, ptr %6, align 4, !tbaa !9
  store i32 4, ptr %11, align 4
  br label %240

178:                                              ; preds = %175
  %179 = load ptr, ptr %22, align 8, !tbaa !5
  %180 = getelementptr inbounds %struct.PolicyQualifierInfo, ptr %179, i32 0, i32 1
  %181 = getelementptr inbounds %struct.ANY, ptr %180, i32 0, i32 0
  %182 = load ptr, ptr %181, align 8, !tbaa !25
  %183 = load ptr, ptr %22, align 8, !tbaa !5
  %184 = getelementptr inbounds %struct.PolicyQualifierInfo, ptr %183, i32 0, i32 1
  %185 = getelementptr inbounds %struct.ANY, ptr %184, i32 0, i32 1
  %186 = load i32, ptr %185, align 8, !tbaa !28
  %187 = sext i32 %186 to i64
  %188 = invoke ptr @ba_alloc_from_uint8(ptr noundef %182, i64 noundef %187)
          to label %189 unwind label %165

189:                                              ; preds = %178
  %190 = invoke noundef zeroext i1 @_ZN7UapkiNS7SmartBA3setEP12ByteArray_st(ptr noundef nonnull align 8 dereferenceable(8) %17, ptr noundef %188)
          to label %191 unwind label %165

191:                                              ; preds = %189
  br i1 %190, label %198, label %192

192:                                              ; preds = %191
  br label %193

193:                                              ; preds = %192
  store i32 4097, ptr %6, align 4, !tbaa !9
  %194 = load i32, ptr %6, align 4, !tbaa !9
  invoke void @stacktrace_create(ptr noundef @.str, i64 noundef 337, i32 noundef %194, ptr noundef null)
          to label %195 unwind label %165

195:                                              ; preds = %193
  store i32 4, ptr %11, align 4
  br label %240

196:                                              ; No predecessors!
  br label %197

197:                                              ; preds = %196
  br label %198

198:                                              ; preds = %197, %191
  br label %199

199:                                              ; preds = %198
  %200 = load ptr, ptr %21, align 8, !tbaa !5
  %201 = invoke noundef ptr @_ZNK7UapkiNS7SmartBA3getEv(ptr noundef nonnull align 8 dereferenceable(8) %17)
          to label %202 unwind label %165

202:                                              ; preds = %199
  %203 = invoke i32 @json_object_set_base64(ptr noundef %200, ptr noundef @.str.16, ptr noundef %201)
          to label %204 unwind label %165

204:                                              ; preds = %202
  store i32 %203, ptr %6, align 4, !tbaa !9
  %205 = load i32, ptr %6, align 4, !tbaa !9
  %206 = icmp ne i32 %205, 0
  br i1 %206, label %207, label %210

207:                                              ; preds = %204
  %208 = load i32, ptr %6, align 4, !tbaa !9
  invoke void @stacktrace_add(ptr noundef @.str, i64 noundef 340, i32 noundef %208)
          to label %209 unwind label %165

209:                                              ; preds = %207
  store i32 4, ptr %11, align 4
  br label %240

210:                                              ; preds = %204
  br label %211

211:                                              ; preds = %210
  br label %212

212:                                              ; preds = %211
  %213 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %15) #4
  %214 = load ptr, ptr @OID_PKIX_PqiCps, align 8, !tbaa !5
  %215 = invoke zeroext i1 @oid_is_equal(ptr noundef %213, ptr noundef %214)
          to label %216 unwind label %165

216:                                              ; preds = %212
  br i1 %215, label %217, label %238

217:                                              ; preds = %216
  br label %218

218:                                              ; preds = %217
  %219 = invoke noundef ptr @_ZNK7UapkiNS7SmartBA3getEv(ptr noundef nonnull align 8 dereferenceable(8) %17)
          to label %220 unwind label %165

220:                                              ; preds = %218
  %221 = invoke noundef i32 @_ZN7UapkiNS4Util15decodeAnyStringEPK12ByteArray_stRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef %219, ptr noundef nonnull align 8 dereferenceable(32) %16)
          to label %222 unwind label %165

222:                                              ; preds = %220
  store i32 %221, ptr %6, align 4, !tbaa !9
  %223 = load i32, ptr %6, align 4, !tbaa !9
  %224 = icmp ne i32 %223, 0
  br i1 %224, label %225, label %228

225:                                              ; preds = %222
  %226 = load i32, ptr %6, align 4, !tbaa !9
  invoke void @stacktrace_add(ptr noundef @.str, i64 noundef 342, i32 noundef %226)
          to label %227 unwind label %165

227:                                              ; preds = %225
  store i32 4, ptr %11, align 4
  br label %240

228:                                              ; preds = %222
  br label %229

229:                                              ; preds = %228
  br label %230

230:                                              ; preds = %229
  %231 = load ptr, ptr %21, align 8, !tbaa !5
  %232 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %16) #4
  %233 = invoke i32 @json_object_set_string(ptr noundef %231, ptr noundef @.str.17, ptr noundef %232)
          to label %234 unwind label %165

234:                                              ; preds = %230
  %235 = icmp ne i32 %233, 0
  br i1 %235, label %236, label %237

236:                                              ; preds = %234
  store i32 4113, ptr %6, align 4, !tbaa !9
  store i32 4, ptr %11, align 4
  br label %240

237:                                              ; preds = %234
  br label %239

238:                                              ; preds = %216
  br label %239

239:                                              ; preds = %238, %237
  store i32 0, ptr %11, align 4
  br label %240

240:                                              ; preds = %239, %236, %227, %209, %195, %177, %160
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #4
  %241 = load i32, ptr %11, align 4
  switch i32 %241, label %247 [
    i32 0, label %242
  ]

242:                                              ; preds = %240
  br label %243

243:                                              ; preds = %242
  %244 = load i32, ptr %20, align 4, !tbaa !9
  %245 = add nsw i32 %244, 1
  store i32 %245, ptr %20, align 4, !tbaa !9
  br label %113, !llvm.loop !29

246:                                              ; preds = %165, %161
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #4
  br label %249

247:                                              ; preds = %240, %130, %122
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #4
  %248 = load i32, ptr %11, align 4
  switch i32 %248, label %252 [
    i32 10, label %250
  ]

249:                                              ; preds = %246, %131
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #4
  br label %258

250:                                              ; preds = %247
  br label %251

251:                                              ; preds = %250, %96
  store i32 0, ptr %11, align 4
  br label %252

252:                                              ; preds = %251, %247, %108, %95, %78
  call void @_ZN7UapkiNS7SmartBAD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %17) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %16) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %16) #4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %15) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %15) #4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %14) #4
  call void @llvm.lifetime.end.p0(i64 32, 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
  %253 = load i32, ptr %11, align 4
  switch i32 %253, label %260 [
    i32 0, label %254
  ]

254:                                              ; preds = %252
  br label %255

255:                                              ; preds = %254
  %256 = load i32, ptr %10, align 4, !tbaa !9
  %257 = add nsw i32 %256, 1
  store i32 %257, ptr %10, align 4, !tbaa !9
  br label %41, !llvm.loop !31

258:                                              ; preds = %249, %83
  call void @_ZN7UapkiNS7SmartBAD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %17) #4
  br label %259

259:                                              ; preds = %258, %79
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %16) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %16) #4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %15) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %15) #4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %14) #4
  call void @llvm.lifetime.end.p0(i64 32, 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 4, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, 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 %269

260:                                              ; preds = %252, %54, %48
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  %261 = load i32, ptr %11, align 4
  switch i32 %261, label %267 [
    i32 5, label %262
    i32 4, label %263
  ]

262:                                              ; preds = %260
  br label %263

263:                                              ; preds = %262, %260, %37, %28
  %264 = call ptr @get_CertificatePolicies_desc()
  %265 = load ptr, ptr %7, align 8, !tbaa !5
  call void @asn_free(ptr noundef %264, ptr noundef %265)
  %266 = load i32, ptr %6, align 4, !tbaa !9
  store i32 %266, ptr %3, align 4
  store i32 1, ptr %11, align 4
  br label %267

267:                                              ; preds = %263, %260
  call void @llvm.lifetime.end.p0(i64 8, 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
  %268 = load i32, ptr %3, align 4
  ret i32 %268

269:                                              ; preds = %259
  %270 = load ptr, ptr %18, align 8
  %271 = load i32, ptr %19, align 4
  %272 = insertvalue { ptr, i32 } poison, ptr %270, 0
  %273 = insertvalue { ptr, i32 } %272, i32 %271, 1
  resume { ptr, i32 } %273
}

declare ptr @get_CertificatePolicies_desc() #1

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

declare ptr @ba_alloc_from_uint8(ptr noundef, i64 noundef) #1

declare noundef i32 @_ZN7UapkiNS4Util15decodeAnyStringEPK12ByteArray_stRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef, ptr noundef nonnull align 8 dereferenceable(32)) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 #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, !10, i64 8}
!12 = !{!"_ZTS19CertificatePolicies", !13, i64 0, !14, i64 24}
!13 = !{!"_ZTSN19CertificatePoliciesUt_E", !6, i64 0, !10, i64 8, !10, i64 12, !6, i64 16}
!14 = !{!"_ZTS16asn_struct_ctx_s", !15, i64 0, !15, i64 2, !10, i64 4, !6, i64 8, !16, i64 16}
!15 = !{!"short", !7, i64 0}
!16 = !{!"long", !7, i64 0}
!17 = !{!12, !6, i64 0}
!18 = !{!19, !6, i64 16}
!19 = !{!"_ZTS17PolicyInformation", !20, i64 0, !6, i64 16, !14, i64 24}
!20 = !{!"_ZTS21ASN__PRIMITIVE_TYPE_s", !6, i64 0, !10, i64 8}
!21 = !{!22, !10, i64 8}
!22 = !{!"_ZTSN17PolicyInformation16policyQualifiersE", !23, i64 0, !14, i64 24}
!23 = !{!"_ZTSN17PolicyInformation16policyQualifiersUt_E", !6, i64 0, !10, i64 8, !10, i64 12, !6, i64 16}
!24 = !{!22, !6, i64 0}
!25 = !{!26, !6, i64 16}
!26 = !{!"_ZTS19PolicyQualifierInfo", !20, i64 0, !27, i64 16, !14, i64 56}
!27 = !{!"_ZTS3ANY", !6, i64 0, !10, i64 8, !14, i64 16}
!28 = !{!26, !10, i64 24}
!29 = distinct !{!29, !30}
!30 = !{!"llvm.loop.mustprogress"}
!31 = distinct !{!31, !30}


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

%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.UapkiNS::SmartBA" = type { ptr }

@.str = external hidden unnamed_addr constant [38 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [10 x i8], align 1
@OID_PKIX_PqiCps = external local_unnamed_addr global ptr, align 8
@.str.17 = external hidden unnamed_addr constant [4 x i8], align 1

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

declare ptr @asn_decode_ba_with_alloc(ptr noundef, ptr noundef) local_unnamed_addr #1

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

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

declare ptr @json_value_init_array() local_unnamed_addr #1

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

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

declare ptr @json_value_init_object() local_unnamed_addr #1

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

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

declare noundef i32 @_ZN7UapkiNS4Util11oidFromAsn1EPK21ASN__PRIMITIVE_TYPE_sRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef, ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #1

declare i32 @__gxx_personality_v0(...)

declare zeroext i1 @oid_is_equal(ptr noundef, ptr noundef) local_unnamed_addr #1

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

declare i32 @json_object_set_string(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

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

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

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

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

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

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

declare void @asn_free(ptr noundef, ptr noundef) local_unnamed_addr #1

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN7UapkiNS15ExtensionHelper18DecodeToJsonObject19certificatePoliciesEPK12ByteArray_stP13json_object_t(ptr noundef %0, ptr noundef %1) local_unnamed_addr #3 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.std::__cxx11::basic_string", align 8
  %4 = alloca %"class.std::__cxx11::basic_string", align 8
  %5 = alloca %"class.std::__cxx11::basic_string", align 8
  %6 = alloca %"class.UapkiNS::SmartBA", align 8
  %7 = tail call ptr @get_CertificatePolicies_desc()
  %8 = tail call ptr @asn_decode_ba_with_alloc(ptr noundef %7, ptr noundef %0)
  %9 = icmp eq ptr %8, null
  br i1 %9, label %10, label %11

10:                                               ; preds = %2
  tail call void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 309, i32 noundef 2)
  br label %113

11:                                               ; preds = %2
  %12 = tail call ptr @json_value_init_array()
  %13 = tail call i32 @json_object_set_value(ptr noundef %1, ptr noundef nonnull @.str.12, ptr noundef %12)
  %.not = icmp eq i32 %13, 0
  br i1 %.not, label %14, label %113

14:                                               ; preds = %11
  %15 = tail call ptr @json_object_get_array(ptr noundef %1, ptr noundef nonnull @.str.12)
  %16 = getelementptr inbounds i8, ptr %8, i64 8
  %17 = load i32, ptr %16, align 8, !tbaa !5
  %18 = icmp sgt i32 %17, 0
  br i1 %18, label %.lr.ph117, label %._crit_edge

19:                                               ; preds = %.thread90
  %indvars.iv.next132 = add nuw nsw i64 %indvars.iv131, 1
  %20 = load i32, ptr %16, align 8, !tbaa !5
  %21 = sext i32 %20 to i64
  %22 = icmp slt i64 %indvars.iv.next132, %21
  br i1 %22, label %.lr.ph117, label %._crit_edge.loopexit, !llvm.loop !15

.lr.ph117:                                        ; preds = %14, %19
  %indvars.iv131 = phi i64 [ %indvars.iv.next132, %19 ], [ 0, %14 ]
  %23 = call ptr @json_value_init_object()
  %24 = call i32 @json_array_append_value(ptr noundef %15, ptr noundef %23)
  %.not71 = icmp eq i32 %24, 0
  br i1 %.not71, label %25, label %._crit_edge.loopexit

25:                                               ; preds = %.lr.ph117
  %26 = call ptr @json_array_get_object(ptr noundef %15, i64 noundef %indvars.iv131)
  %27 = load ptr, ptr %8, align 8, !tbaa !17
  %28 = getelementptr inbounds ptr, ptr %27, i64 %indvars.iv131
  %29 = load ptr, ptr %28, align 8, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %3) #5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #5
  call void @_ZN7UapkiNS7SmartBAC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6)
  %30 = invoke noundef i32 @_ZN7UapkiNS4Util11oidFromAsn1EPK21ASN__PRIMITIVE_TYPE_sRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef %29, ptr noundef nonnull align 8 dereferenceable(32) %3)
          to label %31 unwind label %33

31:                                               ; preds = %25
  %.not72 = icmp eq i32 %30, 0
  br i1 %.not72, label %35, label %32

32:                                               ; preds = %31
  invoke void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 321, i32 noundef %30)
          to label %.thread90 unwind label %33

33:                                               ; preds = %47, %44, %42, %35, %32, %25
  %34 = landingpad { ptr, i32 }
          cleanup
  br label %110

35:                                               ; preds = %31
  %36 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %3) #5
  %37 = invoke i32 @json_object_set_string(ptr noundef %26, ptr noundef nonnull @.str.13, ptr noundef %36)
          to label %38 unwind label %33

38:                                               ; preds = %35
  %.not73 = icmp eq i32 %37, 0
  br i1 %.not73, label %39, label %.thread90

39:                                               ; preds = %38
  %40 = getelementptr inbounds i8, ptr %29, i64 16
  %41 = load ptr, ptr %40, align 8, !tbaa !19
  %.not74 = icmp eq ptr %41, null
  br i1 %.not74, label %.thread90, label %42

42:                                               ; preds = %39
  %43 = invoke ptr @json_value_init_array()
          to label %44 unwind label %33

44:                                               ; preds = %42
  %45 = invoke i32 @json_object_set_value(ptr noundef %26, ptr noundef nonnull @.str.14, ptr noundef %43)
          to label %46 unwind label %33

46:                                               ; preds = %44
  %.not75 = icmp eq i32 %45, 0
  br i1 %.not75, label %47, label %.thread90

47:                                               ; preds = %46
  %48 = invoke ptr @json_object_get_array(ptr noundef %26, ptr noundef nonnull @.str.14)
          to label %.preheader unwind label %33

.preheader:                                       ; preds = %47
  %49 = load ptr, ptr %40, align 8, !tbaa !19
  %50 = getelementptr inbounds i8, ptr %49, i64 8
  %51 = load i32, ptr %50, align 8, !tbaa !22
  %52 = icmp sgt i32 %51, 0
  br i1 %52, label %.lr.ph, label %.thread90

.lr.ph:                                           ; preds = %.preheader, %104
  %indvars.iv = phi i64 [ %indvars.iv.next, %104 ], [ 0, %.preheader ]
  %53 = invoke ptr @json_value_init_object()
          to label %54 unwind label %57

54:                                               ; preds = %.lr.ph
  %55 = invoke i32 @json_array_append_value(ptr noundef %48, ptr noundef %53)
          to label %56 unwind label %57

56:                                               ; preds = %54
  %.not76 = icmp eq i32 %55, 0
  br i1 %.not76, label %59, label %.thread90

57:                                               ; preds = %54, %.lr.ph
  %58 = landingpad { ptr, i32 }
          cleanup
  br label %110

59:                                               ; preds = %56
  %60 = invoke ptr @json_array_get_object(ptr noundef %48, i64 noundef %indvars.iv)
          to label %61 unwind label %69

61:                                               ; preds = %59
  %62 = load ptr, ptr %40, align 8, !tbaa !19
  %63 = load ptr, ptr %62, align 8, !tbaa !25
  %64 = getelementptr inbounds ptr, ptr %63, i64 %indvars.iv
  %65 = load ptr, ptr %64, align 8, !tbaa !18
  %66 = invoke noundef i32 @_ZN7UapkiNS4Util11oidFromAsn1EPK21ASN__PRIMITIVE_TYPE_sRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef %65, ptr noundef nonnull align 8 dereferenceable(32) %4)
          to label %67 unwind label %.loopexit

67:                                               ; preds = %61
  %.not77 = icmp eq i32 %66, 0
  br i1 %.not77, label %71, label %68

68:                                               ; preds = %67
  invoke void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 333, i32 noundef %66)
          to label %.thread90 unwind label %.loopexit.split-lp

69:                                               ; preds = %59
  %70 = landingpad { ptr, i32 }
          cleanup
  br label %110

.loopexit:                                        ; preds = %61, %71, %75, %85, %90, %95, %100
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %110

.loopexit.split-lp:                               ; preds = %68, %84, %89, %99
  %lpad.loopexit.split-lp = landingpad { ptr, i32 }
          cleanup
  br label %110

71:                                               ; preds = %67
  %72 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %4) #5
  %73 = invoke i32 @json_object_set_string(ptr noundef %60, ptr noundef nonnull @.str.15, ptr noundef %72)
          to label %74 unwind label %.loopexit

74:                                               ; preds = %71
  %.not78 = icmp eq i32 %73, 0
  br i1 %.not78, label %75, label %.thread90

75:                                               ; preds = %74
  %76 = getelementptr inbounds i8, ptr %65, i64 16
  %77 = load ptr, ptr %76, align 8, !tbaa !26
  %78 = getelementptr inbounds i8, ptr %65, i64 24
  %79 = load i32, ptr %78, align 8, !tbaa !29
  %80 = sext i32 %79 to i64
  %81 = invoke ptr @ba_alloc_from_uint8(ptr noundef %77, i64 noundef %80)
          to label %82 unwind label %.loopexit

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

84:                                               ; preds = %82
  invoke void @stacktrace_create(ptr noundef nonnull @.str, i64 noundef 337, i32 noundef 4097, ptr noundef null)
          to label %.thread90 unwind label %.loopexit.split-lp

85:                                               ; preds = %82
  %86 = call noundef ptr @_ZNK7UapkiNS7SmartBA3getEv(ptr noundef nonnull align 8 dereferenceable(8) %6)
  %87 = invoke i32 @json_object_set_base64(ptr noundef %60, ptr noundef nonnull @.str.16, ptr noundef %86)
          to label %88 unwind label %.loopexit

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

89:                                               ; preds = %88
  invoke void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 340, i32 noundef %87)
          to label %.thread90 unwind label %.loopexit.split-lp

90:                                               ; preds = %88
  %91 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %4) #5
  %92 = load ptr, ptr @OID_PKIX_PqiCps, align 8, !tbaa !18
  %93 = invoke zeroext i1 @oid_is_equal(ptr noundef %91, ptr noundef %92)
          to label %94 unwind label %.loopexit

94:                                               ; preds = %90
  br i1 %93, label %95, label %104

95:                                               ; preds = %94
  %96 = call noundef ptr @_ZNK7UapkiNS7SmartBA3getEv(ptr noundef nonnull align 8 dereferenceable(8) %6)
  %97 = invoke noundef i32 @_ZN7UapkiNS4Util15decodeAnyStringEPK12ByteArray_stRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef %96, ptr noundef nonnull align 8 dereferenceable(32) %5)
          to label %98 unwind label %.loopexit

98:                                               ; preds = %95
  %.not80 = icmp eq i32 %97, 0
  br i1 %.not80, label %100, label %99

99:                                               ; preds = %98
  invoke void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 342, i32 noundef %97)
          to label %.thread90 unwind label %.loopexit.split-lp

100:                                              ; preds = %98
  %101 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %5) #5
  %102 = invoke i32 @json_object_set_string(ptr noundef %60, ptr noundef nonnull @.str.17, ptr noundef %101)
          to label %103 unwind label %.loopexit

103:                                              ; preds = %100
  %.not81 = icmp eq i32 %102, 0
  br i1 %.not81, label %104, label %.thread90

104:                                              ; preds = %94, %103
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %105 = load ptr, ptr %40, align 8, !tbaa !19
  %106 = getelementptr inbounds i8, ptr %105, i64 8
  %107 = load i32, ptr %106, align 8, !tbaa !22
  %108 = sext i32 %107 to i64
  %109 = icmp slt i64 %indvars.iv.next, %108
  br i1 %109, label %.lr.ph, label %.thread90, !llvm.loop !30

.thread90:                                        ; preds = %104, %56, %74, %103, %.preheader, %99, %89, %84, %68, %39, %46, %38, %32
  %cond = phi i1 [ false, %32 ], [ false, %38 ], [ false, %46 ], [ true, %39 ], [ false, %68 ], [ false, %84 ], [ false, %89 ], [ false, %99 ], [ true, %.preheader ], [ true, %104 ], [ false, %56 ], [ false, %74 ], [ false, %103 ]
  %.260 = phi i32 [ 4, %32 ], [ 4, %38 ], [ 4, %46 ], [ 0, %39 ], [ 4, %68 ], [ 4, %84 ], [ 4, %89 ], [ 4, %99 ], [ 0, %.preheader ], [ 0, %104 ], [ 4, %56 ], [ 4, %74 ], [ 4, %103 ]
  %.6 = phi i32 [ %30, %32 ], [ 4113, %38 ], [ 4113, %46 ], [ 0, %39 ], [ %66, %68 ], [ 4097, %84 ], [ %87, %89 ], [ %97, %99 ], [ 0, %.preheader ], [ 0, %104 ], [ 4113, %56 ], [ 4113, %74 ], [ 4113, %103 ]
  call void @_ZN7UapkiNS7SmartBAD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #5
  br i1 %cond, label %19, label %._crit_edge.loopexit

110:                                              ; preds = %.loopexit, %.loopexit.split-lp, %57, %69, %33
  %.pn84 = phi { ptr, i32 } [ %34, %33 ], [ %58, %57 ], [ %70, %69 ], [ %lpad.loopexit, %.loopexit ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ]
  call void @_ZN7UapkiNS7SmartBAD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #5
  resume { ptr, i32 } %.pn84

._crit_edge.loopexit:                             ; preds = %.lr.ph117, %19, %.thread90
  %.361.ph = phi i32 [ %.260, %.thread90 ], [ 5, %19 ], [ 4, %.lr.ph117 ]
  %.7.ph = phi i32 [ %.6, %.thread90 ], [ %.6, %19 ], [ 4113, %.lr.ph117 ]
  %111 = and i32 %.361.ph, -2
  %112 = icmp eq i32 %111, 4
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %14
  %.361 = phi i1 [ true, %14 ], [ %112, %._crit_edge.loopexit ]
  %.7 = phi i32 [ 0, %14 ], [ %.7.ph, %._crit_edge.loopexit ]
  call void @llvm.assume(i1 %.361)
  br label %113

113:                                              ; preds = %._crit_edge, %11, %10
  %.8 = phi i32 [ 2, %10 ], [ %.7, %._crit_edge ], [ 4113, %11 ]
  %114 = call ptr @get_CertificatePolicies_desc()
  call void @asn_free(ptr noundef %114, ptr noundef %8)
  ret i32 %.8
}

declare ptr @get_CertificatePolicies_desc() local_unnamed_addr #1

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

declare ptr @ba_alloc_from_uint8(ptr noundef, i64 noundef) local_unnamed_addr #1

declare noundef i32 @_ZN7UapkiNS4Util15decodeAnyStringEPK12ByteArray_stRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef, ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #1

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write)
declare void @llvm.assume(i1 noundef) #4

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 #4 = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) }
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, !11, i64 8}
!6 = !{!"_ZTS19CertificatePolicies", !7, i64 0, !12, i64 24}
!7 = !{!"_ZTSN19CertificatePoliciesUt_E", !8, i64 0, !11, i64 8, !11, i64 12, !8, i64 16}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"int", !9, i64 0}
!12 = !{!"_ZTS16asn_struct_ctx_s", !13, i64 0, !13, i64 2, !11, i64 4, !8, i64 8, !14, i64 16}
!13 = !{!"short", !9, i64 0}
!14 = !{!"long", !9, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = !{!6, !8, i64 0}
!18 = !{!8, !8, i64 0}
!19 = !{!20, !8, i64 16}
!20 = !{!"_ZTS17PolicyInformation", !21, i64 0, !8, i64 16, !12, i64 24}
!21 = !{!"_ZTS21ASN__PRIMITIVE_TYPE_s", !8, i64 0, !11, i64 8}
!22 = !{!23, !11, i64 8}
!23 = !{!"_ZTSN17PolicyInformation16policyQualifiersE", !24, i64 0, !12, i64 24}
!24 = !{!"_ZTSN17PolicyInformation16policyQualifiersUt_E", !8, i64 0, !11, i64 8, !11, i64 12, !8, i64 16}
!25 = !{!23, !8, i64 0}
!26 = !{!27, !8, i64 16}
!27 = !{!"_ZTS19PolicyQualifierInfo", !21, i64 0, !28, i64 16, !12, i64 56}
!28 = !{!"_ZTS3ANY", !8, i64 0, !11, i64 8, !12, i64 16}
!29 = !{!27, !11, i64 24}
!30 = distinct !{!30, !16}


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