; LLVM IR from Trusted-eSign/trusted-crypto :: deps/wrapper/src/cms (signed_data)

; 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.13 = type { ptr }
%class.LoggerFunction = type { %class.Handle.0, ptr }
%class.Handle.0 = type { ptr }
%class.Handle.8 = type { ptr }
%class.Handle.1 = type { ptr }
%class.SignedData = type <{ %class.SSLObject, %class.Handle.2, i32, [4 x i8] }>
%class.SSLObject = type { ptr, %class.Handle.1 }
%class.Handle.2 = type { ptr }

@logger = external global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [99 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [3 x i8], align 1
@_ZTI6HandleI9ExceptionE = external dso_local constant { ptr, ptr }, align 8
@__FUNCTION__._ZN10SignedData4signE6HandleI11CertificateES0_I3KeyES0_I21CertificateCollectionES0_I3BioEj = external hidden unnamed_addr constant [5 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [9 x i8], align 1

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

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

; 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 #6

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZNK6HandleI21CertificateCollectionEptEv(ptr noundef nonnull align 8 dereferenceable(8)) #3 align 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 #1

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

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

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

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: mustprogress uwtable
declare dso_local noundef ptr @_ZNK6HandleI3BioEptEv(ptr noundef nonnull align 8 dereferenceable(8)) #3 align 2

declare noundef ptr @_ZN3Bio8internalEv(ptr noundef nonnull align 8 dereferenceable(9)) #1

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

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

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

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

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

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

25:                                               ; preds = %6
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  %26 = invoke noundef ptr @_ZNK6HandleI11CertificateEptEv(ptr noundef nonnull align 8 dereferenceable(8) %1)
          to label %27 unwind label %64

27:                                               ; preds = %25
  %28 = invoke noundef ptr @_ZN9SSLObjectI7x509_stE8internalEv(ptr noundef nonnull align 8 dereferenceable(16) %26)
          to label %29 unwind label %64

29:                                               ; preds = %27
  %30 = invoke noundef ptr @_ZNK6HandleI3KeyEptEv(ptr noundef nonnull align 8 dereferenceable(8) %2)
          to label %31 unwind label %64

31:                                               ; preds = %29
  %32 = invoke noundef ptr @_ZN9SSLObjectI11evp_pkey_stE8internalEv(ptr noundef nonnull align 8 dereferenceable(16) %30)
          to label %33 unwind label %64

33:                                               ; preds = %31
  %34 = invoke noundef ptr @_ZNK6HandleI21CertificateCollectionEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3)
          to label %35 unwind label %64

35:                                               ; preds = %33
  %36 = invoke noundef ptr @_ZN9SSLObjectI13stack_st_X509E8internalEv(ptr noundef nonnull align 8 dereferenceable(16) %34)
          to label %37 unwind label %64

37:                                               ; preds = %35
  %38 = invoke noundef ptr @_ZNK6HandleI3BioEptEv(ptr noundef nonnull align 8 dereferenceable(8) %4)
          to label %39 unwind label %64

39:                                               ; preds = %37
  %40 = invoke noundef ptr @_ZN3Bio8internalEv(ptr noundef nonnull align 8 dereferenceable(9) %38)
          to label %41 unwind label %64

41:                                               ; preds = %39
  %42 = load i32, ptr %12, align 4, !tbaa !9
  %43 = invoke ptr @CMS_sign(ptr noundef %28, ptr noundef %32, ptr noundef %36, ptr noundef %40, i32 noundef %42)
          to label %44 unwind label %64

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

47:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  %48 = invoke noalias noundef nonnull ptr @_Znwm(i64 noundef 176) #8
          to label %49 unwind label %68

49:                                               ; preds = %47
  store i1 true, ptr %19, align 1
  invoke void @_ZN6HandleI9ExceptionEC2EPS0_(ptr noundef nonnull align 8 dereferenceable(8) %18, ptr noundef null)
          to label %50 unwind label %72

50:                                               ; preds = %49
  invoke void (ptr, i1, ptr, i32, i32, ptr, ptr, ptr, ptr, ...) @_ZN9ExceptionC1EbPKciiS1_S1_6HandleIS_ES1_z(ptr noundef nonnull align 8 dereferenceable(176) %48, i1 noundef zeroext true, ptr noundef @.str.2, i32 noundef 250, i32 noundef 0, ptr noundef @.str.3, ptr noundef @__FUNCTION__._ZN10SignedData4signE6HandleI11CertificateES0_I3KeyES0_I21CertificateCollectionES0_I3BioEj, ptr noundef %18, ptr noundef @.str.32)
          to label %51 unwind label %76

51:                                               ; preds = %50
  store i1 false, ptr %19, align 1
  invoke void @_ZN6HandleI9ExceptionEC2EPS0_(ptr noundef nonnull align 8 dereferenceable(8) %17, ptr noundef %48)
          to label %52 unwind label %76

52:                                               ; preds = %51
  call void @_ZN6HandleI9ExceptionED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %18) #7
  %53 = load ptr, ptr @logger, align 8, !tbaa !5
  %54 = invoke noundef ptr @_ZNK6HandleI9ExceptionEptEv(ptr noundef nonnull align 8 dereferenceable(8) %17)
          to label %55 unwind label %84

55:                                               ; preds = %52
  %56 = call noundef ptr @_ZNK9Exception4whatEv(ptr noundef nonnull align 8 dereferenceable(176) %54) #7
  invoke void (ptr, ptr, ptr, ...) @_ZN6Logger4warnEPKcS1_z(ptr noundef nonnull align 8 dereferenceable(24) %53, ptr noundef @__FUNCTION__._ZN10SignedData4signE6HandleI11CertificateES0_I3KeyES0_I21CertificateCollectionES0_I3BioEj, ptr noundef @.str.5, ptr noundef %56)
          to label %57 unwind label %84

57:                                               ; preds = %55
  %58 = call ptr @__cxa_allocate_exception(i64 8) #7
  invoke void @_ZN6HandleI9ExceptionEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(8) %58, ptr noundef nonnull align 8 dereferenceable(8) %17)
          to label %59 unwind label %88

59:                                               ; preds = %57
  invoke void @__cxa_throw(ptr %58, ptr @_ZTI6HandleI9ExceptionE, ptr @_ZN6HandleI9ExceptionED2Ev) #9
          to label %131 unwind label %84

60:                                               ; preds = %6
  %61 = landingpad { ptr, i32 }
          cleanup
  %62 = extractvalue { ptr, i32 } %61, 0
  store ptr %62, ptr %14, align 8
  %63 = extractvalue { ptr, i32 } %61, 1
  store i32 %63, ptr %15, align 4
  br label %125

64:                                               ; preds = %94, %41, %39, %37, %35, %33, %31, %29, %27, %25
  %65 = landingpad { ptr, i32 }
          cleanup
  %66 = extractvalue { ptr, i32 } %65, 0
  store ptr %66, ptr %14, align 8
  %67 = extractvalue { ptr, i32 } %65, 1
  store i32 %67, ptr %15, align 4
  br label %124

68:                                               ; preds = %47
  %69 = landingpad { ptr, i32 }
          cleanup
  %70 = extractvalue { ptr, i32 } %69, 0
  store ptr %70, ptr %14, align 8
  %71 = extractvalue { ptr, i32 } %69, 1
  store i32 %71, ptr %15, align 4
  br label %93

72:                                               ; preds = %49
  %73 = landingpad { ptr, i32 }
          cleanup
  %74 = extractvalue { ptr, i32 } %73, 0
  store ptr %74, ptr %14, align 8
  %75 = extractvalue { ptr, i32 } %73, 1
  store i32 %75, ptr %15, align 4
  br label %80

76:                                               ; preds = %51, %50
  %77 = landingpad { ptr, i32 }
          cleanup
  %78 = extractvalue { ptr, i32 } %77, 0
  store ptr %78, ptr %14, align 8
  %79 = extractvalue { ptr, i32 } %77, 1
  store i32 %79, ptr %15, align 4
  call void @_ZN6HandleI9ExceptionED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %18) #7
  br label %80

80:                                               ; preds = %76, %72
  %81 = load i1, ptr %19, align 1
  br i1 %81, label %82, label %83

82:                                               ; preds = %80
  call void @_ZdlPvm(ptr noundef %48, i64 noundef 176) #10
  br label %83

83:                                               ; preds = %82, %80
  br label %93

84:                                               ; preds = %59, %55, %52
  %85 = landingpad { ptr, i32 }
          cleanup
  %86 = extractvalue { ptr, i32 } %85, 0
  store ptr %86, ptr %14, align 8
  %87 = extractvalue { ptr, i32 } %85, 1
  store i32 %87, ptr %15, align 4
  br label %92

88:                                               ; preds = %57
  %89 = landingpad { ptr, i32 }
          cleanup
  %90 = extractvalue { ptr, i32 } %89, 0
  store ptr %90, ptr %14, align 8
  %91 = extractvalue { ptr, i32 } %89, 1
  store i32 %91, ptr %15, align 4
  call void @__cxa_free_exception(ptr %58) #7
  br label %92

92:                                               ; preds = %88, %84
  call void @_ZN6HandleI9ExceptionED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %17) #7
  br label %93

93:                                               ; preds = %92, %83, %68
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  br label %124

94:                                               ; preds = %44
  store i1 false, ptr %20, align 1
  %95 = invoke noalias noundef nonnull ptr @_Znwm(i64 noundef 32) #8
          to label %96 unwind label %64

96:                                               ; preds = %94
  store i1 true, ptr %22, align 1
  %97 = load ptr, ptr %16, align 8, !tbaa !5
  invoke void @_ZN6HandleI7SObjectEC2EPS0_(ptr noundef nonnull align 8 dereferenceable(8) %21, ptr noundef null)
          to label %98 unwind label %106

98:                                               ; preds = %96
  invoke void @_ZN10SignedDataC2EP18CMS_ContentInfo_st6HandleI7SObjectE(ptr noundef nonnull align 8 dereferenceable(28) %95, ptr noundef %97, ptr noundef %21)
          to label %99 unwind label %110

99:                                               ; preds = %98
  store i1 false, ptr %22, align 1
  invoke void @_ZN6HandleI10SignedDataEC2EPS0_(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef %95)
          to label %100 unwind label %110

100:                                              ; preds = %99
  call void @_ZN6HandleI7SObjectED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %21) #7
  %101 = load i32, ptr %12, align 4, !tbaa !9
  %102 = invoke noundef ptr @_ZNK6HandleI10SignedDataEptEv(ptr noundef nonnull align 8 dereferenceable(8) %0)
          to label %103 unwind label %118

103:                                              ; preds = %100
  %104 = getelementptr inbounds %class.SignedData, ptr %102, i32 0, i32 2
  store i32 %101, ptr %104, align 8, !tbaa !11
  store i1 true, ptr %20, align 1
  %105 = load i1, ptr %20, align 1
  br i1 %105, label %123, label %122

106:                                              ; preds = %96
  %107 = landingpad { ptr, i32 }
          cleanup
  %108 = extractvalue { ptr, i32 } %107, 0
  store ptr %108, ptr %14, align 8
  %109 = extractvalue { ptr, i32 } %107, 1
  store i32 %109, ptr %15, align 4
  br label %114

110:                                              ; preds = %99, %98
  %111 = landingpad { ptr, i32 }
          cleanup
  %112 = extractvalue { ptr, i32 } %111, 0
  store ptr %112, ptr %14, align 8
  %113 = extractvalue { ptr, i32 } %111, 1
  store i32 %113, ptr %15, align 4
  call void @_ZN6HandleI7SObjectED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %21) #7
  br label %114

114:                                              ; preds = %110, %106
  %115 = load i1, ptr %22, align 1
  br i1 %115, label %116, label %117

116:                                              ; preds = %114
  call void @_ZdlPvm(ptr noundef %95, i64 noundef 32) #10
  br label %117

117:                                              ; preds = %116, %114
  br label %124

118:                                              ; preds = %100
  %119 = landingpad { ptr, i32 }
          cleanup
  %120 = extractvalue { ptr, i32 } %119, 0
  store ptr %120, ptr %14, align 8
  %121 = extractvalue { ptr, i32 } %119, 1
  store i32 %121, ptr %15, align 4
  call void @_ZN6HandleI10SignedDataED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %0) #7
  br label %124

122:                                              ; preds = %103
  call void @_ZN6HandleI10SignedDataED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %0) #7
  br label %123

123:                                              ; preds = %122, %103
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  call void @_ZN14LoggerFunctionD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %13) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #7
  ret void

124:                                              ; preds = %118, %117, %93, %64
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  br label %125

125:                                              ; preds = %124, %60
  call void @_ZN14LoggerFunctionD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %13) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #7
  br label %126

126:                                              ; preds = %125
  %127 = load ptr, ptr %14, align 8
  %128 = load i32, ptr %15, align 4
  %129 = insertvalue { ptr, i32 } poison, ptr %127, 0
  %130 = insertvalue { ptr, i32 } %129, i32 %128, 1
  resume { ptr, i32 } %130

131:                                              ; preds = %59
  unreachable
}

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6HandleI10SignedDataED2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #4 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 = { 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 = { nounwind }
attributes #8 = { builtin allocsize(0) }
attributes #9 = { noreturn }
attributes #10 = { 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}
!11 = !{!12, !10, i64 24}
!12 = !{!"_ZTS10SignedData", !13, i64 0, !15, i64 16, !10, i64 24}
!13 = !{!"_ZTS9SSLObjectI18CMS_ContentInfo_stE", !6, i64 0, !14, i64 8}
!14 = !{!"_ZTS6HandleI7SObjectE", !6, i64 0}
!15 = !{!"_ZTS6HandleI3BioE", !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.Handle.13 = type { ptr }
%class.LoggerFunction = type { %class.Handle.0, ptr }
%class.Handle.0 = type { ptr }
%class.Handle.8 = type { ptr }
%class.Handle.1 = type { ptr }

@logger = external local_unnamed_addr global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [99 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [3 x i8], align 1
@_ZTI6HandleI9ExceptionE = external dso_local constant { ptr, ptr }, align 8
@__FUNCTION__._ZN10SignedData4signE6HandleI11CertificateES0_I3KeyES0_I21CertificateCollectionES0_I3BioEj = external hidden unnamed_addr constant [5 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [9 x i8], align 1

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

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

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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6HandleI7SObjectED2Ev(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

; 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 #6

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZNK6HandleI21CertificateCollectionEptEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3 align 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 #1

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

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

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

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 uwtable
declare dso_local noundef ptr @_ZNK6HandleI3BioEptEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3 align 2

declare noundef ptr @_ZN3Bio8internalEv(ptr noundef nonnull align 8 dereferenceable(9)) local_unnamed_addr #1

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

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

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

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

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

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

13:                                               ; preds = %6
  %14 = invoke noundef ptr @_ZNK6HandleI11CertificateEptEv(ptr noundef nonnull align 8 dereferenceable(8) %1)
          to label %15 unwind label %47

15:                                               ; preds = %13
  %16 = invoke noundef ptr @_ZN9SSLObjectI7x509_stE8internalEv(ptr noundef nonnull align 8 dereferenceable(16) %14)
          to label %17 unwind label %47

17:                                               ; preds = %15
  %18 = invoke noundef ptr @_ZNK6HandleI3KeyEptEv(ptr noundef nonnull align 8 dereferenceable(8) %2)
          to label %19 unwind label %47

19:                                               ; preds = %17
  %20 = invoke noundef ptr @_ZN9SSLObjectI11evp_pkey_stE8internalEv(ptr noundef nonnull align 8 dereferenceable(16) %18)
          to label %21 unwind label %47

21:                                               ; preds = %19
  %22 = invoke noundef ptr @_ZNK6HandleI21CertificateCollectionEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3)
          to label %23 unwind label %47

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

25:                                               ; preds = %23
  %26 = invoke noundef ptr @_ZNK6HandleI3BioEptEv(ptr noundef nonnull align 8 dereferenceable(8) %4)
          to label %27 unwind label %47

27:                                               ; preds = %25
  %28 = invoke noundef ptr @_ZN3Bio8internalEv(ptr noundef nonnull align 8 dereferenceable(9) %26)
          to label %29 unwind label %47

29:                                               ; preds = %27
  %30 = invoke ptr @CMS_sign(ptr noundef %16, ptr noundef %20, ptr noundef %24, ptr noundef %28, i32 noundef %5)
          to label %31 unwind label %47

31:                                               ; preds = %29
  %.not = icmp eq ptr %30, null
  br i1 %.not, label %32, label %58

32:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #7
  %33 = invoke noalias noundef nonnull dereferenceable(176) ptr @_Znwm(i64 noundef 176) #8
          to label %34 unwind label %49

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

35:                                               ; preds = %34
  invoke void (ptr, i1, ptr, i32, i32, ptr, ptr, ptr, ptr, ...) @_ZN9ExceptionC1EbPKciiS1_S1_6HandleIS_ES1_z(ptr noundef nonnull align 8 dereferenceable(176) %33, i1 noundef zeroext true, ptr noundef nonnull @.str.2, i32 noundef 250, i32 noundef 0, ptr noundef nonnull @.str.3, ptr noundef nonnull @__FUNCTION__._ZN10SignedData4signE6HandleI11CertificateES0_I3KeyES0_I21CertificateCollectionES0_I3BioEj, ptr noundef nonnull %9, ptr noundef nonnull @.str.32)
          to label %37 unwind label %.thread29

.thread29:                                        ; preds = %35
  %36 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN6HandleI9ExceptionED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %9) #7
  br label %54

37:                                               ; preds = %35
  invoke void @_ZN6HandleI9ExceptionEC2EPS0_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull %33)
          to label %38 unwind label %52

38:                                               ; preds = %37
  call void @_ZN6HandleI9ExceptionED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %9) #7
  %39 = load ptr, ptr @logger, align 8, !tbaa !5
  %40 = invoke noundef ptr @_ZNK6HandleI9ExceptionEptEv(ptr noundef nonnull align 8 dereferenceable(8) %8)
          to label %41 unwind label %55

41:                                               ; preds = %38
  %42 = call noundef ptr @_ZNK9Exception4whatEv(ptr noundef nonnull align 8 dereferenceable(176) %40) #7
  invoke void (ptr, ptr, ptr, ...) @_ZN6Logger4warnEPKcS1_z(ptr noundef nonnull align 8 dereferenceable(24) %39, ptr noundef nonnull @__FUNCTION__._ZN10SignedData4signE6HandleI11CertificateES0_I3KeyES0_I21CertificateCollectionES0_I3BioEj, ptr noundef nonnull @.str.5, ptr noundef %42)
          to label %43 unwind label %55

43:                                               ; preds = %41
  %44 = call ptr @__cxa_allocate_exception(i64 8) #7
  call void @_ZN6HandleI9ExceptionEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(8) %44, ptr noundef nonnull align 8 dereferenceable(8) %8)
  invoke void @__cxa_throw(ptr nonnull %44, ptr nonnull @_ZTI6HandleI9ExceptionE, ptr nonnull @_ZN6HandleI9ExceptionED2Ev) #9
          to label %75 unwind label %55

45:                                               ; preds = %6
  %46 = landingpad { ptr, i32 }
          cleanup
  br label %74

47:                                               ; preds = %58, %29, %27, %25, %23, %21, %19, %17, %15, %13
  %48 = landingpad { ptr, i32 }
          cleanup
  br label %74

49:                                               ; preds = %32
  %50 = landingpad { ptr, i32 }
          cleanup
  br label %57

.thread:                                          ; preds = %34
  %51 = landingpad { ptr, i32 }
          cleanup
  br label %54

52:                                               ; preds = %37
  %53 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN6HandleI9ExceptionED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %9) #7
  br label %57

54:                                               ; preds = %.thread29, %.thread
  %.pn28 = phi { ptr, i32 } [ %51, %.thread ], [ %36, %.thread29 ]
  call void @_ZdlPvm(ptr noundef nonnull %33, i64 noundef 176) #10
  br label %57

55:                                               ; preds = %43, %41, %38
  %56 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN6HandleI9ExceptionED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %8) #7
  br label %57

57:                                               ; preds = %52, %54, %55, %49
  %.pn19 = phi { ptr, i32 } [ %56, %55 ], [ %.pn28, %54 ], [ %53, %52 ], [ %50, %49 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #7
  br label %74

58:                                               ; preds = %31
  %59 = invoke noalias noundef nonnull dereferenceable(32) ptr @_Znwm(i64 noundef 32) #8
          to label %60 unwind label %47

60:                                               ; preds = %58
  invoke void @_ZN6HandleI7SObjectEC2EPS0_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef null)
          to label %61 unwind label %.thread31

61:                                               ; preds = %60
  invoke void @_ZN10SignedDataC2EP18CMS_ContentInfo_st6HandleI7SObjectE(ptr noundef nonnull align 8 dereferenceable(28) %59, ptr noundef nonnull %30, ptr noundef nonnull %10)
          to label %63 unwind label %.thread35

.thread35:                                        ; preds = %61
  %62 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN6HandleI7SObjectED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %10) #7
  br label %71

63:                                               ; preds = %61
  invoke void @_ZN6HandleI10SignedDataEC2EPS0_(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef nonnull %59)
          to label %64 unwind label %69

64:                                               ; preds = %63
  call void @_ZN6HandleI7SObjectED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %10) #7
  %65 = invoke noundef ptr @_ZNK6HandleI10SignedDataEptEv(ptr noundef nonnull align 8 dereferenceable(8) %0)
          to label %66 unwind label %72

66:                                               ; preds = %64
  %67 = getelementptr inbounds i8, ptr %65, i64 24
  store i32 %5, ptr %67, align 8, !tbaa !9
  call void @_ZN14LoggerFunctionD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %7) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #7
  ret void

.thread31:                                        ; preds = %60
  %68 = landingpad { ptr, i32 }
          cleanup
  br label %71

69:                                               ; preds = %63
  %70 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN6HandleI7SObjectED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %10) #7
  br label %74

71:                                               ; preds = %.thread35, %.thread31
  %.pn2134 = phi { ptr, i32 } [ %68, %.thread31 ], [ %62, %.thread35 ]
  call void @_ZdlPvm(ptr noundef nonnull %59, i64 noundef 32) #10
  br label %74

72:                                               ; preds = %64
  %73 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN6HandleI10SignedDataED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %0) #7
  br label %74

74:                                               ; preds = %69, %47, %57, %72, %71, %45
  %.pn23.pn = phi { ptr, i32 } [ %46, %45 ], [ %73, %72 ], [ %.pn2134, %71 ], [ %70, %69 ], [ %48, %47 ], [ %.pn19, %57 ]
  call void @_ZN14LoggerFunctionD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %7) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #7
  resume { ptr, i32 } %.pn23.pn

75:                                               ; preds = %43
  unreachable
}

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6HandleI10SignedDataED2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #4 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 = { 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 = { nounwind }
attributes #8 = { builtin allocsize(0) }
attributes #9 = { noreturn }
attributes #10 = { 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, !14, i64 24}
!10 = !{!"_ZTS10SignedData", !11, i64 0, !13, i64 16, !14, i64 24}
!11 = !{!"_ZTS9SSLObjectI18CMS_ContentInfo_stE", !6, i64 0, !12, i64 8}
!12 = !{!"_ZTS6HandleI7SObjectE", !6, i64 0}
!13 = !{!"_ZTS6HandleI3BioE", !6, i64 0}
!14 = !{!"int", !7, i64 0}


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