; LLVM IR from Trusted-eSign/trusted-crypto :: deps/wrapper/src/cms/signer_attrs.ll (ZN25SignerAttributeCollection8removeAtEi)

; 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.3 = type { ptr }
%class.SignerAttributeCollection = type <{ %class.Handle, i8, [7 x i8] }>
%class.Handle = type { ptr }

@logger = external global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [100 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [26 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__._ZN25SignerAttributeCollection8removeAtEi = external hidden unnamed_addr constant [9 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [25 x i8], align 1

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) #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

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

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

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

; 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 #5 align 2

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

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

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

declare void @__cxa_free_exception(ptr)

declare void @__cxa_throw(ptr, ptr, ptr)

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN25SignerAttributeCollection8removeAtEi(ptr noundef nonnull align 8 dereferenceable(9) %0, i32 noundef %1) #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca %class.LoggerFunction, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca %class.Handle.3, align 8
  %10 = alloca %class.Handle.3, align 8
  %11 = alloca i1, align 1
  %12 = alloca %class.Handle.3, align 8
  %13 = alloca %class.Handle.3, align 8
  %14 = alloca i1, align 1
  store ptr %0, ptr %3, align 8, !tbaa !5
  store i32 %1, ptr %4, align 4, !tbaa !9
  %15 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %5) #7
  %16 = load ptr, ptr @logger, align 8, !tbaa !5
  call void @_ZN14LoggerFunctionC1EP6LoggerPKc(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef %16, ptr noundef @__FUNCTION__._ZN25SignerAttributeCollection8removeAtEi)
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  %17 = getelementptr inbounds %class.SignerAttributeCollection, ptr %15, i32 0, i32 1
  %18 = load i8, ptr %17, align 8, !tbaa !11, !range !15, !noundef !16
  %19 = trunc i8 %18 to i1
  br i1 %19, label %20, label %77

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

22:                                               ; preds = %20
  %23 = getelementptr inbounds %class.SignerAttributeCollection, ptr %15, i32 0, i32 0
  %24 = invoke noundef ptr @_ZNK6HandleI6SignerEptEv(ptr noundef nonnull align 8 dereferenceable(8) %23)
          to label %25 unwind label %46

25:                                               ; preds = %22
  %26 = invoke noundef ptr @_ZN9SSLObjectI17CMS_SignerInfo_stE8internalEv(ptr noundef nonnull align 8 dereferenceable(16) %24)
          to label %27 unwind label %46

27:                                               ; preds = %25
  %28 = load i32, ptr %4, align 4, !tbaa !9
  %29 = invoke ptr @CMS_signed_delete_attr(ptr noundef %26, i32 noundef %28)
          to label %30 unwind label %46

30:                                               ; preds = %27
  store ptr %29, ptr %6, align 8, !tbaa !5
  %31 = load ptr, ptr %6, align 8, !tbaa !5
  %32 = icmp ne ptr %31, null
  br i1 %32, label %76, label %33

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

35:                                               ; preds = %33
  store i1 true, ptr %11, align 1
  invoke void @_ZN6HandleI9ExceptionEC2EPS0_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef null)
          to label %36 unwind label %54

36:                                               ; preds = %35
  invoke void (ptr, i1, ptr, i32, i32, ptr, ptr, ptr, ptr, ...) @_ZN9ExceptionC1EbPKciiS1_S1_6HandleIS_ES1_z(ptr noundef nonnull align 8 dereferenceable(176) %34, i1 noundef zeroext true, ptr noundef @.str.2, i32 noundef 107, i32 noundef 0, ptr noundef @.str.3, ptr noundef @__FUNCTION__._ZN25SignerAttributeCollection8removeAtEi, ptr noundef %10, ptr noundef @.str.14)
          to label %37 unwind label %58

37:                                               ; preds = %36
  store i1 false, ptr %11, align 1
  invoke void @_ZN6HandleI9ExceptionEC2EPS0_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef %34)
          to label %38 unwind label %58

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

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 @__FUNCTION__._ZN25SignerAttributeCollection8removeAtEi, ptr noundef @.str.5, ptr noundef %42)
          to label %43 unwind label %66

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

45:                                               ; preds = %43
  invoke void @__cxa_throw(ptr %44, ptr @_ZTI6HandleI9ExceptionE, ptr @_ZN6HandleI9ExceptionED2Ev) #9
          to label %139 unwind label %66

46:                                               ; preds = %130, %84, %82, %79, %77, %27, %25, %22, %20
  %47 = landingpad { ptr, i32 }
          cleanup
  %48 = extractvalue { ptr, i32 } %47, 0
  store ptr %48, ptr %7, align 8
  %49 = extractvalue { ptr, i32 } %47, 1
  store i32 %49, ptr %8, align 4
  br label %133

50:                                               ; preds = %33
  %51 = landingpad { ptr, i32 }
          cleanup
  %52 = extractvalue { ptr, i32 } %51, 0
  store ptr %52, ptr %7, align 8
  %53 = extractvalue { ptr, i32 } %51, 1
  store i32 %53, ptr %8, align 4
  br label %75

54:                                               ; preds = %35
  %55 = landingpad { ptr, i32 }
          cleanup
  %56 = extractvalue { ptr, i32 } %55, 0
  store ptr %56, ptr %7, align 8
  %57 = extractvalue { ptr, i32 } %55, 1
  store i32 %57, ptr %8, align 4
  br label %62

58:                                               ; preds = %37, %36
  %59 = landingpad { ptr, i32 }
          cleanup
  %60 = extractvalue { ptr, i32 } %59, 0
  store ptr %60, ptr %7, align 8
  %61 = extractvalue { ptr, i32 } %59, 1
  store i32 %61, ptr %8, align 4
  call void @_ZN6HandleI9ExceptionED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %10) #7
  br label %62

62:                                               ; preds = %58, %54
  %63 = load i1, ptr %11, align 1
  br i1 %63, label %64, label %65

64:                                               ; preds = %62
  call void @_ZdlPvm(ptr noundef %34, i64 noundef 176) #10
  br label %65

65:                                               ; preds = %64, %62
  br label %75

66:                                               ; preds = %45, %41, %38
  %67 = landingpad { ptr, i32 }
          cleanup
  %68 = extractvalue { ptr, i32 } %67, 0
  store ptr %68, ptr %7, align 8
  %69 = extractvalue { ptr, i32 } %67, 1
  store i32 %69, ptr %8, align 4
  br label %74

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

74:                                               ; preds = %70, %66
  call void @_ZN6HandleI9ExceptionED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %9) #7
  br label %75

75:                                               ; preds = %74, %65, %50
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  br label %133

76:                                               ; preds = %30
  br label %130

77:                                               ; preds = %2
  %78 = load ptr, ptr @logger, align 8, !tbaa !5
  invoke void (ptr, i32, ptr, ptr, ...) @_ZN6Logger5writeEN11LoggerLevel12LOGGER_LEVELEPKcS3_z(ptr noundef nonnull align 8 dereferenceable(24) %78, i32 noundef 32, ptr noundef @__FUNCTION__._ZN25SignerAttributeCollection8removeAtEi, ptr noundef @.str.15)
          to label %79 unwind label %46

79:                                               ; preds = %77
  %80 = getelementptr inbounds %class.SignerAttributeCollection, ptr %15, i32 0, i32 0
  %81 = invoke noundef ptr @_ZNK6HandleI6SignerEptEv(ptr noundef nonnull align 8 dereferenceable(8) %80)
          to label %82 unwind label %46

82:                                               ; preds = %79
  %83 = invoke noundef ptr @_ZN9SSLObjectI17CMS_SignerInfo_stE8internalEv(ptr noundef nonnull align 8 dereferenceable(16) %81)
          to label %84 unwind label %46

84:                                               ; preds = %82
  %85 = load i32, ptr %4, align 4, !tbaa !9
  %86 = invoke ptr @CMS_unsigned_delete_attr(ptr noundef %83, i32 noundef %85)
          to label %87 unwind label %46

87:                                               ; preds = %84
  store ptr %86, ptr %6, align 8, !tbaa !5
  %88 = load ptr, ptr %6, align 8, !tbaa !5
  %89 = icmp ne ptr %88, null
  br i1 %89, label %129, label %90

90:                                               ; preds = %87
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  %91 = invoke noalias noundef nonnull ptr @_Znwm(i64 noundef 176) #8
          to label %92 unwind label %103

92:                                               ; preds = %90
  store i1 true, ptr %14, align 1
  invoke void @_ZN6HandleI9ExceptionEC2EPS0_(ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef null)
          to label %93 unwind label %107

93:                                               ; preds = %92
  invoke void (ptr, i1, ptr, i32, i32, ptr, ptr, ptr, ptr, ...) @_ZN9ExceptionC1EbPKciiS1_S1_6HandleIS_ES1_z(ptr noundef nonnull align 8 dereferenceable(176) %91, i1 noundef zeroext true, ptr noundef @.str.2, i32 noundef 114, i32 noundef 0, ptr noundef @.str.3, ptr noundef @__FUNCTION__._ZN25SignerAttributeCollection8removeAtEi, ptr noundef %13, ptr noundef @.str.16)
          to label %94 unwind label %111

94:                                               ; preds = %93
  store i1 false, ptr %14, align 1
  invoke void @_ZN6HandleI9ExceptionEC2EPS0_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef %91)
          to label %95 unwind label %111

95:                                               ; preds = %94
  call void @_ZN6HandleI9ExceptionED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %13) #7
  %96 = load ptr, ptr @logger, align 8, !tbaa !5
  %97 = invoke noundef ptr @_ZNK6HandleI9ExceptionEptEv(ptr noundef nonnull align 8 dereferenceable(8) %12)
          to label %98 unwind label %119

98:                                               ; preds = %95
  %99 = call noundef ptr @_ZNK9Exception4whatEv(ptr noundef nonnull align 8 dereferenceable(176) %97) #7
  invoke void (ptr, ptr, ptr, ...) @_ZN6Logger4warnEPKcS1_z(ptr noundef nonnull align 8 dereferenceable(24) %96, ptr noundef @__FUNCTION__._ZN25SignerAttributeCollection8removeAtEi, ptr noundef @.str.5, ptr noundef %99)
          to label %100 unwind label %119

100:                                              ; preds = %98
  %101 = call ptr @__cxa_allocate_exception(i64 8) #7
  invoke void @_ZN6HandleI9ExceptionEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(8) %101, ptr noundef nonnull align 8 dereferenceable(8) %12)
          to label %102 unwind label %123

102:                                              ; preds = %100
  invoke void @__cxa_throw(ptr %101, ptr @_ZTI6HandleI9ExceptionE, ptr @_ZN6HandleI9ExceptionED2Ev) #9
          to label %139 unwind label %119

103:                                              ; preds = %90
  %104 = landingpad { ptr, i32 }
          cleanup
  %105 = extractvalue { ptr, i32 } %104, 0
  store ptr %105, ptr %7, align 8
  %106 = extractvalue { ptr, i32 } %104, 1
  store i32 %106, ptr %8, align 4
  br label %128

107:                                              ; preds = %92
  %108 = landingpad { ptr, i32 }
          cleanup
  %109 = extractvalue { ptr, i32 } %108, 0
  store ptr %109, ptr %7, align 8
  %110 = extractvalue { ptr, i32 } %108, 1
  store i32 %110, ptr %8, align 4
  br label %115

111:                                              ; preds = %94, %93
  %112 = landingpad { ptr, i32 }
          cleanup
  %113 = extractvalue { ptr, i32 } %112, 0
  store ptr %113, ptr %7, align 8
  %114 = extractvalue { ptr, i32 } %112, 1
  store i32 %114, ptr %8, align 4
  call void @_ZN6HandleI9ExceptionED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %13) #7
  br label %115

115:                                              ; preds = %111, %107
  %116 = load i1, ptr %14, align 1
  br i1 %116, label %117, label %118

117:                                              ; preds = %115
  call void @_ZdlPvm(ptr noundef %91, i64 noundef 176) #10
  br label %118

118:                                              ; preds = %117, %115
  br label %128

119:                                              ; preds = %102, %98, %95
  %120 = landingpad { ptr, i32 }
          cleanup
  %121 = extractvalue { ptr, i32 } %120, 0
  store ptr %121, ptr %7, align 8
  %122 = extractvalue { ptr, i32 } %120, 1
  store i32 %122, ptr %8, align 4
  br label %127

123:                                              ; preds = %100
  %124 = landingpad { ptr, i32 }
          cleanup
  %125 = extractvalue { ptr, i32 } %124, 0
  store ptr %125, ptr %7, align 8
  %126 = extractvalue { ptr, i32 } %124, 1
  store i32 %126, ptr %8, align 4
  call void @__cxa_free_exception(ptr %101) #7
  br label %127

127:                                              ; preds = %123, %119
  call void @_ZN6HandleI9ExceptionED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %12) #7
  br label %128

128:                                              ; preds = %127, %118, %103
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  br label %133

129:                                              ; preds = %87
  br label %130

130:                                              ; preds = %129, %76
  %131 = load ptr, ptr %6, align 8, !tbaa !5
  invoke void @X509_ATTRIBUTE_free(ptr noundef %131)
          to label %132 unwind label %46

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

133:                                              ; preds = %128, %75, %46
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  call void @_ZN14LoggerFunctionD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %5) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %5) #7
  br label %134

134:                                              ; preds = %133
  %135 = load ptr, ptr %7, align 8
  %136 = load i32, ptr %8, align 4
  %137 = insertvalue { ptr, i32 } poison, ptr %135, 0
  %138 = insertvalue { ptr, i32 } %137, i32 %136, 1
  resume { ptr, i32 } %138

139:                                              ; preds = %102, %45
  unreachable
}

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

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

declare void @X509_ATTRIBUTE_free(ptr noundef) #1

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 = { 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 #4 = { 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 #5 = { 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 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, !14, i64 8}
!12 = !{!"_ZTS25SignerAttributeCollection", !13, i64 0, !14, i64 8}
!13 = !{!"_ZTS6HandleI6SignerE", !6, i64 0}
!14 = !{!"bool", !7, i64 0}
!15 = !{i8 0, i8 2}
!16 = !{}


; 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.3 = type { ptr }

@logger = external local_unnamed_addr global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [100 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [26 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__._ZN25SignerAttributeCollection8removeAtEi = external hidden unnamed_addr constant [9 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [25 x i8], align 1

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) #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

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

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

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

; 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 #5 align 2

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN25SignerAttributeCollection8removeAtEi(ptr noundef nonnull align 8 dereferenceable(9) %0, i32 noundef %1) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %class.LoggerFunction, align 8
  %4 = alloca %class.Handle.3, align 8
  %5 = alloca %class.Handle.3, align 8
  %6 = alloca %class.Handle.3, align 8
  %7 = alloca %class.Handle.3, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #7
  %8 = load ptr, ptr @logger, align 8, !tbaa !5
  call void @_ZN14LoggerFunctionC1EP6LoggerPKc(ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef %8, ptr noundef nonnull @__FUNCTION__._ZN25SignerAttributeCollection8removeAtEi)
  %9 = getelementptr inbounds i8, ptr %0, i64 8
  %10 = load i8, ptr %9, align 8, !tbaa !9, !range !13, !noundef !14
  %11 = trunc nuw i8 %10 to i1
  %12 = load ptr, ptr @logger, align 8, !tbaa !5
  br i1 %11, label %13, label %45

13:                                               ; preds = %2
  invoke void (ptr, i32, ptr, ptr, ...) @_ZN6Logger5writeEN11LoggerLevel12LOGGER_LEVELEPKcS3_z(ptr noundef nonnull align 8 dereferenceable(24) %12, i32 noundef 32, ptr noundef nonnull @__FUNCTION__._ZN25SignerAttributeCollection8removeAtEi, ptr noundef nonnull @.str.13)
          to label %14 unwind label %34

14:                                               ; preds = %13
  %15 = invoke noundef ptr @_ZNK6HandleI6SignerEptEv(ptr noundef nonnull align 8 dereferenceable(8) %0)
          to label %16 unwind label %34

16:                                               ; preds = %14
  %17 = invoke noundef ptr @_ZN9SSLObjectI17CMS_SignerInfo_stE8internalEv(ptr noundef nonnull align 8 dereferenceable(16) %15)
          to label %18 unwind label %34

18:                                               ; preds = %16
  %19 = invoke ptr @CMS_signed_delete_attr(ptr noundef %17, i32 noundef %1)
          to label %20 unwind label %34

20:                                               ; preds = %18
  %.not24 = icmp eq ptr %19, null
  br i1 %.not24, label %21, label %75

21:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  %22 = invoke noalias noundef nonnull dereferenceable(176) ptr @_Znwm(i64 noundef 176) #8
          to label %23 unwind label %36

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

24:                                               ; preds = %23
  invoke void (ptr, i1, ptr, i32, i32, ptr, ptr, ptr, ptr, ...) @_ZN9ExceptionC1EbPKciiS1_S1_6HandleIS_ES1_z(ptr noundef nonnull align 8 dereferenceable(176) %22, i1 noundef zeroext true, ptr noundef nonnull @.str.2, i32 noundef 107, i32 noundef 0, ptr noundef nonnull @.str.3, ptr noundef nonnull @__FUNCTION__._ZN25SignerAttributeCollection8removeAtEi, ptr noundef nonnull %5, ptr noundef nonnull @.str.14)
          to label %26 unwind label %.thread34

.thread34:                                        ; preds = %24
  %25 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN6HandleI9ExceptionED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #7
  br label %41

26:                                               ; preds = %24
  invoke void @_ZN6HandleI9ExceptionEC2EPS0_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull %22)
          to label %27 unwind label %39

27:                                               ; preds = %26
  call void @_ZN6HandleI9ExceptionED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #7
  %28 = load ptr, ptr @logger, align 8, !tbaa !5
  %29 = invoke noundef ptr @_ZNK6HandleI9ExceptionEptEv(ptr noundef nonnull align 8 dereferenceable(8) %4)
          to label %30 unwind label %42

30:                                               ; preds = %27
  %31 = call noundef ptr @_ZNK9Exception4whatEv(ptr noundef nonnull align 8 dereferenceable(176) %29) #7
  invoke void (ptr, ptr, ptr, ...) @_ZN6Logger4warnEPKcS1_z(ptr noundef nonnull align 8 dereferenceable(24) %28, ptr noundef nonnull @__FUNCTION__._ZN25SignerAttributeCollection8removeAtEi, ptr noundef nonnull @.str.5, ptr noundef %31)
          to label %32 unwind label %42

32:                                               ; preds = %30
  %33 = call ptr @__cxa_allocate_exception(i64 8) #7
  call void @_ZN6HandleI9ExceptionEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(8) %33, ptr noundef nonnull align 8 dereferenceable(8) %4)
  invoke void @__cxa_throw(ptr nonnull %33, ptr nonnull @_ZTI6HandleI9ExceptionE, ptr nonnull @_ZN6HandleI9ExceptionED2Ev) #9
          to label %78 unwind label %42

34:                                               ; preds = %75, %50, %48, %46, %45, %18, %16, %14, %13
  %35 = landingpad { ptr, i32 }
          cleanup
  br label %77

36:                                               ; preds = %21
  %37 = landingpad { ptr, i32 }
          cleanup
  br label %44

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

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

41:                                               ; preds = %.thread34, %.thread
  %.pn2533 = phi { ptr, i32 } [ %38, %.thread ], [ %25, %.thread34 ]
  call void @_ZdlPvm(ptr noundef nonnull %22, i64 noundef 176) #10
  br label %44

42:                                               ; preds = %32, %30, %27
  %43 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN6HandleI9ExceptionED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %4) #7
  br label %44

44:                                               ; preds = %39, %41, %42, %36
  %.pn27 = phi { ptr, i32 } [ %43, %42 ], [ %.pn2533, %41 ], [ %40, %39 ], [ %37, %36 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  br label %77

45:                                               ; preds = %2
  invoke void (ptr, i32, ptr, ptr, ...) @_ZN6Logger5writeEN11LoggerLevel12LOGGER_LEVELEPKcS3_z(ptr noundef nonnull align 8 dereferenceable(24) %12, i32 noundef 32, ptr noundef nonnull @__FUNCTION__._ZN25SignerAttributeCollection8removeAtEi, ptr noundef nonnull @.str.15)
          to label %46 unwind label %34

46:                                               ; preds = %45
  %47 = invoke noundef ptr @_ZNK6HandleI6SignerEptEv(ptr noundef nonnull align 8 dereferenceable(8) %0)
          to label %48 unwind label %34

48:                                               ; preds = %46
  %49 = invoke noundef ptr @_ZN9SSLObjectI17CMS_SignerInfo_stE8internalEv(ptr noundef nonnull align 8 dereferenceable(16) %47)
          to label %50 unwind label %34

50:                                               ; preds = %48
  %51 = invoke ptr @CMS_unsigned_delete_attr(ptr noundef %49, i32 noundef %1)
          to label %52 unwind label %34

52:                                               ; preds = %50
  %.not = icmp eq ptr %51, null
  br i1 %.not, label %53, label %75

53:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #7
  %54 = invoke noalias noundef nonnull dereferenceable(176) ptr @_Znwm(i64 noundef 176) #8
          to label %55 unwind label %66

55:                                               ; preds = %53
  invoke void @_ZN6HandleI9ExceptionEC2EPS0_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef null)
          to label %56 unwind label %.thread36

56:                                               ; preds = %55
  invoke void (ptr, i1, ptr, i32, i32, ptr, ptr, ptr, ptr, ...) @_ZN9ExceptionC1EbPKciiS1_S1_6HandleIS_ES1_z(ptr noundef nonnull align 8 dereferenceable(176) %54, i1 noundef zeroext true, ptr noundef nonnull @.str.2, i32 noundef 114, i32 noundef 0, ptr noundef nonnull @.str.3, ptr noundef nonnull @__FUNCTION__._ZN25SignerAttributeCollection8removeAtEi, ptr noundef nonnull %7, ptr noundef nonnull @.str.16)
          to label %58 unwind label %.thread40

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

58:                                               ; preds = %56
  invoke void @_ZN6HandleI9ExceptionEC2EPS0_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull %54)
          to label %59 unwind label %69

59:                                               ; preds = %58
  call void @_ZN6HandleI9ExceptionED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %7) #7
  %60 = load ptr, ptr @logger, align 8, !tbaa !5
  %61 = invoke noundef ptr @_ZNK6HandleI9ExceptionEptEv(ptr noundef nonnull align 8 dereferenceable(8) %6)
          to label %62 unwind label %72

62:                                               ; preds = %59
  %63 = call noundef ptr @_ZNK9Exception4whatEv(ptr noundef nonnull align 8 dereferenceable(176) %61) #7
  invoke void (ptr, ptr, ptr, ...) @_ZN6Logger4warnEPKcS1_z(ptr noundef nonnull align 8 dereferenceable(24) %60, ptr noundef nonnull @__FUNCTION__._ZN25SignerAttributeCollection8removeAtEi, ptr noundef nonnull @.str.5, ptr noundef %63)
          to label %64 unwind label %72

64:                                               ; preds = %62
  %65 = call ptr @__cxa_allocate_exception(i64 8) #7
  call void @_ZN6HandleI9ExceptionEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(8) %65, ptr noundef nonnull align 8 dereferenceable(8) %6)
  invoke void @__cxa_throw(ptr nonnull %65, ptr nonnull @_ZTI6HandleI9ExceptionE, ptr nonnull @_ZN6HandleI9ExceptionED2Ev) #9
          to label %78 unwind label %72

66:                                               ; preds = %53
  %67 = landingpad { ptr, i32 }
          cleanup
  br label %74

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

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

71:                                               ; preds = %.thread40, %.thread36
  %.pn39 = phi { ptr, i32 } [ %68, %.thread36 ], [ %57, %.thread40 ]
  call void @_ZdlPvm(ptr noundef nonnull %54, i64 noundef 176) #10
  br label %74

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

74:                                               ; preds = %69, %71, %72, %66
  %.pn22 = phi { ptr, i32 } [ %73, %72 ], [ %.pn39, %71 ], [ %70, %69 ], [ %67, %66 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  br label %77

75:                                               ; preds = %52, %20
  %.018 = phi ptr [ %19, %20 ], [ %51, %52 ]
  invoke void @X509_ATTRIBUTE_free(ptr noundef nonnull %.018)
          to label %76 unwind label %34

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

77:                                               ; preds = %74, %44, %34
  %.pn29 = phi { ptr, i32 } [ %35, %34 ], [ %.pn27, %44 ], [ %.pn22, %74 ]
  call void @_ZN14LoggerFunctionD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %3) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #7
  resume { ptr, i32 } %.pn29

78:                                               ; preds = %64, %32
  unreachable
}

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

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

declare void @X509_ATTRIBUTE_free(ptr noundef) local_unnamed_addr #1

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 = { 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 #4 = { 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 #5 = { 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 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, !12, i64 8}
!10 = !{!"_ZTS25SignerAttributeCollection", !11, i64 0, !12, i64 8}
!11 = !{!"_ZTS6HandleI6SignerE", !6, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{i8 0, i8 2}
!14 = !{}


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