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

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

@logger = external global ptr, align 8
@__FUNCTION__._ZN21CertificateCollection5itemsEi = external hidden unnamed_addr constant [6 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [93 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [3 x i8], align 1
@_ZTI6HandleI9ExceptionE = external dso_local constant { ptr, ptr }, align 8

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

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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN9SSLObjectI13stack_st_X509E6handleEv(ptr dead_on_unwind noalias writable sret(%class.Handle.1) align 8, ptr noundef nonnull align 8 dereferenceable(16)) #2 align 2

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN21CertificateCollection5itemsEi(ptr dead_on_unwind noalias writable sret(%class.Handle) align 8 %0, ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef %2) #2 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca %class.LoggerFunction, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca %class.Handle.3, align 8
  %12 = alloca %class.Handle.3, align 8
  %13 = alloca i1, align 1
  %14 = alloca %class.Handle.1, align 8
  %15 = alloca i1, align 1
  store ptr %0, ptr %4, align 8
  store ptr %1, ptr %5, align 8, !tbaa !5
  store i32 %2, ptr %6, align 4, !tbaa !9
  %16 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %7) #8
  %17 = load ptr, ptr @logger, align 8, !tbaa !5
  call void @_ZN14LoggerFunctionC1EP6LoggerPKc(ptr noundef nonnull align 8 dereferenceable(16) %7, ptr noundef %17, ptr noundef @__FUNCTION__._ZN21CertificateCollection5itemsEi)
  %18 = load ptr, ptr @logger, align 8, !tbaa !5
  invoke void (ptr, i32, ptr, ptr, ...) @_ZN6Logger5writeEN11LoggerLevel12LOGGER_LEVELEPKcS3_z(ptr noundef nonnull align 8 dereferenceable(24) %18, i32 noundef 32, ptr noundef @__FUNCTION__._ZN21CertificateCollection5itemsEi, ptr noundef @.str.3)
          to label %19 unwind label %43

19:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #8
  %20 = invoke noundef ptr @_ZN9SSLObjectI13stack_st_X509E8internalEv(ptr noundef nonnull align 8 dereferenceable(16) %16)
          to label %21 unwind label %47

21:                                               ; preds = %19
  %22 = invoke noundef ptr @_ZL29ossl_check_const_X509_sk_typePK13stack_st_X509(ptr noundef %20)
          to label %23 unwind label %47

23:                                               ; preds = %21
  %24 = load i32, ptr %6, align 4, !tbaa !9
  %25 = invoke ptr @OPENSSL_sk_value(ptr noundef %22, i32 noundef %24)
          to label %26 unwind label %47

26:                                               ; preds = %23
  store ptr %25, ptr %10, align 8, !tbaa !5
  %27 = load ptr, ptr %10, align 8, !tbaa !5
  %28 = icmp ne ptr %27, null
  br i1 %28, label %77, label %29

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

31:                                               ; preds = %29
  store i1 true, ptr %13, align 1
  invoke void @_ZN6HandleI9ExceptionEC2EPS0_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef null)
          to label %32 unwind label %55

32:                                               ; preds = %31
  %33 = load i32, ptr %6, align 4, !tbaa !9
  invoke void (ptr, i1, ptr, i32, i32, ptr, ptr, ptr, ptr, ...) @_ZN9ExceptionC1EbPKciiS1_S1_6HandleIS_ES1_z(ptr noundef nonnull align 8 dereferenceable(176) %30, i1 noundef zeroext true, ptr noundef @.str.4, i32 noundef 37, i32 noundef 0, ptr noundef @.str.5, ptr noundef @__FUNCTION__._ZN21CertificateCollection5itemsEi, ptr noundef %12, ptr noundef @.str.6, i32 noundef %33)
          to label %34 unwind label %59

34:                                               ; preds = %32
  store i1 false, ptr %13, align 1
  invoke void @_ZN6HandleI9ExceptionEC2EPS0_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef %30)
          to label %35 unwind label %59

35:                                               ; preds = %34
  call void @_ZN6HandleI9ExceptionED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %12) #8
  %36 = load ptr, ptr @logger, align 8, !tbaa !5
  %37 = invoke noundef ptr @_ZNK6HandleI9ExceptionEptEv(ptr noundef nonnull align 8 dereferenceable(8) %11)
          to label %38 unwind label %67

38:                                               ; preds = %35
  %39 = call noundef ptr @_ZNK9Exception4whatEv(ptr noundef nonnull align 8 dereferenceable(176) %37) #8
  invoke void (ptr, ptr, ptr, ...) @_ZN6Logger4warnEPKcS1_z(ptr noundef nonnull align 8 dereferenceable(24) %36, ptr noundef @__FUNCTION__._ZN21CertificateCollection5itemsEi, ptr noundef @.str.7, ptr noundef %39)
          to label %40 unwind label %67

40:                                               ; preds = %38
  %41 = call ptr @__cxa_allocate_exception(i64 8) #8
  invoke void @_ZN6HandleI9ExceptionEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(8) %41, ptr noundef nonnull align 8 dereferenceable(8) %11)
          to label %42 unwind label %71

42:                                               ; preds = %40
  invoke void @__cxa_throw(ptr %41, ptr @_ZTI6HandleI9ExceptionE, ptr @_ZN6HandleI9ExceptionED2Ev) #10
          to label %103 unwind label %67

43:                                               ; preds = %3
  %44 = landingpad { ptr, i32 }
          cleanup
  %45 = extractvalue { ptr, i32 } %44, 0
  store ptr %45, ptr %8, align 8
  %46 = extractvalue { ptr, i32 } %44, 1
  store i32 %46, ptr %9, align 4
  br label %97

47:                                               ; preds = %77, %23, %21, %19
  %48 = landingpad { ptr, i32 }
          cleanup
  %49 = extractvalue { ptr, i32 } %48, 0
  store ptr %49, ptr %8, align 8
  %50 = extractvalue { ptr, i32 } %48, 1
  store i32 %50, ptr %9, align 4
  br label %96

51:                                               ; preds = %29
  %52 = landingpad { ptr, i32 }
          cleanup
  %53 = extractvalue { ptr, i32 } %52, 0
  store ptr %53, ptr %8, align 8
  %54 = extractvalue { ptr, i32 } %52, 1
  store i32 %54, ptr %9, align 4
  br label %76

55:                                               ; preds = %31
  %56 = landingpad { ptr, i32 }
          cleanup
  %57 = extractvalue { ptr, i32 } %56, 0
  store ptr %57, ptr %8, align 8
  %58 = extractvalue { ptr, i32 } %56, 1
  store i32 %58, ptr %9, align 4
  br label %63

59:                                               ; preds = %34, %32
  %60 = landingpad { ptr, i32 }
          cleanup
  %61 = extractvalue { ptr, i32 } %60, 0
  store ptr %61, ptr %8, align 8
  %62 = extractvalue { ptr, i32 } %60, 1
  store i32 %62, ptr %9, align 4
  call void @_ZN6HandleI9ExceptionED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %12) #8
  br label %63

63:                                               ; preds = %59, %55
  %64 = load i1, ptr %13, align 1
  br i1 %64, label %65, label %66

65:                                               ; preds = %63
  call void @_ZdlPvm(ptr noundef %30, i64 noundef 176) #11
  br label %66

66:                                               ; preds = %65, %63
  br label %76

67:                                               ; preds = %42, %38, %35
  %68 = landingpad { ptr, i32 }
          cleanup
  %69 = extractvalue { ptr, i32 } %68, 0
  store ptr %69, ptr %8, align 8
  %70 = extractvalue { ptr, i32 } %68, 1
  store i32 %70, ptr %9, align 4
  br label %75

71:                                               ; preds = %40
  %72 = landingpad { ptr, i32 }
          cleanup
  %73 = extractvalue { ptr, i32 } %72, 0
  store ptr %73, ptr %8, align 8
  %74 = extractvalue { ptr, i32 } %72, 1
  store i32 %74, ptr %9, align 4
  call void @__cxa_free_exception(ptr %41) #8
  br label %75

75:                                               ; preds = %71, %67
  call void @_ZN6HandleI9ExceptionED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %11) #8
  br label %76

76:                                               ; preds = %75, %66, %51
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #8
  br label %96

77:                                               ; preds = %26
  %78 = invoke noalias noundef nonnull ptr @_Znwm(i64 noundef 16) #9
          to label %79 unwind label %47

79:                                               ; preds = %77
  store i1 true, ptr %15, align 1
  %80 = load ptr, ptr %10, align 8, !tbaa !5
  invoke void @_ZN9SSLObjectI13stack_st_X509E6handleEv(ptr dead_on_unwind writable sret(%class.Handle.1) align 8 %14, ptr noundef nonnull align 8 dereferenceable(16) %16)
          to label %81 unwind label %84

81:                                               ; preds = %79
  invoke void @_ZN11CertificateC2EP7x509_st6HandleI7SObjectE(ptr noundef nonnull align 8 dereferenceable(16) %78, ptr noundef %80, ptr noundef %14)
          to label %82 unwind label %88

82:                                               ; preds = %81
  store i1 false, ptr %15, align 1
  invoke void @_ZN6HandleI11CertificateEC2EPS0_(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef %78)
          to label %83 unwind label %88

83:                                               ; preds = %82
  call void @_ZN6HandleI7SObjectED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %14) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #8
  call void @_ZN14LoggerFunctionD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %7) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #8
  ret void

84:                                               ; preds = %79
  %85 = landingpad { ptr, i32 }
          cleanup
  %86 = extractvalue { ptr, i32 } %85, 0
  store ptr %86, ptr %8, align 8
  %87 = extractvalue { ptr, i32 } %85, 1
  store i32 %87, ptr %9, align 4
  br label %92

88:                                               ; preds = %82, %81
  %89 = landingpad { ptr, i32 }
          cleanup
  %90 = extractvalue { ptr, i32 } %89, 0
  store ptr %90, ptr %8, align 8
  %91 = extractvalue { ptr, i32 } %89, 1
  store i32 %91, ptr %9, align 4
  call void @_ZN6HandleI7SObjectED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %14) #8
  br label %92

92:                                               ; preds = %88, %84
  %93 = load i1, ptr %15, align 1
  br i1 %93, label %94, label %95

94:                                               ; preds = %92
  call void @_ZdlPvm(ptr noundef %78, i64 noundef 16) #11
  br label %95

95:                                               ; preds = %94, %92
  br label %96

96:                                               ; preds = %95, %76, %47
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #8
  br label %97

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

98:                                               ; preds = %97
  %99 = load ptr, ptr %8, align 8
  %100 = load i32, ptr %9, align 4
  %101 = insertvalue { ptr, i32 } poison, ptr %99, 0
  %102 = insertvalue { ptr, i32 } %101, i32 %100, 1
  resume { ptr, i32 } %102

103:                                              ; preds = %42
  unreachable
}

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6HandleI9ExceptionEC2EPS0_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) unnamed_addr #2 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 #1

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

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

declare void @_ZN6Logger4warnEPKcS1_z(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef, ptr noundef, ...) #1

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

; Function Attrs: nounwind
declare noundef ptr @_ZNK9Exception4whatEv(ptr noundef nonnull align 8 dereferenceable(176)) #4

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 #3 align 2

declare void @__cxa_free_exception(ptr)

declare void @__cxa_throw(ptr, ptr, ptr)

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

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

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

@logger = external local_unnamed_addr global ptr, align 8
@__FUNCTION__._ZN21CertificateCollection5itemsEi = external hidden unnamed_addr constant [6 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [93 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [3 x i8], align 1
@_ZTI6HandleI9ExceptionE = external dso_local constant { ptr, ptr }, align 8

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

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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN9SSLObjectI13stack_st_X509E6handleEv(ptr dead_on_unwind noalias writable sret(%class.Handle.1) align 8, ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #2 align 2

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN21CertificateCollection5itemsEi(ptr dead_on_unwind noalias writable sret(%class.Handle) align 8 %0, ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef %2) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %class.LoggerFunction, align 8
  %5 = alloca %class.Handle.3, align 8
  %6 = alloca %class.Handle.3, align 8
  %7 = alloca %class.Handle.1, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #8
  %8 = load ptr, ptr @logger, align 8, !tbaa !5
  call void @_ZN14LoggerFunctionC1EP6LoggerPKc(ptr noundef nonnull align 8 dereferenceable(16) %4, ptr noundef %8, ptr noundef nonnull @__FUNCTION__._ZN21CertificateCollection5itemsEi)
  %9 = load ptr, ptr @logger, align 8, !tbaa !5
  invoke void (ptr, i32, ptr, ptr, ...) @_ZN6Logger5writeEN11LoggerLevel12LOGGER_LEVELEPKcS3_z(ptr noundef nonnull align 8 dereferenceable(24) %9, i32 noundef 32, ptr noundef nonnull @__FUNCTION__._ZN21CertificateCollection5itemsEi, ptr noundef nonnull @.str.3)
          to label %10 unwind label %29

10:                                               ; preds = %3
  %11 = invoke noundef ptr @_ZN9SSLObjectI13stack_st_X509E8internalEv(ptr noundef nonnull align 8 dereferenceable(16) %1)
          to label %12 unwind label %31

12:                                               ; preds = %10
  %13 = call noundef ptr @_ZL29ossl_check_const_X509_sk_typePK13stack_st_X509(ptr noundef %11)
  %14 = invoke ptr @OPENSSL_sk_value(ptr noundef %13, i32 noundef %2)
          to label %15 unwind label %31

15:                                               ; preds = %12
  %.not = icmp eq ptr %14, null
  br i1 %.not, label %16, label %42

16:                                               ; preds = %15
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #8
  %17 = invoke noalias noundef nonnull dereferenceable(176) ptr @_Znwm(i64 noundef 176) #9
          to label %18 unwind label %33

18:                                               ; preds = %16
  invoke void @_ZN6HandleI9ExceptionEC2EPS0_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef null)
          to label %19 unwind label %.thread

19:                                               ; preds = %18
  invoke void (ptr, i1, ptr, i32, i32, ptr, ptr, ptr, ptr, ...) @_ZN9ExceptionC1EbPKciiS1_S1_6HandleIS_ES1_z(ptr noundef nonnull align 8 dereferenceable(176) %17, i1 noundef zeroext true, ptr noundef nonnull @.str.4, i32 noundef 37, i32 noundef 0, ptr noundef nonnull @.str.5, ptr noundef nonnull @__FUNCTION__._ZN21CertificateCollection5itemsEi, ptr noundef nonnull %6, ptr noundef nonnull @.str.6, i32 noundef %2)
          to label %21 unwind label %.thread28

.thread28:                                        ; preds = %19
  %20 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN6HandleI9ExceptionED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6) #8
  br label %38

21:                                               ; preds = %19
  invoke void @_ZN6HandleI9ExceptionEC2EPS0_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull %17)
          to label %22 unwind label %36

22:                                               ; preds = %21
  call void @_ZN6HandleI9ExceptionED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6) #8
  %23 = load ptr, ptr @logger, align 8, !tbaa !5
  %24 = invoke noundef ptr @_ZNK6HandleI9ExceptionEptEv(ptr noundef nonnull align 8 dereferenceable(8) %5)
          to label %25 unwind label %39

25:                                               ; preds = %22
  %26 = call noundef ptr @_ZNK9Exception4whatEv(ptr noundef nonnull align 8 dereferenceable(176) %24) #8
  invoke void (ptr, ptr, ptr, ...) @_ZN6Logger4warnEPKcS1_z(ptr noundef nonnull align 8 dereferenceable(24) %23, ptr noundef nonnull @__FUNCTION__._ZN21CertificateCollection5itemsEi, ptr noundef nonnull @.str.7, ptr noundef %26)
          to label %27 unwind label %39

27:                                               ; preds = %25
  %28 = call ptr @__cxa_allocate_exception(i64 8) #8
  call void @_ZN6HandleI9ExceptionEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(8) %28, ptr noundef nonnull align 8 dereferenceable(8) %5)
  invoke void @__cxa_throw(ptr nonnull %28, ptr nonnull @_ZTI6HandleI9ExceptionE, ptr nonnull @_ZN6HandleI9ExceptionED2Ev) #10
          to label %54 unwind label %39

29:                                               ; preds = %3
  %30 = landingpad { ptr, i32 }
          cleanup
  br label %53

31:                                               ; preds = %42, %12, %10
  %32 = landingpad { ptr, i32 }
          cleanup
  br label %53

33:                                               ; preds = %16
  %34 = landingpad { ptr, i32 }
          cleanup
  br label %41

.thread:                                          ; preds = %18
  %35 = landingpad { ptr, i32 }
          cleanup
  br label %38

36:                                               ; preds = %21
  %37 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN6HandleI9ExceptionED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6) #8
  br label %41

38:                                               ; preds = %.thread28, %.thread
  %.pn27 = phi { ptr, i32 } [ %35, %.thread ], [ %20, %.thread28 ]
  call void @_ZdlPvm(ptr noundef nonnull %17, i64 noundef 176) #11
  br label %41

39:                                               ; preds = %27, %25, %22
  %40 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN6HandleI9ExceptionED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #8
  br label %41

41:                                               ; preds = %36, %38, %39, %33
  %.pn19 = phi { ptr, i32 } [ %40, %39 ], [ %.pn27, %38 ], [ %37, %36 ], [ %34, %33 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #8
  br label %53

42:                                               ; preds = %15
  %43 = invoke noalias noundef nonnull dereferenceable(16) ptr @_Znwm(i64 noundef 16) #9
          to label %44 unwind label %31

44:                                               ; preds = %42
  invoke void @_ZN9SSLObjectI13stack_st_X509E6handleEv(ptr dead_on_unwind nonnull writable sret(%class.Handle.1) align 8 %7, ptr noundef nonnull align 8 dereferenceable(16) %1)
          to label %45 unwind label %.thread30

45:                                               ; preds = %44
  invoke void @_ZN11CertificateC2EP7x509_st6HandleI7SObjectE(ptr noundef nonnull align 8 dereferenceable(16) %43, ptr noundef nonnull %14, ptr noundef nonnull %7)
          to label %47 unwind label %.thread34

.thread34:                                        ; preds = %45
  %46 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN6HandleI7SObjectED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %7) #8
  br label %52

47:                                               ; preds = %45
  invoke void @_ZN6HandleI11CertificateEC2EPS0_(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef nonnull %43)
          to label %48 unwind label %50

48:                                               ; preds = %47
  call void @_ZN6HandleI7SObjectED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %7) #8
  call void @_ZN14LoggerFunctionD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %4) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #8
  ret void

.thread30:                                        ; preds = %44
  %49 = landingpad { ptr, i32 }
          cleanup
  br label %52

50:                                               ; preds = %47
  %51 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN6HandleI7SObjectED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %7) #8
  br label %53

52:                                               ; preds = %.thread34, %.thread30
  %.pn2133 = phi { ptr, i32 } [ %49, %.thread30 ], [ %46, %.thread34 ]
  call void @_ZdlPvm(ptr noundef nonnull %43, i64 noundef 16) #11
  br label %53

53:                                               ; preds = %50, %31, %41, %52, %29
  %.pn21.pn.pn = phi { ptr, i32 } [ %30, %29 ], [ %.pn2133, %52 ], [ %51, %50 ], [ %32, %31 ], [ %.pn19, %41 ]
  call void @_ZN14LoggerFunctionD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %4) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #8
  resume { ptr, i32 } %.pn21.pn.pn

54:                                               ; preds = %27
  unreachable
}

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6HandleI9ExceptionEC2EPS0_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) unnamed_addr #2 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 #1

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

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

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

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

; Function Attrs: nounwind
declare noundef ptr @_ZNK9Exception4whatEv(ptr noundef nonnull align 8 dereferenceable(176)) local_unnamed_addr #4

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 #3 align 2

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

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

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

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


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