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

%struct.Certificate = type { %struct.TBSCertificate, %struct.AlgorithmIdentifier, %struct.BIT_STRING_s, %struct.asn_struct_ctx_s }
%struct.TBSCertificate = type { ptr, %struct.ASN__PRIMITIVE_TYPE_s, %struct.AlgorithmIdentifier, %struct.Name, %struct.Validity, %struct.Name, %struct.SubjectPublicKeyInfo, ptr, ptr, ptr, %struct.asn_struct_ctx_s }
%struct.ASN__PRIMITIVE_TYPE_s = type { ptr, i32 }
%struct.Validity = type { %struct.PKIXTime, %struct.PKIXTime, %struct.asn_struct_ctx_s }
%struct.PKIXTime = type { i32, %"union.PKIXTime::PKIXTime_u", %struct.asn_struct_ctx_s }
%"union.PKIXTime::PKIXTime_u" = type { %struct.OCTET_STRING }
%struct.OCTET_STRING = type { ptr, i32, %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.SubjectPublicKeyInfo = type { %struct.AlgorithmIdentifier, %struct.BIT_STRING_s, %struct.asn_struct_ctx_s }
%struct.AlgorithmIdentifier = type { %struct.ASN__PRIMITIVE_TYPE_s, ptr, %struct.asn_struct_ctx_s }
%struct.BIT_STRING_s = type { ptr, i32, 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.5 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [11 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 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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN7UapkiNS4Cert16detailInfoToJsonEP13json_object_tPKNS0_7CerItemE(ptr noundef %0, ptr noundef %1) #2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca i8, align 1
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  store i32 0, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  %9 = load ptr, ptr %4, align 8, !tbaa !5
  %10 = call noundef ptr @_ZNK7UapkiNS4Cert7CerItem7getCertEv(ptr noundef nonnull align 8 dereferenceable(401) %9)
  %11 = getelementptr inbounds %struct.Certificate, ptr %10, i32 0, i32 0
  store ptr %11, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  store i64 0, ptr %7, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 1, ptr %8) #4
  store i8 0, ptr %8, align 1, !tbaa !13
  %12 = load ptr, ptr %6, align 8, !tbaa !5
  %13 = getelementptr inbounds %struct.TBSCertificate, ptr %12, i32 0, i32 0
  %14 = load ptr, ptr %13, align 8, !tbaa !15
  %15 = icmp ne ptr %14, null
  br i1 %15, label %16, label %29

16:                                               ; preds = %2
  br label %17

17:                                               ; preds = %16
  %18 = load ptr, ptr %6, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.TBSCertificate, ptr %18, i32 0, i32 0
  %20 = load ptr, ptr %19, align 8, !tbaa !15
  %21 = call i32 @asn_INTEGER2long(ptr noundef %20, ptr noundef %7)
  store i32 %21, ptr %5, align 4, !tbaa !9
  %22 = load i32, ptr %5, align 4, !tbaa !9
  %23 = icmp ne i32 %22, 0
  br i1 %23, label %24, label %26

24:                                               ; preds = %17
  %25 = load i32, ptr %5, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str.3, i64 noundef 243, i32 noundef %25)
  br label %166

26:                                               ; preds = %17
  br label %27

27:                                               ; preds = %26
  br label %28

28:                                               ; preds = %27
  br label %29

29:                                               ; preds = %28, %2
  %30 = load ptr, ptr %3, align 8, !tbaa !5
  %31 = load i64, ptr %7, align 8, !tbaa !11
  %32 = trunc i64 %31 to i32
  %33 = add nsw i32 %32, 1
  %34 = call noundef i32 @_ZN12ParsonHelper18jsonObjectSetInt32EP13json_object_tPKci(ptr noundef %30, ptr noundef @.str.5, i32 noundef %33)
  %35 = icmp ne i32 %34, 0
  br i1 %35, label %36, label %37

36:                                               ; preds = %29
  store i32 4113, ptr %5, align 4, !tbaa !9
  br label %166

37:                                               ; preds = %29
  br label %38

38:                                               ; preds = %37
  %39 = load ptr, ptr %3, align 8, !tbaa !5
  %40 = load ptr, ptr %4, align 8, !tbaa !5
  %41 = call noundef ptr @_ZNK7UapkiNS4Cert7CerItem15getSerialNumberEv(ptr noundef nonnull align 8 dereferenceable(401) %40)
  %42 = call i32 @json_object_set_hex(ptr noundef %39, ptr noundef @.str.6, ptr noundef %41)
  store i32 %42, ptr %5, align 4, !tbaa !9
  %43 = load i32, ptr %5, align 4, !tbaa !9
  %44 = icmp ne i32 %43, 0
  br i1 %44, label %45, label %47

45:                                               ; preds = %38
  %46 = load i32, ptr %5, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str.3, i64 noundef 247, i32 noundef %46)
  br label %166

47:                                               ; preds = %38
  br label %48

48:                                               ; preds = %47
  br label %49

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

54:                                               ; preds = %49
  store i32 4113, ptr %5, align 4, !tbaa !9
  br label %166

55:                                               ; preds = %49
  %56 = load ptr, ptr %3, align 8, !tbaa !5
  %57 = call ptr @json_value_init_object()
  %58 = call i32 @json_object_set_value(ptr noundef %56, ptr noundef @.str.8, ptr noundef %57)
  %59 = icmp ne i32 %58, 0
  br i1 %59, label %60, label %61

60:                                               ; preds = %55
  store i32 4113, ptr %5, align 4, !tbaa !9
  br label %166

61:                                               ; preds = %55
  %62 = load ptr, ptr %3, align 8, !tbaa !5
  %63 = call ptr @json_value_init_object()
  %64 = call i32 @json_object_set_value(ptr noundef %62, ptr noundef @.str.9, ptr noundef %63)
  %65 = icmp ne i32 %64, 0
  br i1 %65, label %66, label %67

66:                                               ; preds = %61
  store i32 4113, ptr %5, align 4, !tbaa !9
  br label %166

67:                                               ; preds = %61
  %68 = load ptr, ptr %3, align 8, !tbaa !5
  %69 = call ptr @json_value_init_object()
  %70 = call i32 @json_object_set_value(ptr noundef %68, ptr noundef @.str.10, ptr noundef %69)
  %71 = icmp ne i32 %70, 0
  br i1 %71, label %72, label %73

72:                                               ; preds = %67
  store i32 4113, ptr %5, align 4, !tbaa !9
  br label %166

73:                                               ; preds = %67
  %74 = load ptr, ptr %3, align 8, !tbaa !5
  %75 = call ptr @json_value_init_array()
  %76 = call i32 @json_object_set_value(ptr noundef %74, ptr noundef @.str.11, ptr noundef %75)
  %77 = icmp ne i32 %76, 0
  br i1 %77, label %78, label %79

78:                                               ; preds = %73
  store i32 4113, ptr %5, align 4, !tbaa !9
  br label %166

79:                                               ; preds = %73
  %80 = load ptr, ptr %3, align 8, !tbaa !5
  %81 = call ptr @json_value_init_object()
  %82 = call i32 @json_object_set_value(ptr noundef %80, ptr noundef @.str.12, ptr noundef %81)
  %83 = icmp ne i32 %82, 0
  br i1 %83, label %84, label %85

84:                                               ; preds = %79
  store i32 4113, ptr %5, align 4, !tbaa !9
  br label %166

85:                                               ; preds = %79
  br label %86

86:                                               ; preds = %85
  %87 = load ptr, ptr %3, align 8, !tbaa !5
  %88 = call ptr @json_object_get_object(ptr noundef %87, ptr noundef @.str.7)
  %89 = load ptr, ptr %6, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.TBSCertificate, ptr %89, i32 0, i32 3
  %91 = call noundef i32 @_ZN7UapkiNS10nameToJsonEP13json_object_tRK4Name(ptr noundef %88, ptr noundef nonnull align 8 dereferenceable(80) %90)
  store i32 %91, ptr %5, align 4, !tbaa !9
  %92 = load i32, ptr %5, align 4, !tbaa !9
  %93 = icmp ne i32 %92, 0
  br i1 %93, label %94, label %96

94:                                               ; preds = %86
  %95 = load i32, ptr %5, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str.3, i64 noundef 255, i32 noundef %95)
  br label %166

96:                                               ; preds = %86
  br label %97

97:                                               ; preds = %96
  br label %98

98:                                               ; preds = %97
  br label %99

99:                                               ; preds = %98
  %100 = load ptr, ptr %3, align 8, !tbaa !5
  %101 = load ptr, ptr %4, align 8, !tbaa !5
  %102 = call noundef i32 @_ZN7UapkiNS4Cert14validityToJsonEP13json_object_tPKNS0_7CerItemE(ptr noundef %100, ptr noundef %101)
  store i32 %102, ptr %5, align 4, !tbaa !9
  %103 = load i32, ptr %5, align 4, !tbaa !9
  %104 = icmp ne i32 %103, 0
  br i1 %104, label %105, label %107

105:                                              ; preds = %99
  %106 = load i32, ptr %5, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str.3, i64 noundef 256, i32 noundef %106)
  br label %166

107:                                              ; preds = %99
  br label %108

108:                                              ; preds = %107
  br label %109

109:                                              ; preds = %108
  br label %110

110:                                              ; preds = %109
  %111 = load ptr, ptr %3, align 8, !tbaa !5
  %112 = call ptr @json_object_get_object(ptr noundef %111, ptr noundef @.str.9)
  %113 = load ptr, ptr %6, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.TBSCertificate, ptr %113, i32 0, i32 5
  %115 = call noundef i32 @_ZN7UapkiNS10nameToJsonEP13json_object_tRK4Name(ptr noundef %112, ptr noundef nonnull align 8 dereferenceable(80) %114)
  store i32 %115, ptr %5, align 4, !tbaa !9
  %116 = load i32, ptr %5, align 4, !tbaa !9
  %117 = icmp ne i32 %116, 0
  br i1 %117, label %118, label %120

118:                                              ; preds = %110
  %119 = load i32, ptr %5, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str.3, i64 noundef 257, i32 noundef %119)
  br label %166

120:                                              ; preds = %110
  br label %121

121:                                              ; preds = %120
  br label %122

122:                                              ; preds = %121
  br label %123

123:                                              ; preds = %122
  %124 = load ptr, ptr %3, align 8, !tbaa !5
  %125 = call ptr @json_object_get_object(ptr noundef %124, ptr noundef @.str.10)
  %126 = load ptr, ptr %4, align 8, !tbaa !5
  %127 = call noundef i32 @_ZN7UapkiNS4Cert10spkiToJsonEP13json_object_tPKNS0_7CerItemEb(ptr noundef %125, ptr noundef %126, i1 noundef zeroext true)
  store i32 %127, ptr %5, align 4, !tbaa !9
  %128 = load i32, ptr %5, align 4, !tbaa !9
  %129 = icmp ne i32 %128, 0
  br i1 %129, label %130, label %132

130:                                              ; preds = %123
  %131 = load i32, ptr %5, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str.3, i64 noundef 258, i32 noundef %131)
  br label %166

132:                                              ; preds = %123
  br label %133

133:                                              ; preds = %132
  br label %134

134:                                              ; preds = %133
  br label %135

135:                                              ; preds = %134
  %136 = load ptr, ptr %3, align 8, !tbaa !5
  %137 = call ptr @json_object_get_array(ptr noundef %136, ptr noundef @.str.11)
  %138 = load ptr, ptr %4, align 8, !tbaa !5
  %139 = call noundef i32 @_ZN7UapkiNS4Cert16extensionsToJsonEP12json_array_tPKNS0_7CerItemERb(ptr noundef %137, ptr noundef %138, ptr noundef nonnull align 1 dereferenceable(1) %8)
  store i32 %139, ptr %5, align 4, !tbaa !9
  %140 = load i32, ptr %5, align 4, !tbaa !9
  %141 = icmp ne i32 %140, 0
  br i1 %141, label %142, label %144

142:                                              ; preds = %135
  %143 = load i32, ptr %5, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str.3, i64 noundef 259, i32 noundef %143)
  br label %166

144:                                              ; preds = %135
  br label %145

145:                                              ; preds = %144
  br label %146

146:                                              ; preds = %145
  br label %147

147:                                              ; preds = %146
  %148 = load ptr, ptr %3, align 8, !tbaa !5
  %149 = call ptr @json_object_get_object(ptr noundef %148, ptr noundef @.str.12)
  %150 = load ptr, ptr %4, align 8, !tbaa !5
  %151 = call noundef i32 @_ZN7UapkiNS4Cert19signatureInfoToJsonEP13json_object_tPKNS0_7CerItemE(ptr noundef %149, ptr noundef %150)
  store i32 %151, ptr %5, align 4, !tbaa !9
  %152 = load i32, ptr %5, align 4, !tbaa !9
  %153 = icmp ne i32 %152, 0
  br i1 %153, label %154, label %156

154:                                              ; preds = %147
  %155 = load i32, ptr %5, align 4, !tbaa !9
  call void @stacktrace_add(ptr noundef @.str.3, i64 noundef 260, i32 noundef %155)
  br label %166

156:                                              ; preds = %147
  br label %157

157:                                              ; preds = %156
  br label %158

158:                                              ; preds = %157
  %159 = load ptr, ptr %3, align 8, !tbaa !5
  %160 = load i8, ptr %8, align 1, !tbaa !13, !range !28, !noundef !29
  %161 = trunc i8 %160 to i1
  %162 = call noundef i32 @_ZN12ParsonHelper20jsonObjectSetBooleanEP13json_object_tPKcb(ptr noundef %159, ptr noundef @.str.13, i1 noundef zeroext %161)
  %163 = icmp ne i32 %162, 0
  br i1 %163, label %164, label %165

164:                                              ; preds = %158
  store i32 4113, ptr %5, align 4, !tbaa !9
  br label %166

165:                                              ; preds = %158
  br label %166

166:                                              ; preds = %165, %164, %154, %142, %130, %118, %105, %94, %84, %78, %72, %66, %60, %54, %45, %36, %24
  %167 = load i32, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  ret i32 %167
}

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

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

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

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

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

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

declare ptr @json_value_init_object() #1

declare ptr @json_value_init_array() #1

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN7UapkiNS4Cert14validityToJsonEP13json_object_tPKNS0_7CerItemE(ptr noundef, ptr noundef) #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN7UapkiNS4Cert10spkiToJsonEP13json_object_tPKNS0_7CerItemEb(ptr noundef, ptr noundef, i1 noundef zeroext) #2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN7UapkiNS4Cert19signatureInfoToJsonEP13json_object_tPKNS0_7CerItemE(ptr noundef, ptr noundef) #2

declare noundef i32 @_ZN12ParsonHelper20jsonObjectSetBooleanEP13json_object_tPKcb(ptr noundef, ptr noundef, i1 noundef zeroext) #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, !14, i64 0}
!14 = !{!"bool", !7, i64 0}
!15 = !{!16, !6, i64 0}
!16 = !{!"_ZTS14TBSCertificate", !6, i64 0, !17, i64 8, !18, i64 24, !21, i64 72, !23, i64 152, !21, i64 320, !26, i64 400, !6, i64 512, !6, i64 520, !6, i64 528, !19, i64 536}
!17 = !{!"_ZTS21ASN__PRIMITIVE_TYPE_s", !6, i64 0, !10, i64 8}
!18 = !{!"_ZTS19AlgorithmIdentifier", !17, i64 0, !6, i64 16, !19, i64 24}
!19 = !{!"_ZTS16asn_struct_ctx_s", !20, i64 0, !20, i64 2, !10, i64 4, !6, i64 8, !12, i64 16}
!20 = !{!"short", !7, i64 0}
!21 = !{!"_ZTS4Name", !22, i64 0, !7, i64 8, !19, i64 56}
!22 = !{!"_ZTS7Name_PR", !7, i64 0}
!23 = !{!"_ZTS8Validity", !24, i64 0, !24, i64 72, !19, i64 144}
!24 = !{!"_ZTS8PKIXTime", !25, i64 0, !7, i64 8, !19, i64 48}
!25 = !{!"_ZTS11PKIXTime_PR", !7, i64 0}
!26 = !{!"_ZTS20SubjectPublicKeyInfo", !18, i64 0, !27, i64 48, !19, i64 88}
!27 = !{!"_ZTS12BIT_STRING_s", !6, i64 0, !10, i64 8, !10, i64 12, !19, i64 16}
!28 = !{i8 0, i8 2}
!29 = !{}


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

@.str.3 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [11 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 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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN7UapkiNS4Cert16detailInfoToJsonEP13json_object_tPKNS0_7CerItemE(ptr noundef %0, ptr noundef nonnull %1) local_unnamed_addr #2 {
  %3 = alloca i64, align 8
  %4 = alloca i8, align 1
  %5 = tail call noundef ptr @_ZNK7UapkiNS4Cert7CerItem7getCertEv(ptr noundef nonnull align 8 dereferenceable(401) %1)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #4
  store i64 0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %4) #4
  store i8 0, ptr %4, align 1, !tbaa !9
  %6 = load ptr, ptr %5, align 8, !tbaa !11
  %.not = icmp eq ptr %6, null
  br i1 %.not, label %12, label %7

7:                                                ; preds = %2
  %8 = call i32 @asn_INTEGER2long(ptr noundef nonnull %6, ptr noundef nonnull %3)
  %.not50 = icmp eq i32 %8, 0
  br i1 %.not50, label %._crit_edge, label %11

._crit_edge:                                      ; preds = %7
  %.pre = load i64, ptr %3, align 8, !tbaa !5
  %9 = trunc i64 %.pre to i32
  %10 = add nsw i32 %9, 1
  br label %12

11:                                               ; preds = %7
  call void @stacktrace_add(ptr noundef nonnull @.str.3, i64 noundef 243, i32 noundef %8)
  br label %66

12:                                               ; preds = %._crit_edge, %2
  %13 = phi i32 [ %10, %._crit_edge ], [ 1, %2 ]
  %14 = call noundef i32 @_ZN12ParsonHelper18jsonObjectSetInt32EP13json_object_tPKci(ptr noundef %0, ptr noundef nonnull @.str.5, i32 noundef %13)
  %.not51 = icmp eq i32 %14, 0
  br i1 %.not51, label %15, label %66

15:                                               ; preds = %12
  %16 = call noundef ptr @_ZNK7UapkiNS4Cert7CerItem15getSerialNumberEv(ptr noundef nonnull align 8 dereferenceable(401) %1)
  %17 = call i32 @json_object_set_hex(ptr noundef %0, ptr noundef nonnull @.str.6, ptr noundef %16)
  %.not52 = icmp eq i32 %17, 0
  br i1 %.not52, label %19, label %18

18:                                               ; preds = %15
  call void @stacktrace_add(ptr noundef nonnull @.str.3, i64 noundef 247, i32 noundef %17)
  br label %66

19:                                               ; preds = %15
  %20 = call ptr @json_value_init_object()
  %21 = call i32 @json_object_set_value(ptr noundef %0, ptr noundef nonnull @.str.7, ptr noundef %20)
  %.not53 = icmp eq i32 %21, 0
  br i1 %.not53, label %22, label %66

22:                                               ; preds = %19
  %23 = call ptr @json_value_init_object()
  %24 = call i32 @json_object_set_value(ptr noundef %0, ptr noundef nonnull @.str.8, ptr noundef %23)
  %.not54 = icmp eq i32 %24, 0
  br i1 %.not54, label %25, label %66

25:                                               ; preds = %22
  %26 = call ptr @json_value_init_object()
  %27 = call i32 @json_object_set_value(ptr noundef %0, ptr noundef nonnull @.str.9, ptr noundef %26)
  %.not55 = icmp eq i32 %27, 0
  br i1 %.not55, label %28, label %66

28:                                               ; preds = %25
  %29 = call ptr @json_value_init_object()
  %30 = call i32 @json_object_set_value(ptr noundef %0, ptr noundef nonnull @.str.10, ptr noundef %29)
  %.not56 = icmp eq i32 %30, 0
  br i1 %.not56, label %31, label %66

31:                                               ; preds = %28
  %32 = call ptr @json_value_init_array()
  %33 = call i32 @json_object_set_value(ptr noundef %0, ptr noundef nonnull @.str.11, ptr noundef %32)
  %.not57 = icmp eq i32 %33, 0
  br i1 %.not57, label %34, label %66

34:                                               ; preds = %31
  %35 = call ptr @json_value_init_object()
  %36 = call i32 @json_object_set_value(ptr noundef %0, ptr noundef nonnull @.str.12, ptr noundef %35)
  %.not58 = icmp eq i32 %36, 0
  br i1 %.not58, label %37, label %66

37:                                               ; preds = %34
  %38 = call ptr @json_object_get_object(ptr noundef %0, ptr noundef nonnull @.str.7)
  %39 = getelementptr inbounds i8, ptr %5, i64 72
  %40 = call noundef i32 @_ZN7UapkiNS10nameToJsonEP13json_object_tRK4Name(ptr noundef %38, ptr noundef nonnull align 8 dereferenceable(80) %39)
  %.not59 = icmp eq i32 %40, 0
  br i1 %.not59, label %42, label %41

41:                                               ; preds = %37
  call void @stacktrace_add(ptr noundef nonnull @.str.3, i64 noundef 255, i32 noundef %40)
  br label %66

42:                                               ; preds = %37
  %43 = call noundef i32 @_ZN7UapkiNS4Cert14validityToJsonEP13json_object_tPKNS0_7CerItemE(ptr noundef %0, ptr noundef nonnull %1)
  %.not60 = icmp eq i32 %43, 0
  br i1 %.not60, label %45, label %44

44:                                               ; preds = %42
  call void @stacktrace_add(ptr noundef nonnull @.str.3, i64 noundef 256, i32 noundef %43)
  br label %66

45:                                               ; preds = %42
  %46 = call ptr @json_object_get_object(ptr noundef %0, ptr noundef nonnull @.str.9)
  %47 = getelementptr inbounds i8, ptr %5, i64 320
  %48 = call noundef i32 @_ZN7UapkiNS10nameToJsonEP13json_object_tRK4Name(ptr noundef %46, ptr noundef nonnull align 8 dereferenceable(80) %47)
  %.not61 = icmp eq i32 %48, 0
  br i1 %.not61, label %50, label %49

49:                                               ; preds = %45
  call void @stacktrace_add(ptr noundef nonnull @.str.3, i64 noundef 257, i32 noundef %48)
  br label %66

50:                                               ; preds = %45
  %51 = call ptr @json_object_get_object(ptr noundef %0, ptr noundef nonnull @.str.10)
  %52 = call noundef i32 @_ZN7UapkiNS4Cert10spkiToJsonEP13json_object_tPKNS0_7CerItemEb(ptr noundef %51, ptr noundef nonnull %1, i1 noundef zeroext true)
  %.not62 = icmp eq i32 %52, 0
  br i1 %.not62, label %54, label %53

53:                                               ; preds = %50
  call void @stacktrace_add(ptr noundef nonnull @.str.3, i64 noundef 258, i32 noundef %52)
  br label %66

54:                                               ; preds = %50
  %55 = call ptr @json_object_get_array(ptr noundef %0, ptr noundef nonnull @.str.11)
  %56 = call noundef i32 @_ZN7UapkiNS4Cert16extensionsToJsonEP12json_array_tPKNS0_7CerItemERb(ptr noundef %55, ptr noundef nonnull %1, ptr noundef nonnull align 1 dereferenceable(1) %4)
  %.not63 = icmp eq i32 %56, 0
  br i1 %.not63, label %58, label %57

57:                                               ; preds = %54
  call void @stacktrace_add(ptr noundef nonnull @.str.3, i64 noundef 259, i32 noundef %56)
  br label %66

58:                                               ; preds = %54
  %59 = call ptr @json_object_get_object(ptr noundef %0, ptr noundef nonnull @.str.12)
  %60 = call noundef i32 @_ZN7UapkiNS4Cert19signatureInfoToJsonEP13json_object_tPKNS0_7CerItemE(ptr noundef %59, ptr noundef nonnull %1)
  %.not64 = icmp eq i32 %60, 0
  br i1 %.not64, label %62, label %61

61:                                               ; preds = %58
  call void @stacktrace_add(ptr noundef nonnull @.str.3, i64 noundef 260, i32 noundef %60)
  br label %66

62:                                               ; preds = %58
  %63 = load i8, ptr %4, align 1, !tbaa !9, !range !26, !noundef !27
  %64 = trunc nuw i8 %63 to i1
  %65 = call noundef i32 @_ZN12ParsonHelper20jsonObjectSetBooleanEP13json_object_tPKcb(ptr noundef %0, ptr noundef nonnull @.str.13, i1 noundef zeroext %64)
  %.not65 = icmp eq i32 %65, 0
  %spec.select = select i1 %.not65, i32 0, i32 4113
  br label %66

66:                                               ; preds = %62, %34, %31, %28, %25, %22, %19, %12, %61, %57, %53, %49, %44, %41, %18, %11
  %.0 = phi i32 [ %8, %11 ], [ %17, %18 ], [ %40, %41 ], [ %43, %44 ], [ %48, %49 ], [ %52, %53 ], [ %56, %57 ], [ %60, %61 ], [ 4113, %12 ], [ 4113, %19 ], [ 4113, %22 ], [ 4113, %25 ], [ 4113, %28 ], [ 4113, %31 ], [ 4113, %34 ], [ %spec.select, %62 ]
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #4
  ret i32 %.0
}

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

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

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

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

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

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_value_init_array() local_unnamed_addr #1

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN7UapkiNS4Cert14validityToJsonEP13json_object_tPKNS0_7CerItemE(ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN7UapkiNS4Cert10spkiToJsonEP13json_object_tPKNS0_7CerItemEb(ptr noundef, ptr noundef, i1 noundef zeroext) local_unnamed_addr #2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN7UapkiNS4Cert19signatureInfoToJsonEP13json_object_tPKNS0_7CerItemE(ptr noundef, ptr noundef) local_unnamed_addr #2

declare noundef i32 @_ZN12ParsonHelper20jsonObjectSetBooleanEP13json_object_tPKcb(ptr noundef, ptr noundef, i1 noundef zeroext) 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, !10, i64 0}
!10 = !{!"bool", !7, i64 0}
!11 = !{!12, !13, i64 0}
!12 = !{!"_ZTS14TBSCertificate", !13, i64 0, !14, i64 8, !16, i64 24, !19, i64 72, !21, i64 152, !19, i64 320, !24, i64 400, !13, i64 512, !13, i64 520, !13, i64 528, !17, i64 536}
!13 = !{!"any pointer", !7, i64 0}
!14 = !{!"_ZTS21ASN__PRIMITIVE_TYPE_s", !13, i64 0, !15, i64 8}
!15 = !{!"int", !7, i64 0}
!16 = !{!"_ZTS19AlgorithmIdentifier", !14, i64 0, !13, i64 16, !17, i64 24}
!17 = !{!"_ZTS16asn_struct_ctx_s", !18, i64 0, !18, i64 2, !15, i64 4, !13, i64 8, !6, i64 16}
!18 = !{!"short", !7, i64 0}
!19 = !{!"_ZTS4Name", !20, i64 0, !7, i64 8, !17, i64 56}
!20 = !{!"_ZTS7Name_PR", !7, i64 0}
!21 = !{!"_ZTS8Validity", !22, i64 0, !22, i64 72, !17, i64 144}
!22 = !{!"_ZTS8PKIXTime", !23, i64 0, !7, i64 8, !17, i64 48}
!23 = !{!"_ZTS11PKIXTime_PR", !7, i64 0}
!24 = !{!"_ZTS20SubjectPublicKeyInfo", !16, i64 0, !25, i64 48, !17, i64 88}
!25 = !{!"_ZTS12BIT_STRING_s", !13, i64 0, !15, i64 8, !15, i64 12, !17, i64 16}
!26 = !{i8 0, i8 2}
!27 = !{}


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