; LLVM IR from specinfo-ua/UAPKI :: library/uapki/src (ocsp-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 }
%"struct.UapkiNS::AlgorithmIdentifier" = type { %"class.std::__cxx11::basic_string", ptr }
%"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] }
%struct.OtherHash = type { i32, %"union.OtherHash::OtherHash_u", %struct.asn_struct_ctx_s }
%"union.OtherHash::OtherHash_u" = type { %struct.OtherHashAlgAndValue }
%struct.OtherHashAlgAndValue = type { %struct.AlgorithmIdentifier, %struct.OCTET_STRING, %struct.asn_struct_ctx_s }
%struct.AlgorithmIdentifier = type { %struct.ASN__PRIMITIVE_TYPE_s, ptr, %struct.asn_struct_ctx_s }
%struct.ASN__PRIMITIVE_TYPE_s = type { ptr, i32 }
%struct.OCTET_STRING = type { ptr, i32, %struct.asn_struct_ctx_s }
%struct.asn_struct_ctx_s = type { i16, i16, i32, ptr, i64 }

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: nounwind allocsize(0,1)
declare noalias ptr @calloc(i64 noundef, i64 noundef) #1

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

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

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

declare noundef i32 @_ZN7UapkiNS4Util25algorithmIdentifierToAsn1ER19AlgorithmIdentifierRKNS_19AlgorithmIdentifierE(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(40)) #0

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

declare i32 @asn_ba2OCTSTRING(ptr noundef, ptr noundef) #0

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

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

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

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

declare i32 @hash(i32 noundef, ptr noundef, ptr noundef) #0

; 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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN7UapkiNS4Ocsp17generateOtherHashEPK12ByteArray_stRKNS_19AlgorithmIdentifierEPPS1_(ptr noundef %0, ptr noundef nonnull align 8 dereferenceable(40) %1, ptr noundef %2) #4 personality ptr @__gxx_personality_v0 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca %"class.UapkiNS::SmartBA", align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 0, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  store ptr null, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  call void @_ZN7UapkiNS7SmartBAC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %10)
  %15 = load ptr, ptr %5, align 8, !tbaa !5
  %16 = icmp ne ptr %15, null
  br i1 %16, label %18, label %17

17:                                               ; preds = %3
  store i32 4101, ptr %4, align 4
  store i32 1, ptr %11, align 4
  br label %141

18:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  %19 = load ptr, ptr %6, align 8, !tbaa !5
  %20 = invoke noundef zeroext i1 @_ZNK7UapkiNS19AlgorithmIdentifier9isPresentEv(ptr noundef nonnull align 8 dereferenceable(40) %19)
          to label %21 unwind label %34

21:                                               ; preds = %18
  br i1 %20, label %22, label %28

22:                                               ; preds = %21
  %23 = load ptr, ptr %6, align 8, !tbaa !5
  %24 = getelementptr inbounds %"struct.UapkiNS::AlgorithmIdentifier", ptr %23, i32 0, i32 0
  %25 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %24) #5
  %26 = invoke i32 @hash_from_oid(ptr noundef %25)
          to label %27 unwind label %34

27:                                               ; preds = %22
  br label %29

28:                                               ; preds = %21
  br label %29

29:                                               ; preds = %28, %27
  %30 = phi i32 [ %26, %27 ], [ 5, %28 ]
  store i32 %30, ptr %12, align 4, !tbaa !11
  %31 = load i32, ptr %12, align 4, !tbaa !11
  %32 = icmp eq i32 %31, 0
  br i1 %32, label %33, label %38

33:                                               ; preds = %29
  store i32 4110, ptr %4, align 4
  store i32 1, ptr %11, align 4
  br label %140

34:                                               ; preds = %136, %134, %128, %121, %119, %112, %105, %103, %94, %86, %84, %78, %69, %58, %53, %49, %43, %22, %18
  %35 = landingpad { ptr, i32 }
          cleanup
  %36 = extractvalue { ptr, i32 } %35, 0
  store ptr %36, ptr %13, align 8
  %37 = extractvalue { ptr, i32 } %35, 1
  store i32 %37, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @_ZN7UapkiNS7SmartBAD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %143

38:                                               ; preds = %29
  %39 = call noalias ptr @calloc(i64 noundef 1, i64 noundef 144) #6
  store ptr %39, ptr %9, align 8, !tbaa !5
  br label %40

40:                                               ; preds = %38
  %41 = load ptr, ptr %9, align 8, !tbaa !5
  %42 = icmp eq ptr %41, null
  br i1 %42, label %43, label %46

43:                                               ; preds = %40
  store i32 1, ptr %8, align 4, !tbaa !9
  %44 = load i32, ptr %8, align 4, !tbaa !9
  invoke void @stacktrace_create(ptr noundef @.str, i64 noundef 627, i32 noundef %44, ptr noundef null)
          to label %45 unwind label %34

45:                                               ; preds = %43
  br label %134

46:                                               ; preds = %40
  br label %47

47:                                               ; preds = %46
  br label %48

48:                                               ; preds = %47
  br label %49

49:                                               ; preds = %48
  %50 = load i32, ptr %12, align 4, !tbaa !11
  %51 = load ptr, ptr %5, align 8, !tbaa !5
  %52 = invoke noundef ptr @_ZN7UapkiNS7SmartBAadEv(ptr noundef nonnull align 8 dereferenceable(8) %10)
          to label %53 unwind label %34

53:                                               ; preds = %49
  %54 = invoke i32 @hash(i32 noundef %50, ptr noundef %51, ptr noundef %52)
          to label %55 unwind label %34

55:                                               ; preds = %53
  store i32 %54, ptr %8, align 4, !tbaa !9
  %56 = load i32, ptr %8, align 4, !tbaa !9
  %57 = icmp ne i32 %56, 0
  br i1 %57, label %58, label %61

58:                                               ; preds = %55
  %59 = load i32, ptr %8, align 4, !tbaa !9
  invoke void @stacktrace_add(ptr noundef @.str, i64 noundef 629, i32 noundef %59)
          to label %60 unwind label %34

60:                                               ; preds = %58
  br label %134

61:                                               ; preds = %55
  br label %62

62:                                               ; preds = %61
  br label %63

63:                                               ; preds = %62
  %64 = load i32, ptr %12, align 4, !tbaa !11
  %65 = icmp ne i32 %64, 5
  br i1 %65, label %66, label %100

66:                                               ; preds = %63
  %67 = load ptr, ptr %9, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.OtherHash, ptr %67, i32 0, i32 0
  store i32 2, ptr %68, align 8, !tbaa !13
  br label %69

69:                                               ; preds = %66
  %70 = load ptr, ptr %9, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.OtherHash, ptr %70, i32 0, i32 1
  %72 = getelementptr inbounds %struct.OtherHashAlgAndValue, ptr %71, i32 0, i32 0
  %73 = load ptr, ptr %6, align 8, !tbaa !5
  %74 = invoke noundef i32 @_ZN7UapkiNS4Util25algorithmIdentifierToAsn1ER19AlgorithmIdentifierRKNS_19AlgorithmIdentifierE(ptr noundef nonnull align 8 dereferenceable(48) %72, ptr noundef nonnull align 8 dereferenceable(40) %73)
          to label %75 unwind label %34

75:                                               ; preds = %69
  store i32 %74, ptr %8, align 4, !tbaa !9
  %76 = load i32, ptr %8, align 4, !tbaa !9
  %77 = icmp ne i32 %76, 0
  br i1 %77, label %78, label %81

78:                                               ; preds = %75
  %79 = load i32, ptr %8, align 4, !tbaa !9
  invoke void @stacktrace_add(ptr noundef @.str, i64 noundef 633, i32 noundef %79)
          to label %80 unwind label %34

80:                                               ; preds = %78
  br label %134

81:                                               ; preds = %75
  br label %82

82:                                               ; preds = %81
  br label %83

83:                                               ; preds = %82
  br label %84

84:                                               ; preds = %83
  %85 = invoke noundef ptr @_ZNK7UapkiNS7SmartBA3getEv(ptr noundef nonnull align 8 dereferenceable(8) %10)
          to label %86 unwind label %34

86:                                               ; preds = %84
  %87 = load ptr, ptr %9, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.OtherHash, ptr %87, i32 0, i32 1
  %89 = getelementptr inbounds %struct.OtherHashAlgAndValue, ptr %88, i32 0, i32 1
  %90 = invoke i32 @asn_ba2OCTSTRING(ptr noundef %85, ptr noundef %89)
          to label %91 unwind label %34

91:                                               ; preds = %86
  store i32 %90, ptr %8, align 4, !tbaa !9
  %92 = load i32, ptr %8, align 4, !tbaa !9
  %93 = icmp ne i32 %92, 0
  br i1 %93, label %94, label %97

94:                                               ; preds = %91
  %95 = load i32, ptr %8, align 4, !tbaa !9
  invoke void @stacktrace_add(ptr noundef @.str, i64 noundef 634, i32 noundef %95)
          to label %96 unwind label %34

96:                                               ; preds = %94
  br label %134

97:                                               ; preds = %91
  br label %98

98:                                               ; preds = %97
  br label %99

99:                                               ; preds = %98
  br label %118

100:                                              ; preds = %63
  %101 = load ptr, ptr %9, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.OtherHash, ptr %101, i32 0, i32 0
  store i32 1, ptr %102, align 8, !tbaa !13
  br label %103

103:                                              ; preds = %100
  %104 = invoke noundef ptr @_ZNK7UapkiNS7SmartBA3getEv(ptr noundef nonnull align 8 dereferenceable(8) %10)
          to label %105 unwind label %34

105:                                              ; preds = %103
  %106 = load ptr, ptr %9, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.OtherHash, ptr %106, i32 0, i32 1
  %108 = invoke i32 @asn_ba2OCTSTRING(ptr noundef %104, ptr noundef %107)
          to label %109 unwind label %34

109:                                              ; preds = %105
  store i32 %108, ptr %8, align 4, !tbaa !9
  %110 = load i32, ptr %8, align 4, !tbaa !9
  %111 = icmp ne i32 %110, 0
  br i1 %111, label %112, label %115

112:                                              ; preds = %109
  %113 = load i32, ptr %8, align 4, !tbaa !9
  invoke void @stacktrace_add(ptr noundef @.str, i64 noundef 638, i32 noundef %113)
          to label %114 unwind label %34

114:                                              ; preds = %112
  br label %134

115:                                              ; preds = %109
  br label %116

116:                                              ; preds = %115
  br label %117

117:                                              ; preds = %116
  br label %118

118:                                              ; preds = %117, %99
  br label %119

119:                                              ; preds = %118
  %120 = invoke ptr @get_OtherHash_desc()
          to label %121 unwind label %34

121:                                              ; preds = %119
  %122 = load ptr, ptr %9, align 8, !tbaa !5
  %123 = load ptr, ptr %7, align 8, !tbaa !5
  %124 = invoke i32 @asn_encode_ba(ptr noundef %120, ptr noundef %122, ptr noundef %123)
          to label %125 unwind label %34

125:                                              ; preds = %121
  store i32 %124, ptr %8, align 4, !tbaa !9
  %126 = load i32, ptr %8, align 4, !tbaa !9
  %127 = icmp ne i32 %126, 0
  br i1 %127, label %128, label %131

128:                                              ; preds = %125
  %129 = load i32, ptr %8, align 4, !tbaa !9
  invoke void @stacktrace_add(ptr noundef @.str, i64 noundef 641, i32 noundef %129)
          to label %130 unwind label %34

130:                                              ; preds = %128
  br label %134

131:                                              ; preds = %125
  br label %132

132:                                              ; preds = %131
  br label %133

133:                                              ; preds = %132
  br label %134

134:                                              ; preds = %133, %130, %114, %96, %80, %60, %45
  %135 = invoke ptr @get_OtherHash_desc()
          to label %136 unwind label %34

136:                                              ; preds = %134
  %137 = load ptr, ptr %9, align 8, !tbaa !5
  invoke void @asn_free(ptr noundef %135, ptr noundef %137)
          to label %138 unwind label %34

138:                                              ; preds = %136
  %139 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %139, ptr %4, align 4
  store i32 1, ptr %11, align 4
  br label %140

140:                                              ; preds = %138, %33
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %141

141:                                              ; preds = %140, %17
  call void @_ZN7UapkiNS7SmartBAD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  %142 = load i32, ptr %4, align 4
  ret i32 %142

143:                                              ; preds = %34
  %144 = load ptr, ptr %13, align 8
  %145 = load i32, ptr %14, align 4
  %146 = insertvalue { ptr, i32 } poison, ptr %144, 0
  %147 = insertvalue { ptr, i32 } %146, i32 %145, 1
  resume { ptr, i32 } %147
}

declare i32 @hash_from_oid(ptr noundef) #0

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

declare ptr @get_OtherHash_desc() #0

attributes #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 = { nounwind allocsize(0,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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #5 = { nounwind }
attributes #6 = { nounwind allocsize(0,1) }

!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 = !{!"_ZTS7HashAlg", !7, i64 0}
!13 = !{!14, !15, i64 0}
!14 = !{!"_ZTS9OtherHash", !15, i64 0, !7, i64 8, !16, i64 120}
!15 = !{!"_ZTS12OtherHash_PR", !7, i64 0}
!16 = !{!"_ZTS16asn_struct_ctx_s", !17, i64 0, !17, i64 2, !10, i64 4, !6, i64 8, !18, i64 16}
!17 = !{!"short", !7, i64 0}
!18 = !{!"long", !7, i64 0}


; 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 [22 x i8], align 1

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @calloc(i64 noundef, i64 noundef) local_unnamed_addr #1

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

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

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

declare noundef i32 @_ZN7UapkiNS4Util25algorithmIdentifierToAsn1ER19AlgorithmIdentifierRKNS_19AlgorithmIdentifierE(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #0

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

declare i32 @asn_ba2OCTSTRING(ptr noundef, ptr noundef) local_unnamed_addr #0

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

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

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

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

declare i32 @hash(i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

; 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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN7UapkiNS4Ocsp17generateOtherHashEPK12ByteArray_stRKNS_19AlgorithmIdentifierEPPS1_(ptr noundef %0, ptr noundef nonnull align 8 dereferenceable(40) %1, ptr noundef %2) local_unnamed_addr #4 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"class.UapkiNS::SmartBA", align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  call void @_ZN7UapkiNS7SmartBAC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %4)
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %50, label %5

5:                                                ; preds = %3
  %6 = call noundef zeroext i1 @_ZNK7UapkiNS19AlgorithmIdentifier9isPresentEv(ptr noundef nonnull align 8 dereferenceable(40) %1)
  br i1 %6, label %7, label %.thread

7:                                                ; preds = %5
  %8 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #5
  %9 = invoke i32 @hash_from_oid(ptr noundef %8)
          to label %10 unwind label %12

10:                                               ; preds = %7
  %11 = icmp eq i32 %9, 0
  br i1 %11, label %50, label %.thread

12:                                               ; preds = %49, %47, %46, %43, %41, %40, %35, %34, %29, %28, %24, %22, %18, %17, %7
  %13 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN7UapkiNS7SmartBAD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  resume { ptr, i32 } %13

.thread:                                          ; preds = %5, %10
  %14 = phi i32 [ %9, %10 ], [ 5, %5 ]
  %15 = call noalias dereferenceable_or_null(144) ptr @calloc(i64 noundef 1, i64 noundef 144) #6
  %16 = icmp eq ptr %15, null
  br i1 %16, label %17, label %18

17:                                               ; preds = %.thread
  invoke void @stacktrace_create(ptr noundef nonnull @.str, i64 noundef 627, i32 noundef 1, ptr noundef null)
          to label %47 unwind label %12

18:                                               ; preds = %.thread
  %19 = call noundef ptr @_ZN7UapkiNS7SmartBAadEv(ptr noundef nonnull align 8 dereferenceable(8) %4)
  %20 = invoke i32 @hash(i32 noundef %14, ptr noundef nonnull %0, ptr noundef %19)
          to label %21 unwind label %12

21:                                               ; preds = %18
  %.not41 = icmp eq i32 %20, 0
  br i1 %.not41, label %23, label %22

22:                                               ; preds = %21
  invoke void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 629, i32 noundef %20)
          to label %47 unwind label %12

23:                                               ; preds = %21
  %.not42 = icmp eq i32 %14, 5
  br i1 %.not42, label %35, label %24

24:                                               ; preds = %23
  store i32 2, ptr %15, align 8, !tbaa !5
  %25 = getelementptr inbounds i8, ptr %15, i64 8
  %26 = invoke noundef i32 @_ZN7UapkiNS4Util25algorithmIdentifierToAsn1ER19AlgorithmIdentifierRKNS_19AlgorithmIdentifierE(ptr noundef nonnull align 8 dereferenceable(48) %25, ptr noundef nonnull align 8 dereferenceable(40) %1)
          to label %27 unwind label %12

27:                                               ; preds = %24
  %.not44 = icmp eq i32 %26, 0
  br i1 %.not44, label %29, label %28

28:                                               ; preds = %27
  invoke void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 633, i32 noundef %26)
          to label %47 unwind label %12

29:                                               ; preds = %27
  %30 = call noundef ptr @_ZNK7UapkiNS7SmartBA3getEv(ptr noundef nonnull align 8 dereferenceable(8) %4)
  %31 = getelementptr inbounds i8, ptr %15, i64 56
  %32 = invoke i32 @asn_ba2OCTSTRING(ptr noundef %30, ptr noundef nonnull %31)
          to label %33 unwind label %12

33:                                               ; preds = %29
  %.not45 = icmp eq i32 %32, 0
  br i1 %.not45, label %41, label %34

34:                                               ; preds = %33
  invoke void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 634, i32 noundef %32)
          to label %47 unwind label %12

35:                                               ; preds = %23
  store i32 1, ptr %15, align 8, !tbaa !5
  %36 = call noundef ptr @_ZNK7UapkiNS7SmartBA3getEv(ptr noundef nonnull align 8 dereferenceable(8) %4)
  %37 = getelementptr inbounds i8, ptr %15, i64 8
  %38 = invoke i32 @asn_ba2OCTSTRING(ptr noundef %36, ptr noundef nonnull %37)
          to label %39 unwind label %12

39:                                               ; preds = %35
  %.not43 = icmp eq i32 %38, 0
  br i1 %.not43, label %41, label %40

40:                                               ; preds = %39
  invoke void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 638, i32 noundef %38)
          to label %47 unwind label %12

41:                                               ; preds = %33, %39
  %42 = invoke ptr @get_OtherHash_desc()
          to label %43 unwind label %12

43:                                               ; preds = %41
  %44 = invoke i32 @asn_encode_ba(ptr noundef %42, ptr noundef nonnull %15, ptr noundef %2)
          to label %45 unwind label %12

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

46:                                               ; preds = %45
  invoke void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 641, i32 noundef %44)
          to label %47 unwind label %12

47:                                               ; preds = %45, %46, %40, %34, %28, %22, %17
  %.031 = phi i32 [ 1, %17 ], [ %20, %22 ], [ %26, %28 ], [ %32, %34 ], [ %44, %46 ], [ 0, %45 ], [ %38, %40 ]
  %48 = invoke ptr @get_OtherHash_desc()
          to label %49 unwind label %12

49:                                               ; preds = %47
  invoke void @asn_free(ptr noundef %48, ptr noundef %15)
          to label %50 unwind label %12

50:                                               ; preds = %10, %49, %3
  %.1 = phi i32 [ 4101, %3 ], [ 4110, %10 ], [ %.031, %49 ]
  call void @_ZN7UapkiNS7SmartBAD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  ret i32 %.1
}

declare i32 @hash_from_oid(ptr noundef) local_unnamed_addr #0

; 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

declare ptr @get_OtherHash_desc() local_unnamed_addr #0

attributes #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 nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #5 = { nounwind }
attributes #6 = { nounwind allocsize(0,1) }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 0}
!6 = !{!"_ZTS9OtherHash", !7, i64 0, !8, i64 8, !10, i64 120}
!7 = !{!"_ZTS12OtherHash_PR", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTS16asn_struct_ctx_s", !11, i64 0, !11, i64 2, !12, i64 4, !13, i64 8, !14, i64 16}
!11 = !{!"short", !8, i64 0}
!12 = !{!"int", !8, i64 0}
!13 = !{!"any pointer", !8, i64 0}
!14 = !{!"long", !8, i64 0}


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