; LLVM IR from Trusted-eSign/trusted-crypto :: deps/wrapper/src/pki/attrs.ll (ZN19AttributeCollection4pushE6HandleI9AttributeE)

; 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.LoggerFunction = type { %class.Handle.0, ptr }
%class.Handle.0 = type { ptr }
%class.Handle.1 = type { ptr }
%class.AttributeCollection = type { %class.SSLObject, ptr }
%class.SSLObject = type { ptr, %class.Handle }
%class.Handle = type { ptr }

@logger = external global ptr, align 8
@__FUNCTION__._ZN19AttributeCollectionC2EPP23stack_st_X509_ATTRIBUTE6HandleI7SObjectE = external hidden unnamed_addr constant [20 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [93 x i8], align 1
@_ZTI6HandleI9ExceptionE = external dso_local constant { ptr, ptr }, align 8
@__FUNCTION__._ZN19AttributeCollection4pushE6HandleI9AttributeE = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [23 x i8], align 1

declare ptr @OPENSSL_sk_new_null() #0

declare i32 @__gxx_personality_v0(...)

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

declare void @_ZN14LoggerFunctionC1EP6LoggerPKc(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef, ptr noundef) unnamed_addr #0

declare void @_ZN6Logger5errorEPKcS1_z(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef, ptr noundef, ...) #0

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) #2

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

declare void @_ZN9ExceptionC1EbPKciiS1_S1_6HandleIS_ES1_z(ptr noundef nonnull align 8 dereferenceable(176), i1 noundef zeroext, ptr noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ...) unnamed_addr #0

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

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) #5

declare ptr @__cxa_allocate_exception(i64)

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

declare void @__cxa_free_exception(ptr)

declare void @__cxa_throw(ptr, ptr, ptr)

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

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

; Function Attrs: nounwind
declare void @_ZN14LoggerFunctionD1Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #6

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN19AttributeCollection4pushE6HandleI9AttributeE(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef %1) #3 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca %class.LoggerFunction, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca %class.Handle.1, align 8
  %10 = alloca %class.Handle.1, align 8
  %11 = alloca i1, align 1
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %12 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %5) #8
  %13 = load ptr, ptr @logger, align 8, !tbaa !5
  call void @_ZN14LoggerFunctionC1EP6LoggerPKc(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef %13, ptr noundef @__FUNCTION__._ZN19AttributeCollection4pushE6HandleI9AttributeE)
  %14 = getelementptr inbounds %class.AttributeCollection, ptr %12, i32 0, i32 1
  %15 = load ptr, ptr %14, align 8, !tbaa !9
  %16 = icmp ne ptr %15, null
  br i1 %16, label %17, label %36

17:                                               ; preds = %2
  %18 = getelementptr inbounds %class.AttributeCollection, ptr %12, i32 0, i32 1
  %19 = load ptr, ptr %18, align 8, !tbaa !9
  %20 = load ptr, ptr %19, align 8, !tbaa !5
  %21 = icmp ne ptr %20, null
  br i1 %21, label %35, label %22

22:                                               ; preds = %17
  %23 = invoke ptr @OPENSSL_sk_new_null()
          to label %24 unwind label %31

24:                                               ; preds = %22
  %25 = getelementptr inbounds %class.AttributeCollection, ptr %12, i32 0, i32 1
  %26 = load ptr, ptr %25, align 8, !tbaa !9
  store ptr %23, ptr %26, align 8, !tbaa !5
  %27 = getelementptr inbounds %class.AttributeCollection, ptr %12, i32 0, i32 1
  %28 = load ptr, ptr %27, align 8, !tbaa !9
  %29 = load ptr, ptr %28, align 8, !tbaa !5
  invoke void @_ZN9SSLObjectI23stack_st_X509_ATTRIBUTEE7setDataEPS0_(ptr noundef nonnull align 8 dereferenceable(16) %12, ptr noundef %29)
          to label %30 unwind label %31

30:                                               ; preds = %24
  br label %35

31:                                               ; preds = %36, %24, %22
  %32 = landingpad { ptr, i32 }
          cleanup
  %33 = extractvalue { ptr, i32 } %32, 0
  store ptr %33, ptr %6, align 8
  %34 = extractvalue { ptr, i32 } %32, 1
  store i32 %34, ptr %7, align 4
  br label %100

35:                                               ; preds = %30, %17
  br label %36

36:                                               ; preds = %35, %2
  %37 = load ptr, ptr @logger, align 8, !tbaa !5
  invoke void (ptr, i32, ptr, ptr, ...) @_ZN6Logger5writeEN11LoggerLevel12LOGGER_LEVELEPKcS3_z(ptr noundef nonnull align 8 dereferenceable(24) %37, i32 noundef 32, ptr noundef @__FUNCTION__._ZN19AttributeCollection4pushE6HandleI9AttributeE, ptr noundef @.str.2)
          to label %38 unwind label %31

38:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #8
  %39 = invoke noundef ptr @_ZNK6HandleI9AttributeEptEv(ptr noundef nonnull align 8 dereferenceable(8) %1)
          to label %40 unwind label %57

40:                                               ; preds = %38
  %41 = invoke noundef ptr @_ZN9SSLObjectI18x509_attributes_stE8internalEv(ptr noundef nonnull align 8 dereferenceable(16) %39)
          to label %42 unwind label %57

42:                                               ; preds = %40
  %43 = invoke ptr @X509_ATTRIBUTE_dup(ptr noundef %41)
          to label %44 unwind label %57

44:                                               ; preds = %42
  store ptr %43, ptr %8, align 8, !tbaa !5
  %45 = load ptr, ptr %8, align 8, !tbaa !5
  %46 = icmp ne ptr %45, null
  br i1 %46, label %87, label %47

47:                                               ; preds = %44
  %48 = load ptr, ptr @logger, align 8, !tbaa !5
  invoke void (ptr, ptr, ptr, ...) @_ZN6Logger5errorEPKcS1_z(ptr noundef nonnull align 8 dereferenceable(24) %48, ptr noundef @__FUNCTION__._ZN19AttributeCollection4pushE6HandleI9AttributeE, ptr noundef @.str.2)
          to label %49 unwind label %57

49:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #8
  %50 = invoke noalias noundef nonnull ptr @_Znwm(i64 noundef 176) #9
          to label %51 unwind label %61

51:                                               ; preds = %49
  store i1 true, ptr %11, align 1
  invoke void @_ZN6HandleI9ExceptionEC2EPS0_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef null)
          to label %52 unwind label %65

52:                                               ; preds = %51
  invoke void (ptr, i1, ptr, i32, i32, ptr, ptr, ptr, ptr, ...) @_ZN9ExceptionC1EbPKciiS1_S1_6HandleIS_ES1_z(ptr noundef nonnull align 8 dereferenceable(176) %50, i1 noundef zeroext false, ptr noundef @.str.1, i32 noundef 28, i32 noundef 0, ptr noundef @__FUNCTION__._ZN19AttributeCollectionC2EPP23stack_st_X509_ATTRIBUTE6HandleI7SObjectE, ptr noundef @__FUNCTION__._ZN19AttributeCollection4pushE6HandleI9AttributeE, ptr noundef %10, ptr noundef @.str.2)
          to label %53 unwind label %69

53:                                               ; preds = %52
  store i1 false, ptr %11, align 1
  invoke void @_ZN6HandleI9ExceptionEC2EPS0_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef %50)
          to label %54 unwind label %69

54:                                               ; preds = %53
  call void @_ZN6HandleI9ExceptionED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %10) #8
  %55 = call ptr @__cxa_allocate_exception(i64 8) #8
  invoke void @_ZN6HandleI9ExceptionEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(8) %55, ptr noundef nonnull align 8 dereferenceable(8) %9)
          to label %56 unwind label %77

56:                                               ; preds = %54
  invoke void @__cxa_throw(ptr %55, ptr @_ZTI6HandleI9ExceptionE, ptr @_ZN6HandleI9ExceptionED2Ev) #10
          to label %106 unwind label %81

57:                                               ; preds = %96, %93, %91, %89, %87, %47, %42, %40, %38
  %58 = landingpad { ptr, i32 }
          cleanup
  %59 = extractvalue { ptr, i32 } %58, 0
  store ptr %59, ptr %6, align 8
  %60 = extractvalue { ptr, i32 } %58, 1
  store i32 %60, ptr %7, align 4
  br label %99

61:                                               ; preds = %49
  %62 = landingpad { ptr, i32 }
          cleanup
  %63 = extractvalue { ptr, i32 } %62, 0
  store ptr %63, ptr %6, align 8
  %64 = extractvalue { ptr, i32 } %62, 1
  store i32 %64, ptr %7, align 4
  br label %86

65:                                               ; preds = %51
  %66 = landingpad { ptr, i32 }
          cleanup
  %67 = extractvalue { ptr, i32 } %66, 0
  store ptr %67, ptr %6, align 8
  %68 = extractvalue { ptr, i32 } %66, 1
  store i32 %68, ptr %7, align 4
  br label %73

69:                                               ; preds = %53, %52
  %70 = landingpad { ptr, i32 }
          cleanup
  %71 = extractvalue { ptr, i32 } %70, 0
  store ptr %71, ptr %6, align 8
  %72 = extractvalue { ptr, i32 } %70, 1
  store i32 %72, ptr %7, align 4
  call void @_ZN6HandleI9ExceptionED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %10) #8
  br label %73

73:                                               ; preds = %69, %65
  %74 = load i1, ptr %11, align 1
  br i1 %74, label %75, label %76

75:                                               ; preds = %73
  call void @_ZdlPvm(ptr noundef %50, i64 noundef 176) #11
  br label %76

76:                                               ; preds = %75, %73
  br label %86

77:                                               ; preds = %54
  %78 = landingpad { ptr, i32 }
          cleanup
  %79 = extractvalue { ptr, i32 } %78, 0
  store ptr %79, ptr %6, align 8
  %80 = extractvalue { ptr, i32 } %78, 1
  store i32 %80, ptr %7, align 4
  call void @__cxa_free_exception(ptr %55) #8
  br label %85

81:                                               ; preds = %56
  %82 = landingpad { ptr, i32 }
          cleanup
  %83 = extractvalue { ptr, i32 } %82, 0
  store ptr %83, ptr %6, align 8
  %84 = extractvalue { ptr, i32 } %82, 1
  store i32 %84, ptr %7, align 4
  br label %85

85:                                               ; preds = %81, %77
  call void @_ZN6HandleI9ExceptionED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %9) #8
  br label %86

86:                                               ; preds = %85, %76, %61
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #8
  br label %99

87:                                               ; preds = %44
  %88 = load ptr, ptr @logger, align 8, !tbaa !5
  invoke void (ptr, i32, ptr, ptr, ...) @_ZN6Logger5writeEN11LoggerLevel12LOGGER_LEVELEPKcS3_z(ptr noundef nonnull align 8 dereferenceable(24) %88, i32 noundef 32, ptr noundef @__FUNCTION__._ZN19AttributeCollection4pushE6HandleI9AttributeE, ptr noundef @.str.3)
          to label %89 unwind label %57

89:                                               ; preds = %87
  %90 = invoke noundef ptr @_ZN9SSLObjectI23stack_st_X509_ATTRIBUTEE8internalEv(ptr noundef nonnull align 8 dereferenceable(16) %12)
          to label %91 unwind label %57

91:                                               ; preds = %89
  %92 = invoke noundef ptr @_ZL33ossl_check_X509_ATTRIBUTE_sk_typeP23stack_st_X509_ATTRIBUTE(ptr noundef %90)
          to label %93 unwind label %57

93:                                               ; preds = %91
  %94 = load ptr, ptr %8, align 8, !tbaa !5
  %95 = invoke noundef ptr @_ZL30ossl_check_X509_ATTRIBUTE_typeP18x509_attributes_st(ptr noundef %94)
          to label %96 unwind label %57

96:                                               ; preds = %93
  %97 = invoke i32 @OPENSSL_sk_push(ptr noundef %92, ptr noundef %95)
          to label %98 unwind label %57

98:                                               ; preds = %96
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  call void @_ZN14LoggerFunctionD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %5) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %5) #8
  ret void

99:                                               ; preds = %86, %57
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  br label %100

100:                                              ; preds = %99, %31
  call void @_ZN14LoggerFunctionD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %5) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %5) #8
  br label %101

101:                                              ; preds = %100
  %102 = load ptr, ptr %6, align 8
  %103 = load i32, ptr %7, align 4
  %104 = insertvalue { ptr, i32 } poison, ptr %102, 0
  %105 = insertvalue { ptr, i32 } %104, i32 %103, 1
  resume { ptr, i32 } %105

106:                                              ; preds = %56
  unreachable
}

declare void @_ZN6Logger5writeEN11LoggerLevel12LOGGER_LEVELEPKcS3_z(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef, ptr noundef, ptr noundef, ...) #0

declare ptr @X509_ATTRIBUTE_dup(ptr noundef) #0

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef ptr @_ZL33ossl_check_X509_ATTRIBUTE_sk_typeP23stack_st_X509_ATTRIBUTE(ptr noundef) #7

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef ptr @_ZL30ossl_check_X509_ATTRIBUTE_typeP18x509_attributes_st(ptr noundef) #7

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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nobuiltin allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 #5 = { nobuiltin nounwind "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 #6 = { nounwind "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 #7 = { inlinehint 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 #8 = { nounwind }
attributes #9 = { builtin allocsize(0) }
attributes #10 = { noreturn }
attributes #11 = { builtin 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, !6, i64 16}
!10 = !{!"_ZTS19AttributeCollection", !11, i64 0, !6, i64 16}
!11 = !{!"_ZTS9SSLObjectI23stack_st_X509_ATTRIBUTEE", !6, i64 0, !12, i64 8}
!12 = !{!"_ZTS6HandleI7SObjectE", !6, 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.LoggerFunction = type { %class.Handle.0, ptr }
%class.Handle.0 = type { ptr }
%class.Handle.1 = type { ptr }

@logger = external local_unnamed_addr global ptr, align 8
@__FUNCTION__._ZN19AttributeCollectionC2EPP23stack_st_X509_ATTRIBUTE6HandleI7SObjectE = external hidden unnamed_addr constant [20 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [93 x i8], align 1
@_ZTI6HandleI9ExceptionE = external dso_local constant { ptr, ptr }, align 8
@__FUNCTION__._ZN19AttributeCollection4pushE6HandleI9AttributeE = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [23 x i8], align 1

declare ptr @OPENSSL_sk_new_null() local_unnamed_addr #0

declare i32 @__gxx_personality_v0(...)

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

declare void @_ZN14LoggerFunctionC1EP6LoggerPKc(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef, ptr noundef) unnamed_addr #0

declare void @_ZN6Logger5errorEPKcS1_z(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef, ptr noundef, ...) local_unnamed_addr #0

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) local_unnamed_addr #2

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

declare void @_ZN9ExceptionC1EbPKciiS1_S1_6HandleIS_ES1_z(ptr noundef nonnull align 8 dereferenceable(176), i1 noundef zeroext, ptr noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ...) unnamed_addr #0

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

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) local_unnamed_addr #5

declare ptr @__cxa_allocate_exception(i64) local_unnamed_addr

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

declare void @__cxa_throw(ptr, ptr, ptr) local_unnamed_addr

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

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

; Function Attrs: nounwind
declare void @_ZN14LoggerFunctionD1Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #6

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN19AttributeCollection4pushE6HandleI9AttributeE(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef %1) local_unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %class.LoggerFunction, align 8
  %4 = alloca %class.Handle.1, align 8
  %5 = alloca %class.Handle.1, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #8
  %6 = load ptr, ptr @logger, align 8, !tbaa !5
  call void @_ZN14LoggerFunctionC1EP6LoggerPKc(ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef %6, ptr noundef nonnull @__FUNCTION__._ZN19AttributeCollection4pushE6HandleI9AttributeE)
  %7 = getelementptr inbounds i8, ptr %0, i64 16
  %8 = load ptr, ptr %7, align 8, !tbaa !9
  %.not = icmp eq ptr %8, null
  br i1 %.not, label %19, label %9

9:                                                ; preds = %2
  %10 = load ptr, ptr %8, align 8, !tbaa !5
  %.not13 = icmp eq ptr %10, null
  br i1 %.not13, label %11, label %19

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

13:                                               ; preds = %11
  %14 = load ptr, ptr %7, align 8, !tbaa !9
  store ptr %12, ptr %14, align 8, !tbaa !5
  %15 = load ptr, ptr %7, align 8, !tbaa !9
  %16 = load ptr, ptr %15, align 8, !tbaa !5
  invoke void @_ZN9SSLObjectI23stack_st_X509_ATTRIBUTEE7setDataEPS0_(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef %16)
          to label %19 unwind label %17

17:                                               ; preds = %19, %13, %11
  %18 = landingpad { ptr, i32 }
          cleanup
  br label %57

19:                                               ; preds = %9, %13, %2
  %20 = load ptr, ptr @logger, align 8, !tbaa !5
  invoke void (ptr, i32, ptr, ptr, ...) @_ZN6Logger5writeEN11LoggerLevel12LOGGER_LEVELEPKcS3_z(ptr noundef nonnull align 8 dereferenceable(24) %20, i32 noundef 32, ptr noundef nonnull @__FUNCTION__._ZN19AttributeCollection4pushE6HandleI9AttributeE, ptr noundef nonnull @.str.2)
          to label %21 unwind label %17

21:                                               ; preds = %19
  %22 = invoke noundef ptr @_ZNK6HandleI9AttributeEptEv(ptr noundef nonnull align 8 dereferenceable(8) %1)
          to label %23 unwind label %38

23:                                               ; preds = %21
  %24 = invoke noundef ptr @_ZN9SSLObjectI18x509_attributes_stE8internalEv(ptr noundef nonnull align 8 dereferenceable(16) %22)
          to label %25 unwind label %38

25:                                               ; preds = %23
  %26 = invoke ptr @X509_ATTRIBUTE_dup(ptr noundef %24)
          to label %27 unwind label %38

27:                                               ; preds = %25
  %.not14 = icmp eq ptr %26, null
  %28 = load ptr, ptr @logger, align 8, !tbaa !5
  br i1 %.not14, label %29, label %49

29:                                               ; preds = %27
  invoke void (ptr, ptr, ptr, ...) @_ZN6Logger5errorEPKcS1_z(ptr noundef nonnull align 8 dereferenceable(24) %28, ptr noundef nonnull @__FUNCTION__._ZN19AttributeCollection4pushE6HandleI9AttributeE, ptr noundef nonnull @.str.2)
          to label %30 unwind label %38

30:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #8
  %31 = invoke noalias noundef nonnull dereferenceable(176) ptr @_Znwm(i64 noundef 176) #9
          to label %32 unwind label %40

32:                                               ; preds = %30
  invoke void @_ZN6HandleI9ExceptionEC2EPS0_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef null)
          to label %33 unwind label %.thread

33:                                               ; preds = %32
  invoke void (ptr, i1, ptr, i32, i32, ptr, ptr, ptr, ptr, ...) @_ZN9ExceptionC1EbPKciiS1_S1_6HandleIS_ES1_z(ptr noundef nonnull align 8 dereferenceable(176) %31, i1 noundef zeroext false, ptr noundef nonnull @.str.1, i32 noundef 28, i32 noundef 0, ptr noundef nonnull @__FUNCTION__._ZN19AttributeCollectionC2EPP23stack_st_X509_ATTRIBUTE6HandleI7SObjectE, ptr noundef nonnull @__FUNCTION__._ZN19AttributeCollection4pushE6HandleI9AttributeE, ptr noundef nonnull %5, ptr noundef nonnull @.str.2)
          to label %35 unwind label %.thread24

.thread24:                                        ; preds = %33
  %34 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN6HandleI9ExceptionED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #8
  br label %45

35:                                               ; preds = %33
  invoke void @_ZN6HandleI9ExceptionEC2EPS0_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull %31)
          to label %36 unwind label %43

36:                                               ; preds = %35
  call void @_ZN6HandleI9ExceptionED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #8
  %37 = call ptr @__cxa_allocate_exception(i64 8) #8
  call void @_ZN6HandleI9ExceptionEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(8) %37, ptr noundef nonnull align 8 dereferenceable(8) %4)
  invoke void @__cxa_throw(ptr nonnull %37, ptr nonnull @_ZTI6HandleI9ExceptionE, ptr nonnull @_ZN6HandleI9ExceptionED2Ev) #10
          to label %58 unwind label %46

38:                                               ; preds = %52, %50, %49, %29, %25, %23, %21
  %39 = landingpad { ptr, i32 }
          cleanup
  br label %57

40:                                               ; preds = %30
  %41 = landingpad { ptr, i32 }
          cleanup
  br label %48

.thread:                                          ; preds = %32
  %42 = landingpad { ptr, i32 }
          cleanup
  br label %45

43:                                               ; preds = %35
  %44 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN6HandleI9ExceptionED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #8
  br label %48

45:                                               ; preds = %.thread24, %.thread
  %.pn23 = phi { ptr, i32 } [ %42, %.thread ], [ %34, %.thread24 ]
  call void @_ZdlPvm(ptr noundef nonnull %31, i64 noundef 176) #11
  br label %48

46:                                               ; preds = %36
  %47 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN6HandleI9ExceptionED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %4) #8
  br label %48

48:                                               ; preds = %43, %45, %46, %40
  %.pn16 = phi { ptr, i32 } [ %47, %46 ], [ %.pn23, %45 ], [ %44, %43 ], [ %41, %40 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #8
  br label %57

49:                                               ; preds = %27
  invoke void (ptr, i32, ptr, ptr, ...) @_ZN6Logger5writeEN11LoggerLevel12LOGGER_LEVELEPKcS3_z(ptr noundef nonnull align 8 dereferenceable(24) %28, i32 noundef 32, ptr noundef nonnull @__FUNCTION__._ZN19AttributeCollection4pushE6HandleI9AttributeE, ptr noundef nonnull @.str.3)
          to label %50 unwind label %38

50:                                               ; preds = %49
  %51 = invoke noundef ptr @_ZN9SSLObjectI23stack_st_X509_ATTRIBUTEE8internalEv(ptr noundef nonnull align 8 dereferenceable(16) %0)
          to label %52 unwind label %38

52:                                               ; preds = %50
  %53 = call noundef ptr @_ZL33ossl_check_X509_ATTRIBUTE_sk_typeP23stack_st_X509_ATTRIBUTE(ptr noundef %51)
  %54 = call noundef ptr @_ZL30ossl_check_X509_ATTRIBUTE_typeP18x509_attributes_st(ptr noundef nonnull %26)
  %55 = invoke i32 @OPENSSL_sk_push(ptr noundef %53, ptr noundef %54)
          to label %56 unwind label %38

56:                                               ; preds = %52
  call void @_ZN14LoggerFunctionD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %3) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #8
  ret void

57:                                               ; preds = %38, %48, %17
  %.pn18.pn = phi { ptr, i32 } [ %18, %17 ], [ %39, %38 ], [ %.pn16, %48 ]
  call void @_ZN14LoggerFunctionD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %3) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #8
  resume { ptr, i32 } %.pn18.pn

58:                                               ; preds = %36
  unreachable
}

declare void @_ZN6Logger5writeEN11LoggerLevel12LOGGER_LEVELEPKcS3_z(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef, ptr noundef, ptr noundef, ...) local_unnamed_addr #0

declare ptr @X509_ATTRIBUTE_dup(ptr noundef) local_unnamed_addr #0

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef ptr @_ZL33ossl_check_X509_ATTRIBUTE_sk_typeP23stack_st_X509_ATTRIBUTE(ptr noundef) local_unnamed_addr #7

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef ptr @_ZL30ossl_check_X509_ATTRIBUTE_typeP18x509_attributes_st(ptr noundef) local_unnamed_addr #7

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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nobuiltin allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 #5 = { nobuiltin nounwind "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 #6 = { nounwind "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 #7 = { inlinehint 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 #8 = { nounwind }
attributes #9 = { builtin allocsize(0) }
attributes #10 = { noreturn }
attributes #11 = { builtin 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, !6, i64 16}
!10 = !{!"_ZTS19AttributeCollection", !11, i64 0, !6, i64 16}
!11 = !{!"_ZTS9SSLObjectI23stack_st_X509_ATTRIBUTEE", !6, i64 0, !12, i64 8}
!12 = !{!"_ZTS6HandleI7SObjectE", !6, i64 0}


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