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

; 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.UapkiNS::SmartBA" = type { ptr }
%"class.UapkiNS::Pkcs7::ArchiveTs3Helper" = type { ptr, i32, %"struct.UapkiNS::Pkcs7::ArchiveTs3Helper::ATSHashIndex", %struct.anon, %"class.UapkiNS::SmartBA" }
%"struct.UapkiNS::Pkcs7::ArchiveTs3Helper::ATSHashIndex" = type { %"class.UapkiNS::VectorBA", %"class.UapkiNS::VectorBA", %"class.UapkiNS::VectorBA" }
%"class.UapkiNS::VectorBA" = type { %"class.std::vector" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<ByteArray_st *, std::allocator<ByteArray_st *>>::_Vector_impl" }
%"struct.std::_Vector_base<ByteArray_st *, std::allocator<ByteArray_st *>>::_Vector_impl" = type { %"struct.std::_Vector_base<ByteArray_st *, std::allocator<ByteArray_st *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<ByteArray_st *, std::allocator<ByteArray_st *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.anon = type { %"class.UapkiNS::SmartBA", %"class.UapkiNS::SmartBA", %"class.UapkiNS::SmartBA", %"class.UapkiNS::SmartBA" }
%struct.Attributes = type { %struct.anon.3, %struct.asn_struct_ctx_s }
%struct.anon.3 = type { ptr, i32, i32, ptr }
%struct.asn_struct_ctx_s = type { i16, i16, i32, ptr, i64 }

@.str = external hidden unnamed_addr constant [41 x i8], align 1

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN7UapkiNS5Pkcs716ArchiveTs3Helper16setUnsignedAttrsEPK10Attributes(ptr noundef nonnull align 8 dereferenceable(128) %0, ptr noundef %1) #3 align 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 ptr, align 8
  %9 = alloca %"class.UapkiNS::SmartBA", align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %14 = load ptr, ptr %4, align 8
  %15 = load ptr, ptr %5, align 8, !tbaa !5
  %16 = icmp ne ptr %15, null
  br i1 %16, label %18, label %17

17:                                               ; preds = %2
  store i32 4101, ptr %3, align 4
  br label %166

18:                                               ; preds = %2
  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
  call void @_ZN7UapkiNS7SmartBAC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %9)
  %19 = invoke ptr @get_Attributes_desc()
          to label %20 unwind label %30

20:                                               ; preds = %18
  %21 = load ptr, ptr %5, align 8, !tbaa !5
  %22 = invoke ptr @asn_copy_with_alloc(ptr noundef %19, ptr noundef %21)
          to label %23 unwind label %30

23:                                               ; preds = %20
  store ptr %22, ptr %7, align 8, !tbaa !5
  %24 = load ptr, ptr %7, align 8, !tbaa !5
  %25 = icmp ne ptr %24, null
  br i1 %25, label %36, label %26

26:                                               ; preds = %23
  br label %27

27:                                               ; preds = %26
  store i32 4097, ptr %6, align 4, !tbaa !9
  %28 = load i32, ptr %6, align 4, !tbaa !9
  invoke void @stacktrace_create(ptr noundef @.str, i64 noundef 135, i32 noundef %28, ptr noundef null)
          to label %29 unwind label %30

29:                                               ; preds = %27
  br label %154

30:                                               ; preds = %160, %158, %156, %154, %71, %66, %60, %58, %56, %54, %52, %47, %42, %39, %37, %27, %20, %18
  %31 = landingpad { ptr, i32 }
          cleanup
  %32 = extractvalue { ptr, i32 } %31, 0
  store ptr %32, ptr %10, align 8
  %33 = extractvalue { ptr, i32 } %31, 1
  store i32 %33, ptr %11, align 4
  br label %165

34:                                               ; No predecessors!
  br label %35

35:                                               ; preds = %34
  br label %36

36:                                               ; preds = %35, %23
  br label %37

37:                                               ; preds = %36
  %38 = invoke ptr @get_Attributes_desc()
          to label %39 unwind label %30

39:                                               ; preds = %37
  %40 = load ptr, ptr %7, align 8, !tbaa !5
  %41 = invoke noundef ptr @_ZN7UapkiNS7SmartBAadEv(ptr noundef nonnull align 8 dereferenceable(8) %9)
          to label %42 unwind label %30

42:                                               ; preds = %39
  %43 = invoke i32 @asn_encode_ba(ptr noundef %38, ptr noundef %40, ptr noundef %41)
          to label %44 unwind label %30

44:                                               ; preds = %42
  store i32 %43, ptr %6, align 4, !tbaa !9
  %45 = load i32, ptr %6, align 4, !tbaa !9
  %46 = icmp ne i32 %45, 0
  br i1 %46, label %47, label %50

47:                                               ; preds = %44
  %48 = load i32, ptr %6, align 4, !tbaa !9
  invoke void @stacktrace_add(ptr noundef @.str, i64 noundef 137, i32 noundef %48)
          to label %49 unwind label %30

49:                                               ; preds = %47
  br label %154

50:                                               ; preds = %44
  br label %51

51:                                               ; preds = %50
  br label %52

52:                                               ; preds = %51
  %53 = invoke ptr @get_Attributes_desc()
          to label %54 unwind label %30

54:                                               ; preds = %52
  %55 = load ptr, ptr %7, align 8, !tbaa !5
  invoke void @asn_free(ptr noundef %53, ptr noundef %55)
          to label %56 unwind label %30

56:                                               ; preds = %54
  %57 = invoke ptr @get_Attributes_desc()
          to label %58 unwind label %30

58:                                               ; preds = %56
  %59 = invoke noundef ptr @_ZNK7UapkiNS7SmartBA3getEv(ptr noundef nonnull align 8 dereferenceable(8) %9)
          to label %60 unwind label %30

60:                                               ; preds = %58
  %61 = invoke ptr @asn_decode_ba_with_alloc(ptr noundef %57, ptr noundef %59)
          to label %62 unwind label %30

62:                                               ; preds = %60
  store ptr %61, ptr %7, align 8, !tbaa !5
  %63 = load ptr, ptr %7, align 8, !tbaa !5
  %64 = icmp ne ptr %63, null
  br i1 %64, label %71, label %65

65:                                               ; preds = %62
  br label %66

66:                                               ; preds = %65
  store i32 4097, ptr %6, align 4, !tbaa !9
  %67 = load i32, ptr %6, align 4, !tbaa !9
  invoke void @stacktrace_create(ptr noundef @.str, i64 noundef 142, i32 noundef %67, ptr noundef null)
          to label %68 unwind label %30

68:                                               ; preds = %66
  br label %154

69:                                               ; No predecessors!
  br label %70

70:                                               ; preds = %69
  br label %71

71:                                               ; preds = %70, %62
  %72 = getelementptr inbounds %"class.UapkiNS::Pkcs7::ArchiveTs3Helper", ptr %14, i32 0, i32 2
  %73 = getelementptr inbounds %"struct.UapkiNS::Pkcs7::ArchiveTs3Helper::ATSHashIndex", ptr %72, i32 0, i32 2
  %74 = load ptr, ptr %7, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.Attributes, ptr %74, i32 0, i32 0
  %76 = getelementptr inbounds %struct.anon.3, ptr %75, i32 0, i32 1
  %77 = load i32, ptr %76, align 8, !tbaa !11
  %78 = sext i32 %77 to i64
  invoke void @_ZNSt6vectorIP12ByteArray_stSaIS1_EE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24) %73, i64 noundef %78)
          to label %79 unwind label %30

79:                                               ; preds = %71
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %80

80:                                               ; preds = %148, %79
  %81 = load i32, ptr %12, align 4, !tbaa !9
  %82 = load ptr, ptr %7, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.Attributes, ptr %82, i32 0, i32 0
  %84 = getelementptr inbounds %struct.anon.3, ptr %83, i32 0, i32 1
  %85 = load i32, ptr %84, align 8, !tbaa !11
  %86 = icmp slt i32 %81, %85
  br i1 %86, label %88, label %87

87:                                               ; preds = %80
  store i32 9, ptr %13, align 4
  br label %151

88:                                               ; preds = %80
  invoke void @_ZN7UapkiNS7SmartBA5clearEv(ptr noundef nonnull align 8 dereferenceable(8) %9)
          to label %89 unwind label %108

89:                                               ; preds = %88
  %90 = invoke ptr @get_Attribute_desc()
          to label %91 unwind label %108

91:                                               ; preds = %89
  %92 = load ptr, ptr %7, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.Attributes, ptr %92, i32 0, i32 0
  %94 = getelementptr inbounds %struct.anon.3, ptr %93, i32 0, i32 0
  %95 = load ptr, ptr %94, align 8, !tbaa !17
  %96 = load i32, ptr %12, align 4, !tbaa !9
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds ptr, ptr %95, i64 %97
  %99 = load ptr, ptr %98, align 8, !tbaa !5
  %100 = invoke ptr @asn_copy_with_alloc(ptr noundef %90, ptr noundef %99)
          to label %101 unwind label %108

101:                                              ; preds = %91
  store ptr %100, ptr %8, align 8, !tbaa !5
  %102 = load ptr, ptr %7, align 8, !tbaa !5
  %103 = icmp ne ptr %102, null
  br i1 %103, label %114, label %104

104:                                              ; preds = %101
  br label %105

105:                                              ; preds = %104
  store i32 4097, ptr %6, align 4, !tbaa !9
  %106 = load i32, ptr %6, align 4, !tbaa !9
  invoke void @stacktrace_create(ptr noundef @.str, i64 noundef 150, i32 noundef %106, ptr noundef null)
          to label %107 unwind label %108

107:                                              ; preds = %105
  store i32 4, ptr %13, align 4
  br label %151

108:                                              ; preds = %142, %137, %135, %132, %130, %125, %120, %117, %115, %105, %91, %89, %88
  %109 = landingpad { ptr, i32 }
          cleanup
  %110 = extractvalue { ptr, i32 } %109, 0
  store ptr %110, ptr %10, align 8
  %111 = extractvalue { ptr, i32 } %109, 1
  store i32 %111, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  br label %165

112:                                              ; No predecessors!
  br label %113

113:                                              ; preds = %112
  br label %114

114:                                              ; preds = %113, %101
  br label %115

115:                                              ; preds = %114
  %116 = invoke ptr @get_Attribute_desc()
          to label %117 unwind label %108

117:                                              ; preds = %115
  %118 = load ptr, ptr %8, align 8, !tbaa !5
  %119 = invoke noundef ptr @_ZN7UapkiNS7SmartBAadEv(ptr noundef nonnull align 8 dereferenceable(8) %9)
          to label %120 unwind label %108

120:                                              ; preds = %117
  %121 = invoke i32 @asn_encode_ba(ptr noundef %116, ptr noundef %118, ptr noundef %119)
          to label %122 unwind label %108

122:                                              ; preds = %120
  store i32 %121, ptr %6, align 4, !tbaa !9
  %123 = load i32, ptr %6, align 4, !tbaa !9
  %124 = icmp ne i32 %123, 0
  br i1 %124, label %125, label %128

125:                                              ; preds = %122
  %126 = load i32, ptr %6, align 4, !tbaa !9
  invoke void @stacktrace_add(ptr noundef @.str, i64 noundef 152, i32 noundef %126)
          to label %127 unwind label %108

127:                                              ; preds = %125
  store i32 4, ptr %13, align 4
  br label %151

128:                                              ; preds = %122
  br label %129

129:                                              ; preds = %128
  br label %130

130:                                              ; preds = %129
  %131 = invoke ptr @get_Attribute_desc()
          to label %132 unwind label %108

132:                                              ; preds = %130
  %133 = load ptr, ptr %8, align 8, !tbaa !5
  invoke void @asn_free(ptr noundef %131, ptr noundef %133)
          to label %134 unwind label %108

134:                                              ; preds = %132
  store ptr null, ptr %8, align 8, !tbaa !5
  br label %135

135:                                              ; preds = %134
  %136 = invoke noundef ptr @_ZNK7UapkiNS7SmartBA3getEv(ptr noundef nonnull align 8 dereferenceable(8) %9)
          to label %137 unwind label %108

137:                                              ; preds = %135
  %138 = invoke noundef i32 @_ZN7UapkiNS5Pkcs716ArchiveTs3Helper15addUnsignedAttrEPK12ByteArray_st(ptr noundef nonnull align 8 dereferenceable(128) %14, ptr noundef %136)
          to label %139 unwind label %108

139:                                              ; preds = %137
  store i32 %138, ptr %6, align 4, !tbaa !9
  %140 = load i32, ptr %6, align 4, !tbaa !9
  %141 = icmp ne i32 %140, 0
  br i1 %141, label %142, label %145

142:                                              ; preds = %139
  %143 = load i32, ptr %6, align 4, !tbaa !9
  invoke void @stacktrace_add(ptr noundef @.str, i64 noundef 155, i32 noundef %143)
          to label %144 unwind label %108

144:                                              ; preds = %142
  store i32 4, ptr %13, align 4
  br label %151

145:                                              ; preds = %139
  br label %146

146:                                              ; preds = %145
  br label %147

147:                                              ; preds = %146
  br label %148

148:                                              ; preds = %147
  %149 = load i32, ptr %12, align 4, !tbaa !9
  %150 = add nsw i32 %149, 1
  store i32 %150, ptr %12, align 4, !tbaa !9
  br label %80, !llvm.loop !18

151:                                              ; preds = %144, %127, %107, %87
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  %152 = load i32, ptr %13, align 4
  switch i32 %152, label %164 [
    i32 9, label %153
    i32 4, label %154
  ]

153:                                              ; preds = %151
  br label %154

154:                                              ; preds = %153, %151, %68, %49, %29
  %155 = invoke ptr @get_Attributes_desc()
          to label %156 unwind label %30

156:                                              ; preds = %154
  %157 = load ptr, ptr %7, align 8, !tbaa !5
  invoke void @asn_free(ptr noundef %155, ptr noundef %157)
          to label %158 unwind label %30

158:                                              ; preds = %156
  %159 = invoke ptr @get_Attribute_desc()
          to label %160 unwind label %30

160:                                              ; preds = %158
  %161 = load ptr, ptr %8, align 8, !tbaa !5
  invoke void @asn_free(ptr noundef %159, ptr noundef %161)
          to label %162 unwind label %30

162:                                              ; preds = %160
  %163 = load i32, ptr %6, align 4, !tbaa !9
  store i32 %163, ptr %3, align 4
  store i32 1, ptr %13, align 4
  br label %164

164:                                              ; preds = %162, %151
  call void @_ZN7UapkiNS7SmartBAD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %9) #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 %166

165:                                              ; preds = %108, %30
  call void @_ZN7UapkiNS7SmartBAD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %9) #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 %168

166:                                              ; preds = %164, %17
  %167 = load i32, ptr %3, align 4
  ret i32 %167

168:                                              ; preds = %165
  %169 = load ptr, ptr %10, align 8
  %170 = load i32, ptr %11, align 4
  %171 = insertvalue { ptr, i32 } poison, ptr %169, 0
  %172 = insertvalue { ptr, i32 } %171, i32 %170, 1
  resume { ptr, i32 } %172
}

declare ptr @get_Attributes_desc() #2

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

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

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

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

declare ptr @get_Attribute_desc() #2

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

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress 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 = !{!"_ZTS10Attributes", !13, i64 0, !14, i64 24}
!13 = !{!"_ZTSN10AttributesUt_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 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}


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

%"class.UapkiNS::SmartBA" = type { ptr }

@.str = external hidden unnamed_addr constant [41 x i8], align 1

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN7UapkiNS5Pkcs716ArchiveTs3Helper16setUnsignedAttrsEPK10Attributes(ptr noundef nonnull align 8 dereferenceable(128) %0, ptr noundef %1) local_unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.UapkiNS::SmartBA", align 8
  %.not = icmp eq ptr %1, null
  br i1 %.not, label %68, label %4

4:                                                ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #4
  call void @_ZN7UapkiNS7SmartBAC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %3)
  %5 = invoke ptr @get_Attributes_desc()
          to label %6 unwind label %9

6:                                                ; preds = %4
  %7 = invoke ptr @asn_copy_with_alloc(ptr noundef %5, ptr noundef nonnull %1)
          to label %8 unwind label %9

8:                                                ; preds = %6
  %.not51 = icmp eq ptr %7, null
  br i1 %.not51, label %.invoke, label %11

9:                                                ; preds = %.invoke, %65, %63, %62, %.loopexit, %28, %23, %21, %20, %18, %17, %13, %11, %6, %4
  %10 = landingpad { ptr, i32 }
          cleanup
  br label %67

11:                                               ; preds = %8
  %12 = invoke ptr @get_Attributes_desc()
          to label %13 unwind label %9

13:                                               ; preds = %11
  %14 = call noundef ptr @_ZN7UapkiNS7SmartBAadEv(ptr noundef nonnull align 8 dereferenceable(8) %3)
  %15 = invoke i32 @asn_encode_ba(ptr noundef %12, ptr noundef nonnull %7, ptr noundef %14)
          to label %16 unwind label %9

16:                                               ; preds = %13
  %.not52 = icmp eq i32 %15, 0
  br i1 %.not52, label %18, label %17

17:                                               ; preds = %16
  invoke void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 137, i32 noundef %15)
          to label %.loopexit unwind label %9

18:                                               ; preds = %16
  %19 = invoke ptr @get_Attributes_desc()
          to label %20 unwind label %9

20:                                               ; preds = %18
  invoke void @asn_free(ptr noundef %19, ptr noundef nonnull %7)
          to label %21 unwind label %9

21:                                               ; preds = %20
  %22 = invoke ptr @get_Attributes_desc()
          to label %23 unwind label %9

23:                                               ; preds = %21
  %24 = call noundef ptr @_ZNK7UapkiNS7SmartBA3getEv(ptr noundef nonnull align 8 dereferenceable(8) %3)
  %25 = invoke ptr @asn_decode_ba_with_alloc(ptr noundef %22, ptr noundef %24)
          to label %26 unwind label %9

26:                                               ; preds = %23
  %.not53 = icmp eq ptr %25, null
  br i1 %.not53, label %.invoke, label %28

.invoke:                                          ; preds = %8, %26
  %27 = phi i64 [ 142, %26 ], [ 135, %8 ]
  invoke void @stacktrace_create(ptr noundef nonnull @.str, i64 noundef %27, i32 noundef 4097, ptr noundef null)
          to label %.loopexit unwind label %9

28:                                               ; preds = %26
  %29 = getelementptr inbounds i8, ptr %0, i64 64
  %30 = getelementptr inbounds i8, ptr %25, i64 8
  %31 = load i32, ptr %30, align 8, !tbaa !5
  %32 = sext i32 %31 to i64
  invoke void @_ZNSt6vectorIP12ByteArray_stSaIS1_EE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24) %29, i64 noundef %32)
          to label %.preheader unwind label %9

.preheader:                                       ; preds = %28
  %33 = load i32, ptr %30, align 8, !tbaa !5
  %34 = icmp sgt i32 %33, 0
  br i1 %34, label %.lr.ph, label %.loopexit

35:                                               ; preds = %59
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %36 = load i32, ptr %30, align 8, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = icmp slt i64 %indvars.iv.next, %37
  br i1 %38, label %.lr.ph, label %.loopexit, !llvm.loop !15

.lr.ph:                                           ; preds = %.preheader, %35
  %indvars.iv = phi i64 [ %indvars.iv.next, %35 ], [ 0, %.preheader ]
  invoke void @_ZN7UapkiNS7SmartBA5clearEv(ptr noundef nonnull align 8 dereferenceable(8) %3)
          to label %39 unwind label %.loopexit57

39:                                               ; preds = %.lr.ph
  %40 = invoke ptr @get_Attribute_desc()
          to label %41 unwind label %.loopexit57

41:                                               ; preds = %39
  %42 = load ptr, ptr %25, align 8, !tbaa !17
  %43 = getelementptr inbounds ptr, ptr %42, i64 %indvars.iv
  %44 = load ptr, ptr %43, align 8, !tbaa !18
  %45 = invoke ptr @asn_copy_with_alloc(ptr noundef %40, ptr noundef %44)
          to label %46 unwind label %.loopexit57

.loopexit57:                                      ; preds = %.lr.ph, %39, %41, %46, %48, %53, %55, %56
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %67

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

46:                                               ; preds = %41
  %47 = invoke ptr @get_Attribute_desc()
          to label %48 unwind label %.loopexit57

48:                                               ; preds = %46
  %49 = call noundef ptr @_ZN7UapkiNS7SmartBAadEv(ptr noundef nonnull align 8 dereferenceable(8) %3)
  %50 = invoke i32 @asn_encode_ba(ptr noundef %47, ptr noundef %45, ptr noundef %49)
          to label %51 unwind label %.loopexit57

51:                                               ; preds = %48
  %.not54 = icmp eq i32 %50, 0
  br i1 %.not54, label %53, label %52

52:                                               ; preds = %51
  invoke void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 152, i32 noundef %50)
          to label %.loopexit unwind label %.loopexit.split-lp

53:                                               ; preds = %51
  %54 = invoke ptr @get_Attribute_desc()
          to label %55 unwind label %.loopexit57

55:                                               ; preds = %53
  invoke void @asn_free(ptr noundef %54, ptr noundef %45)
          to label %56 unwind label %.loopexit57

56:                                               ; preds = %55
  %57 = call noundef ptr @_ZNK7UapkiNS7SmartBA3getEv(ptr noundef nonnull align 8 dereferenceable(8) %3)
  %58 = invoke noundef i32 @_ZN7UapkiNS5Pkcs716ArchiveTs3Helper15addUnsignedAttrEPK12ByteArray_st(ptr noundef nonnull align 8 dereferenceable(128) %0, ptr noundef %57)
          to label %59 unwind label %.loopexit57

59:                                               ; preds = %56
  %.not55 = icmp eq i32 %58, 0
  br i1 %.not55, label %35, label %60

60:                                               ; preds = %59
  invoke void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 155, i32 noundef %58)
          to label %.loopexit unwind label %.loopexit.split-lp

.loopexit:                                        ; preds = %35, %.invoke, %.preheader, %52, %60, %17
  %.238 = phi i32 [ %15, %17 ], [ %50, %52 ], [ %58, %60 ], [ 0, %.preheader ], [ 4097, %.invoke ], [ 0, %35 ]
  %.035 = phi ptr [ %7, %17 ], [ %25, %52 ], [ %25, %60 ], [ %25, %.preheader ], [ null, %.invoke ], [ %25, %35 ]
  %.2 = phi ptr [ null, %17 ], [ %45, %52 ], [ null, %60 ], [ null, %.preheader ], [ null, %.invoke ], [ null, %35 ]
  %61 = invoke ptr @get_Attributes_desc()
          to label %62 unwind label %9

62:                                               ; preds = %.loopexit
  invoke void @asn_free(ptr noundef %61, ptr noundef %.035)
          to label %63 unwind label %9

63:                                               ; preds = %62
  %64 = invoke ptr @get_Attribute_desc()
          to label %65 unwind label %9

65:                                               ; preds = %63
  invoke void @asn_free(ptr noundef %64, ptr noundef %.2)
          to label %66 unwind label %9

66:                                               ; preds = %65
  call void @_ZN7UapkiNS7SmartBAD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %3) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #4
  br label %68

67:                                               ; preds = %.loopexit57, %.loopexit.split-lp, %9
  %.pn = phi { ptr, i32 } [ %10, %9 ], [ %lpad.loopexit, %.loopexit57 ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ]
  call void @_ZN7UapkiNS7SmartBAD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %3) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #4
  resume { ptr, i32 } %.pn

68:                                               ; preds = %2, %66
  %.140 = phi i32 [ %.238, %66 ], [ 4101, %2 ]
  ret i32 %.140
}

declare ptr @get_Attributes_desc() local_unnamed_addr #2

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

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

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

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

declare ptr @get_Attribute_desc() local_unnamed_addr #2

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

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress 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, !11, i64 8}
!6 = !{!"_ZTS10Attributes", !7, i64 0, !12, i64 24}
!7 = !{!"_ZTSN10AttributesUt_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}


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