; LLVM IR from specinfo-ua/UAPKI :: library/uapki/src (store-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.CrlIdentifier = type { %struct.Name, %struct.OCTET_STRING, ptr, %struct.asn_struct_ctx_s }
%struct.Name = type { i32, %"union.Name::Name_u", %struct.asn_struct_ctx_s }
%"union.Name::Name_u" = type { %struct.RDNSequence }
%struct.RDNSequence = type { %struct.anon, %struct.asn_struct_ctx_s }
%struct.anon = type { ptr, i32, i32, ptr }
%struct.OCTET_STRING = type { ptr, i32, %struct.asn_struct_ctx_s }
%struct.asn_struct_ctx_s = type { i16, i16, i32, ptr, i64 }

@.str.3 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.40 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.41 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.42 = external hidden unnamed_addr constant [10 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

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.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

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

declare ptr @json_value_init_object() #1

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

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

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

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

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

declare void @_ZN8TimeUtil12mtimeToFtimeB5cxx11Emb(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8, i64 noundef, i1 noundef zeroext) #1

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN7UapkiNS3Crl19crlIdentifierToJsonEP13json_object_tPK12ByteArray_st(ptr noundef %0, ptr noundef %1) #2 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 i64, align 8
  %9 = alloca %"class.std::__cxx11::basic_string", align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca %"class.UapkiNS::SmartBA", align 8
  %13 = alloca i32, align 4
  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 i64 0, ptr %8, align 8, !tbaa !11
  br label %14

14:                                               ; preds = %2
  %15 = call ptr @get_CrlIdentifier_desc()
  %16 = load ptr, ptr %5, align 8, !tbaa !5
  %17 = call ptr @asn_decode_ba_with_alloc(ptr noundef %15, ptr noundef %16)
  store ptr %17, ptr %7, align 8, !tbaa !5
  %18 = icmp eq ptr null, %17
  br i1 %18, label %19, label %21

19:                                               ; preds = %14
  store i32 2, ptr %6, align 4, !tbaa !9
  %20 = load i32, ptr %6, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str.3, i64 noundef 483, i32 noundef %20)
  br label %109

21:                                               ; preds = %14
  br label %22

22:                                               ; preds = %21
  br label %23

23:                                               ; preds = %22
  %24 = load ptr, ptr %4, align 8, !tbaa !5
  %25 = call ptr @json_value_init_object()
  %26 = call i32 @json_object_set_value(ptr noundef %24, ptr noundef @.str.40, ptr noundef %25)
  %27 = icmp ne i32 %26, 0
  br i1 %27, label %28, label %29

28:                                               ; preds = %23
  store i32 4113, ptr %6, align 4, !tbaa !9
  br label %109

29:                                               ; preds = %23
  br label %30

30:                                               ; preds = %29
  %31 = load ptr, ptr %4, align 8, !tbaa !5
  %32 = call ptr @json_object_get_object(ptr noundef %31, ptr noundef @.str.40)
  %33 = load ptr, ptr %7, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.CrlIdentifier, ptr %33, i32 0, i32 0
  %35 = call noundef i32 @_ZN7UapkiNS10nameToJsonEP13json_object_tRK4Name(ptr noundef %32, ptr noundef nonnull align 8 dereferenceable(80) %34)
  store i32 %35, ptr %6, align 4, !tbaa !9
  %36 = load i32, ptr %6, align 4, !tbaa !9
  %37 = icmp ne i32 %36, 0
  br i1 %37, label %38, label %40

38:                                               ; preds = %30
  %39 = load i32, ptr %6, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str.3, i64 noundef 487, i32 noundef %39)
  br label %109

40:                                               ; preds = %30
  br label %41

41:                                               ; preds = %40
  br label %42

42:                                               ; preds = %41
  br label %43

43:                                               ; preds = %42
  %44 = load ptr, ptr %7, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.CrlIdentifier, ptr %44, i32 0, i32 1
  %46 = call noundef i32 @_ZN7UapkiNS4Util15utcTimeFromAsn1EPK12OCTET_STRINGRm(ptr noundef %45, ptr noundef nonnull align 8 dereferenceable(8) %8)
  store i32 %46, ptr %6, align 4, !tbaa !9
  %47 = load i32, ptr %6, align 4, !tbaa !9
  %48 = icmp ne i32 %47, 0
  br i1 %48, label %49, label %51

49:                                               ; preds = %43
  %50 = load i32, ptr %6, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str.3, i64 noundef 489, i32 noundef %50)
  br label %109

51:                                               ; preds = %43
  br label %52

52:                                               ; preds = %51
  br label %53

53:                                               ; preds = %52
  %54 = load ptr, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr %9) #4
  %55 = load i64, ptr %8, align 8, !tbaa !11
  call void @_ZN8TimeUtil12mtimeToFtimeB5cxx11Emb(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %9, i64 noundef %55, i1 noundef zeroext false)
  %56 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %9) #4
  %57 = invoke i32 @json_object_set_string(ptr noundef %54, ptr noundef @.str.41, ptr noundef %56)
          to label %58 unwind label %61

58:                                               ; preds = %53
  %59 = icmp ne i32 %57, 0
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %9) #4
  br i1 %59, label %60, label %65

60:                                               ; preds = %58
  store i32 4113, ptr %6, align 4, !tbaa !9
  br label %109

61:                                               ; preds = %53
  %62 = landingpad { ptr, i32 }
          cleanup
  %63 = extractvalue { ptr, i32 } %62, 0
  store ptr %63, ptr %10, align 8
  %64 = extractvalue { ptr, i32 } %62, 1
  store i32 %64, ptr %11, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %9) #4
  br label %115

65:                                               ; preds = %58
  %66 = load ptr, ptr %7, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.CrlIdentifier, ptr %66, i32 0, i32 2
  %68 = load ptr, ptr %67, align 8, !tbaa !13
  %69 = icmp ne ptr %68, null
  br i1 %69, label %70, label %108

70:                                               ; preds = %65
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  call void @_ZN7UapkiNS7SmartBAC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %12)
  br label %71

71:                                               ; preds = %70
  %72 = load ptr, ptr %7, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.CrlIdentifier, ptr %72, i32 0, i32 2
  %74 = load ptr, ptr %73, align 8, !tbaa !13
  %75 = invoke noundef ptr @_ZN7UapkiNS7SmartBAadEv(ptr noundef nonnull align 8 dereferenceable(8) %12)
          to label %76 unwind label %84

76:                                               ; preds = %71
  %77 = invoke i32 @asn_INTEGER2ba(ptr noundef %74, ptr noundef %75)
          to label %78 unwind label %84

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

81:                                               ; preds = %78
  %82 = load i32, ptr %6, align 4, !tbaa !9
  invoke void @stacktrace_add(ptr noundef @.str.3, i64 noundef 494, i32 noundef %82)
          to label %83 unwind label %84

83:                                               ; preds = %81
  store i32 4, ptr %13, align 4
  br label %105

84:                                               ; preds = %99, %94, %91, %81, %76, %71
  %85 = landingpad { ptr, i32 }
          cleanup
  %86 = extractvalue { ptr, i32 } %85, 0
  store ptr %86, ptr %10, align 8
  %87 = extractvalue { ptr, i32 } %85, 1
  store i32 %87, ptr %11, align 4
  call void @_ZN7UapkiNS7SmartBAD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  br label %115

88:                                               ; preds = %78
  br label %89

89:                                               ; preds = %88
  br label %90

90:                                               ; preds = %89
  br label %91

91:                                               ; preds = %90
  %92 = load ptr, ptr %4, align 8, !tbaa !5
  %93 = invoke noundef ptr @_ZNK7UapkiNS7SmartBA3getEv(ptr noundef nonnull align 8 dereferenceable(8) %12)
          to label %94 unwind label %84

94:                                               ; preds = %91
  %95 = invoke i32 @json_object_set_hex(ptr noundef %92, ptr noundef @.str.42, ptr noundef %93)
          to label %96 unwind label %84

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

99:                                               ; preds = %96
  %100 = load i32, ptr %6, align 4, !tbaa !9
  invoke void @stacktrace_add(ptr noundef @.str.3, i64 noundef 495, i32 noundef %100)
          to label %101 unwind label %84

101:                                              ; preds = %99
  store i32 4, ptr %13, align 4
  br label %105

102:                                              ; preds = %96
  br label %103

103:                                              ; preds = %102
  br label %104

104:                                              ; preds = %103
  store i32 0, ptr %13, align 4
  br label %105

105:                                              ; preds = %104, %101, %83
  call void @_ZN7UapkiNS7SmartBAD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  %106 = load i32, ptr %13, align 4
  switch i32 %106, label %113 [
    i32 0, label %107
    i32 4, label %109
  ]

107:                                              ; preds = %105
  br label %108

108:                                              ; preds = %107, %65
  br label %109

109:                                              ; preds = %108, %105, %60, %49, %38, %28, %19
  %110 = call ptr @get_CrlIdentifier_desc()
  %111 = load ptr, ptr %7, align 8, !tbaa !5
  call void @asn_free(ptr noundef %110, ptr noundef %111)
  %112 = load i32, ptr %6, align 4, !tbaa !9
  store i32 %112, ptr %3, align 4
  store i32 1, ptr %13, align 4
  br label %113

113:                                              ; preds = %109, %105
  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
  %114 = load i32, ptr %3, align 4
  ret i32 %114

115:                                              ; preds = %84, %61
  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 %116

116:                                              ; preds = %115
  %117 = load ptr, ptr %10, align 8
  %118 = load i32, ptr %11, align 4
  %119 = insertvalue { ptr, i32 } poison, ptr %117, 0
  %120 = insertvalue { ptr, i32 } %119, i32 %118, 1
  resume { ptr, i32 } %120
}

declare ptr @get_CrlIdentifier_desc() #1

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

declare i32 @asn_INTEGER2ba(ptr noundef, ptr noundef) #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 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 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 = !{!"long", !7, i64 0}
!13 = !{!14, !6, i64 120}
!14 = !{!"_ZTS13CrlIdentifier", !15, i64 0, !19, i64 80, !6, i64 120, !17, i64 128}
!15 = !{!"_ZTS4Name", !16, i64 0, !7, i64 8, !17, i64 56}
!16 = !{!"_ZTS7Name_PR", !7, i64 0}
!17 = !{!"_ZTS16asn_struct_ctx_s", !18, i64 0, !18, i64 2, !10, i64 4, !6, i64 8, !12, i64 16}
!18 = !{!"short", !7, i64 0}
!19 = !{!"_ZTS12OCTET_STRING", !6, i64 0, !10, i64 8, !17, i64 16}


; 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.3 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.40 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.41 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.42 = external hidden unnamed_addr constant [10 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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.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

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

declare i32 @json_object_set_hex(ptr noundef, ptr noundef, ptr 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_object() local_unnamed_addr #1

declare ptr @json_object_get_object(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 #3 align 2

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

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

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

declare void @_ZN8TimeUtil12mtimeToFtimeB5cxx11Emb(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8, i64 noundef, i1 noundef zeroext) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN7UapkiNS3Crl19crlIdentifierToJsonEP13json_object_tPK12ByteArray_st(ptr noundef %0, ptr noundef %1) local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %3 = alloca i64, align 8
  %4 = alloca %"class.std::__cxx11::basic_string", align 8
  %5 = alloca %"class.UapkiNS::SmartBA", align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #4
  store i64 0, ptr %3, align 8, !tbaa !5
  %6 = tail call ptr @get_CrlIdentifier_desc()
  %7 = tail call ptr @asn_decode_ba_with_alloc(ptr noundef %6, ptr noundef %1)
  %8 = icmp eq ptr %7, null
  br i1 %8, label %9, label %10

9:                                                ; preds = %2
  tail call void @stacktrace_add(ptr noundef nonnull @.str.3, i64 noundef 483, i32 noundef 2)
  br label %45

10:                                               ; preds = %2
  %11 = tail call ptr @json_value_init_object()
  %12 = tail call i32 @json_object_set_value(ptr noundef %0, ptr noundef nonnull @.str.40, ptr noundef %11)
  %.not = icmp eq i32 %12, 0
  br i1 %.not, label %13, label %45

13:                                               ; preds = %10
  %14 = tail call ptr @json_object_get_object(ptr noundef %0, ptr noundef nonnull @.str.40)
  %15 = tail call noundef i32 @_ZN7UapkiNS10nameToJsonEP13json_object_tRK4Name(ptr noundef %14, ptr noundef nonnull align 8 dereferenceable(80) %7)
  %.not34 = icmp eq i32 %15, 0
  br i1 %.not34, label %17, label %16

16:                                               ; preds = %13
  tail call void @stacktrace_add(ptr noundef nonnull @.str.3, i64 noundef 487, i32 noundef %15)
  br label %45

17:                                               ; preds = %13
  %18 = getelementptr inbounds i8, ptr %7, i64 80
  %19 = call noundef i32 @_ZN7UapkiNS4Util15utcTimeFromAsn1EPK12OCTET_STRINGRm(ptr noundef nonnull %18, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %.not35 = icmp eq i32 %19, 0
  br i1 %.not35, label %21, label %20

20:                                               ; preds = %17
  call void @stacktrace_add(ptr noundef nonnull @.str.3, i64 noundef 489, i32 noundef %19)
  br label %45

21:                                               ; preds = %17
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #4
  %22 = load i64, ptr %3, align 8, !tbaa !5
  call void @_ZN8TimeUtil12mtimeToFtimeB5cxx11Emb(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %4, i64 noundef %22, i1 noundef zeroext false)
  %23 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %4) #4
  %24 = invoke i32 @json_object_set_string(ptr noundef %0, ptr noundef nonnull @.str.41, ptr noundef %23)
          to label %25 unwind label %26

25:                                               ; preds = %21
  %.not36 = icmp eq i32 %24, 0
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #4
  br i1 %.not36, label %28, label %45

26:                                               ; preds = %21
  %27 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #4
  br label %47

28:                                               ; preds = %25
  %29 = getelementptr inbounds i8, ptr %7, i64 120
  %30 = load ptr, ptr %29, align 8, !tbaa !9
  %.not37 = icmp eq ptr %30, null
  br i1 %.not37, label %45, label %31

31:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #4
  call void @_ZN7UapkiNS7SmartBAC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5)
  %32 = load ptr, ptr %29, align 8, !tbaa !9
  %33 = call noundef ptr @_ZN7UapkiNS7SmartBAadEv(ptr noundef nonnull align 8 dereferenceable(8) %5)
  %34 = invoke i32 @asn_INTEGER2ba(ptr noundef %32, ptr noundef %33)
          to label %35 unwind label %37

35:                                               ; preds = %31
  %.not38 = icmp eq i32 %34, 0
  br i1 %.not38, label %39, label %36

36:                                               ; preds = %35
  invoke void @stacktrace_add(ptr noundef nonnull @.str.3, i64 noundef 494, i32 noundef %34)
          to label %44 unwind label %37

37:                                               ; preds = %43, %39, %36, %31
  %38 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN7UapkiNS7SmartBAD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #4
  br label %47

39:                                               ; preds = %35
  %40 = call noundef ptr @_ZNK7UapkiNS7SmartBA3getEv(ptr noundef nonnull align 8 dereferenceable(8) %5)
  %41 = invoke i32 @json_object_set_hex(ptr noundef %0, ptr noundef nonnull @.str.42, ptr noundef %40)
          to label %42 unwind label %37

42:                                               ; preds = %39
  %.not39 = icmp eq i32 %41, 0
  br i1 %.not39, label %44, label %43

43:                                               ; preds = %42
  invoke void @stacktrace_add(ptr noundef nonnull @.str.3, i64 noundef 495, i32 noundef %41)
          to label %44 unwind label %37

44:                                               ; preds = %42, %43, %36
  %.025 = phi i32 [ %34, %36 ], [ %41, %43 ], [ 0, %42 ]
  call void @_ZN7UapkiNS7SmartBAD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #4
  br label %45

45:                                               ; preds = %44, %25, %10, %28, %20, %16, %9
  %.1 = phi i32 [ 2, %9 ], [ %15, %16 ], [ %19, %20 ], [ %.025, %44 ], [ 0, %28 ], [ 4113, %10 ], [ 4113, %25 ]
  %46 = call ptr @get_CrlIdentifier_desc()
  call void @asn_free(ptr noundef %46, ptr noundef %7)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #4
  ret i32 %.1

47:                                               ; preds = %37, %26
  %.pn = phi { ptr, i32 } [ %38, %37 ], [ %27, %26 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #4
  resume { ptr, i32 } %.pn
}

declare ptr @get_CrlIdentifier_desc() local_unnamed_addr #1

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

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

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 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 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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !16, i64 120}
!10 = !{!"_ZTS13CrlIdentifier", !11, i64 0, !17, i64 80, !16, i64 120, !13, i64 128}
!11 = !{!"_ZTS4Name", !12, i64 0, !7, i64 8, !13, i64 56}
!12 = !{!"_ZTS7Name_PR", !7, i64 0}
!13 = !{!"_ZTS16asn_struct_ctx_s", !14, i64 0, !14, i64 2, !15, i64 4, !16, i64 8, !6, i64 16}
!14 = !{!"short", !7, i64 0}
!15 = !{!"int", !7, i64 0}
!16 = !{!"any pointer", !7, i64 0}
!17 = !{!"_ZTS12OCTET_STRING", !16, i64 0, !15, i64 8, !13, i64 16}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,SimplifyCFGPass,TailCallElimPass