; LLVM IR from specinfo-ua/UAPKI :: library/common/pkix (extension-helper)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.UapkiNS::SmartBA" = type { ptr }

@.str = external hidden unnamed_addr constant [33 x i8], align 1
@OID_X509v3_KeyUsage = external global ptr, align 8

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

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

declare ptr @asn_decode_ba_with_alloc(ptr noundef, ptr noundef) #2

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

declare noundef i32 @_ZN7UapkiNS4Util23extnValueFromExtensionsEPK10ExtensionsPKcPbPP12ByteArray_st(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #2

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

16:                                               ; preds = %2
  %17 = load ptr, ptr %4, align 8, !tbaa !5
  %18 = load ptr, ptr @OID_X509v3_KeyUsage, align 8, !tbaa !5
  %19 = invoke noundef ptr @_ZN7UapkiNS7SmartBAadEv(ptr noundef nonnull align 8 dereferenceable(8) %8)
          to label %20 unwind label %28

20:                                               ; preds = %16
  %21 = invoke noundef i32 @_ZN7UapkiNS4Util23extnValueFromExtensionsEPK10ExtensionsPKcPbPP12ByteArray_st(ptr noundef %17, ptr noundef %18, ptr noundef %9, ptr noundef %19)
          to label %22 unwind label %28

22:                                               ; preds = %20
  store i32 %21, ptr %6, align 4, !tbaa !9
  %23 = load i32, ptr %6, align 4, !tbaa !9
  %24 = icmp ne i32 %23, 0
  br i1 %24, label %25, label %32

25:                                               ; preds = %22
  %26 = load i32, ptr %6, align 4, !tbaa !9
  invoke void @stacktrace_add(ptr noundef @.str, i64 noundef 314, i32 noundef %26)
          to label %27 unwind label %28

27:                                               ; preds = %25
  br label %89

28:                                               ; preds = %91, %89, %43, %39, %37, %35, %25, %20, %16
  %29 = landingpad { ptr, i32 }
          cleanup
  %30 = extractvalue { ptr, i32 } %29, 0
  store ptr %30, ptr %10, align 8
  %31 = extractvalue { ptr, i32 } %29, 1
  store i32 %31, ptr %11, align 4
  br label %97

32:                                               ; preds = %22
  br label %33

33:                                               ; preds = %32
  br label %34

34:                                               ; preds = %33
  br label %35

35:                                               ; preds = %34
  %36 = invoke ptr @get_KeyUsage_desc()
          to label %37 unwind label %28

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

39:                                               ; preds = %37
  %40 = invoke ptr @asn_decode_ba_with_alloc(ptr noundef %36, ptr noundef %38)
          to label %41 unwind label %28

41:                                               ; preds = %39
  store ptr %40, ptr %7, align 8, !tbaa !5
  %42 = icmp eq ptr null, %40
  br i1 %42, label %43, label %46

43:                                               ; preds = %41
  store i32 2, ptr %6, align 4, !tbaa !9
  %44 = load i32, ptr %6, align 4, !tbaa !9
  invoke void @stacktrace_add(ptr noundef @.str, i64 noundef 316, i32 noundef %44)
          to label %45 unwind label %28

45:                                               ; preds = %43
  br label %89

46:                                               ; preds = %41
  br label %47

47:                                               ; preds = %46
  br label %48

48:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %49

49:                                               ; preds = %83, %48
  %50 = load i32, ptr %12, align 4, !tbaa !9
  %51 = icmp slt i32 %50, 9
  br i1 %51, label %53, label %52

52:                                               ; preds = %49
  store i32 7, ptr %13, align 4
  br label %86

53:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  store i32 0, ptr %14, align 4, !tbaa !9
  br label %54

54:                                               ; preds = %53
  %55 = load ptr, ptr %7, align 8, !tbaa !5
  %56 = load i32, ptr %12, align 4, !tbaa !9
  %57 = invoke i32 @asn_BITSTRING_get_bit(ptr noundef %55, i32 noundef %56, ptr noundef %14)
          to label %58 unwind label %64

58:                                               ; preds = %54
  store i32 %57, ptr %6, align 4, !tbaa !9
  %59 = load i32, ptr %6, align 4, !tbaa !9
  %60 = icmp ne i32 %59, 0
  br i1 %60, label %61, label %68

61:                                               ; preds = %58
  %62 = load i32, ptr %6, align 4, !tbaa !9
  invoke void @stacktrace_add(ptr noundef @.str, i64 noundef 320, i32 noundef %62)
          to label %63 unwind label %64

63:                                               ; preds = %61
  store i32 4, ptr %13, align 4
  br label %80

64:                                               ; preds = %61, %54
  %65 = landingpad { ptr, i32 }
          cleanup
  %66 = extractvalue { ptr, i32 } %65, 0
  store ptr %66, ptr %10, align 8
  %67 = extractvalue { ptr, i32 } %65, 1
  store i32 %67, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  br label %97

68:                                               ; preds = %58
  br label %69

69:                                               ; preds = %68
  br label %70

70:                                               ; preds = %69
  %71 = load i32, ptr %14, align 4, !tbaa !9
  %72 = icmp ne i32 %71, 0
  br i1 %72, label %73, label %79

73:                                               ; preds = %70
  %74 = load i32, ptr %12, align 4, !tbaa !9
  %75 = shl i32 1, %74
  %76 = load ptr, ptr %5, align 8, !tbaa !5
  %77 = load i32, ptr %76, align 4, !tbaa !9
  %78 = or i32 %77, %75
  store i32 %78, ptr %76, align 4, !tbaa !9
  br label %79

79:                                               ; preds = %73, %70
  store i32 0, ptr %13, align 4
  br label %80

80:                                               ; preds = %79, %63
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  %81 = load i32, ptr %13, align 4
  switch i32 %81, label %86 [
    i32 0, label %82
  ]

82:                                               ; preds = %80
  br label %83

83:                                               ; preds = %82
  %84 = load i32, ptr %12, align 4, !tbaa !9
  %85 = add nsw i32 %84, 1
  store i32 %85, ptr %12, align 4, !tbaa !9
  br label %49, !llvm.loop !13

86:                                               ; preds = %80, %52
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  %87 = load i32, ptr %13, align 4
  switch i32 %87, label %95 [
    i32 7, label %88
    i32 4, label %89
  ]

88:                                               ; preds = %86
  br label %89

89:                                               ; preds = %88, %86, %45, %27
  %90 = invoke ptr @get_KeyUsage_desc()
          to label %91 unwind label %28

91:                                               ; preds = %89
  %92 = load ptr, ptr %7, align 8, !tbaa !5
  invoke void @asn_free(ptr noundef %90, ptr noundef %92)
          to label %93 unwind label %28

93:                                               ; preds = %91
  %94 = load i32, ptr %6, align 4, !tbaa !9
  store i32 %94, ptr %3, align 4
  store i32 1, ptr %13, align 4
  br label %95

95:                                               ; preds = %93, %86
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #4
  call void @_ZN7UapkiNS7SmartBAD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  %96 = load i32, ptr %3, align 4
  ret i32 %96

97:                                               ; preds = %64, %28
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #4
  call void @_ZN7UapkiNS7SmartBAD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  br label %98

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

declare ptr @get_KeyUsage_desc() #2

declare i32 @asn_BITSTRING_get_bit(ptr noundef, i32 noundef, ptr noundef) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { "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 = { 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, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.UapkiNS::SmartBA" = type { ptr }

@.str = external hidden unnamed_addr constant [33 x i8], align 1
@OID_X509v3_KeyUsage = external local_unnamed_addr global 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

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

declare ptr @asn_decode_ba_with_alloc(ptr noundef, ptr noundef) local_unnamed_addr #2

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

declare noundef i32 @_ZN7UapkiNS4Util23extnValueFromExtensionsEPK10ExtensionsPKcPbPP12ByteArray_st(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN7UapkiNS15ExtensionHelper11getKeyUsageEPK10ExtensionsRj(ptr noundef %0, ptr nocapture noundef nonnull align 4 dereferenceable(4) %1) local_unnamed_addr #3 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.UapkiNS::SmartBA", align 8
  %4 = alloca i8, align 1
  %5 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #4
  call void @_ZN7UapkiNS7SmartBAC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %3)
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %4) #4
  store i8 0, ptr %4, align 1, !tbaa !5
  store i32 0, ptr %1, align 4, !tbaa !9
  %6 = load ptr, ptr @OID_X509v3_KeyUsage, align 8, !tbaa !11
  %7 = call noundef ptr @_ZN7UapkiNS7SmartBAadEv(ptr noundef nonnull align 8 dereferenceable(8) %3)
  %8 = invoke noundef i32 @_ZN7UapkiNS4Util23extnValueFromExtensionsEPK10ExtensionsPKcPbPP12ByteArray_st(ptr noundef %0, ptr noundef %6, ptr noundef nonnull %4, ptr noundef %7)
          to label %9 unwind label %11

9:                                                ; preds = %2
  %.not = icmp eq i32 %8, 0
  br i1 %.not, label %13, label %10

10:                                               ; preds = %9
  invoke void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 314, i32 noundef %8)
          to label %.loopexit unwind label %11

11:                                               ; preds = %88, %.loopexit, %21, %15, %13, %10, %2
  %12 = landingpad { ptr, i32 }
          cleanup
  br label %90

13:                                               ; preds = %9
  %14 = invoke ptr @get_KeyUsage_desc()
          to label %15 unwind label %11

15:                                               ; preds = %13
  %16 = call noundef ptr @_ZNK7UapkiNS7SmartBA3getEv(ptr noundef nonnull align 8 dereferenceable(8) %3)
  %17 = invoke ptr @asn_decode_ba_with_alloc(ptr noundef %14, ptr noundef %16)
          to label %18 unwind label %11

18:                                               ; preds = %15
  %19 = icmp eq ptr %17, null
  br i1 %19, label %21, label %.preheader.preheader

.preheader.preheader:                             ; preds = %18
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #4
  store i32 0, ptr %5, align 4, !tbaa !9
  %20 = invoke i32 @asn_BITSTRING_get_bit(ptr noundef nonnull %17, i32 noundef 0, ptr noundef nonnull %5)
          to label %22 unwind label %.loopexit35

21:                                               ; preds = %18
  invoke void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 316, i32 noundef 2)
          to label %.loopexit unwind label %11

22:                                               ; preds = %.preheader.preheader
  %.not31 = icmp eq i32 %20, 0
  br i1 %.not31, label %25, label %23

23:                                               ; preds = %81, %74, %67, %60, %53, %46, %39, %32, %22
  %.lcssa = phi i32 [ %20, %22 ], [ %31, %32 ], [ %38, %39 ], [ %45, %46 ], [ %52, %53 ], [ %59, %60 ], [ %66, %67 ], [ %73, %74 ], [ %80, %81 ]
  invoke void @stacktrace_add(ptr noundef nonnull @.str, i64 noundef 320, i32 noundef %.lcssa)
          to label %30 unwind label %.loopexit.split-lp

.loopexit35:                                      ; preds = %.preheader.8, %.preheader.7, %.preheader.6, %.preheader.5, %.preheader.4, %.preheader.3, %.preheader.2, %.preheader.1, %.preheader.preheader
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %24

.loopexit.split-lp:                               ; preds = %23
  %lpad.loopexit.split-lp = landingpad { ptr, i32 }
          cleanup
  br label %24

24:                                               ; preds = %.loopexit.split-lp, %.loopexit35
  %lpad.phi = phi { ptr, i32 } [ %lpad.loopexit, %.loopexit35 ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #4
  br label %90

25:                                               ; preds = %22
  %26 = load i32, ptr %5, align 4, !tbaa !9
  %.not32 = icmp eq i32 %26, 0
  br i1 %.not32, label %.preheader.1, label %27

27:                                               ; preds = %25
  %28 = load i32, ptr %1, align 4, !tbaa !9
  %29 = or i32 %28, 1
  store i32 %29, ptr %1, align 4, !tbaa !9
  br label %.preheader.1

30:                                               ; preds = %23
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #4
  br label %.loopexit

.preheader.1:                                     ; preds = %25, %27
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #4
  store i32 0, ptr %5, align 4, !tbaa !9
  %31 = invoke i32 @asn_BITSTRING_get_bit(ptr noundef nonnull %17, i32 noundef 1, ptr noundef nonnull %5)
          to label %32 unwind label %.loopexit35

32:                                               ; preds = %.preheader.1
  %.not31.1 = icmp eq i32 %31, 0
  br i1 %.not31.1, label %33, label %23

33:                                               ; preds = %32
  %34 = load i32, ptr %5, align 4, !tbaa !9
  %.not32.1 = icmp eq i32 %34, 0
  br i1 %.not32.1, label %.preheader.2, label %35

35:                                               ; preds = %33
  %36 = load i32, ptr %1, align 4, !tbaa !9
  %37 = or i32 %36, 2
  store i32 %37, ptr %1, align 4, !tbaa !9
  br label %.preheader.2

.preheader.2:                                     ; preds = %35, %33
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #4
  store i32 0, ptr %5, align 4, !tbaa !9
  %38 = invoke i32 @asn_BITSTRING_get_bit(ptr noundef nonnull %17, i32 noundef 2, ptr noundef nonnull %5)
          to label %39 unwind label %.loopexit35

39:                                               ; preds = %.preheader.2
  %.not31.2 = icmp eq i32 %38, 0
  br i1 %.not31.2, label %40, label %23

40:                                               ; preds = %39
  %41 = load i32, ptr %5, align 4, !tbaa !9
  %.not32.2 = icmp eq i32 %41, 0
  br i1 %.not32.2, label %.preheader.3, label %42

42:                                               ; preds = %40
  %43 = load i32, ptr %1, align 4, !tbaa !9
  %44 = or i32 %43, 4
  store i32 %44, ptr %1, align 4, !tbaa !9
  br label %.preheader.3

.preheader.3:                                     ; preds = %42, %40
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #4
  store i32 0, ptr %5, align 4, !tbaa !9
  %45 = invoke i32 @asn_BITSTRING_get_bit(ptr noundef nonnull %17, i32 noundef 3, ptr noundef nonnull %5)
          to label %46 unwind label %.loopexit35

46:                                               ; preds = %.preheader.3
  %.not31.3 = icmp eq i32 %45, 0
  br i1 %.not31.3, label %47, label %23

47:                                               ; preds = %46
  %48 = load i32, ptr %5, align 4, !tbaa !9
  %.not32.3 = icmp eq i32 %48, 0
  br i1 %.not32.3, label %.preheader.4, label %49

49:                                               ; preds = %47
  %50 = load i32, ptr %1, align 4, !tbaa !9
  %51 = or i32 %50, 8
  store i32 %51, ptr %1, align 4, !tbaa !9
  br label %.preheader.4

.preheader.4:                                     ; preds = %49, %47
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #4
  store i32 0, ptr %5, align 4, !tbaa !9
  %52 = invoke i32 @asn_BITSTRING_get_bit(ptr noundef nonnull %17, i32 noundef 4, ptr noundef nonnull %5)
          to label %53 unwind label %.loopexit35

53:                                               ; preds = %.preheader.4
  %.not31.4 = icmp eq i32 %52, 0
  br i1 %.not31.4, label %54, label %23

54:                                               ; preds = %53
  %55 = load i32, ptr %5, align 4, !tbaa !9
  %.not32.4 = icmp eq i32 %55, 0
  br i1 %.not32.4, label %.preheader.5, label %56

56:                                               ; preds = %54
  %57 = load i32, ptr %1, align 4, !tbaa !9
  %58 = or i32 %57, 16
  store i32 %58, ptr %1, align 4, !tbaa !9
  br label %.preheader.5

.preheader.5:                                     ; preds = %56, %54
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #4
  store i32 0, ptr %5, align 4, !tbaa !9
  %59 = invoke i32 @asn_BITSTRING_get_bit(ptr noundef nonnull %17, i32 noundef 5, ptr noundef nonnull %5)
          to label %60 unwind label %.loopexit35

60:                                               ; preds = %.preheader.5
  %.not31.5 = icmp eq i32 %59, 0
  br i1 %.not31.5, label %61, label %23

61:                                               ; preds = %60
  %62 = load i32, ptr %5, align 4, !tbaa !9
  %.not32.5 = icmp eq i32 %62, 0
  br i1 %.not32.5, label %.preheader.6, label %63

63:                                               ; preds = %61
  %64 = load i32, ptr %1, align 4, !tbaa !9
  %65 = or i32 %64, 32
  store i32 %65, ptr %1, align 4, !tbaa !9
  br label %.preheader.6

.preheader.6:                                     ; preds = %63, %61
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #4
  store i32 0, ptr %5, align 4, !tbaa !9
  %66 = invoke i32 @asn_BITSTRING_get_bit(ptr noundef nonnull %17, i32 noundef 6, ptr noundef nonnull %5)
          to label %67 unwind label %.loopexit35

67:                                               ; preds = %.preheader.6
  %.not31.6 = icmp eq i32 %66, 0
  br i1 %.not31.6, label %68, label %23

68:                                               ; preds = %67
  %69 = load i32, ptr %5, align 4, !tbaa !9
  %.not32.6 = icmp eq i32 %69, 0
  br i1 %.not32.6, label %.preheader.7, label %70

70:                                               ; preds = %68
  %71 = load i32, ptr %1, align 4, !tbaa !9
  %72 = or i32 %71, 64
  store i32 %72, ptr %1, align 4, !tbaa !9
  br label %.preheader.7

.preheader.7:                                     ; preds = %70, %68
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #4
  store i32 0, ptr %5, align 4, !tbaa !9
  %73 = invoke i32 @asn_BITSTRING_get_bit(ptr noundef nonnull %17, i32 noundef 7, ptr noundef nonnull %5)
          to label %74 unwind label %.loopexit35

74:                                               ; preds = %.preheader.7
  %.not31.7 = icmp eq i32 %73, 0
  br i1 %.not31.7, label %75, label %23

75:                                               ; preds = %74
  %76 = load i32, ptr %5, align 4, !tbaa !9
  %.not32.7 = icmp eq i32 %76, 0
  br i1 %.not32.7, label %.preheader.8, label %77

77:                                               ; preds = %75
  %78 = load i32, ptr %1, align 4, !tbaa !9
  %79 = or i32 %78, 128
  store i32 %79, ptr %1, align 4, !tbaa !9
  br label %.preheader.8

.preheader.8:                                     ; preds = %77, %75
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #4
  store i32 0, ptr %5, align 4, !tbaa !9
  %80 = invoke i32 @asn_BITSTRING_get_bit(ptr noundef nonnull %17, i32 noundef 8, ptr noundef nonnull %5)
          to label %81 unwind label %.loopexit35

81:                                               ; preds = %.preheader.8
  %.not31.8 = icmp eq i32 %80, 0
  br i1 %.not31.8, label %82, label %23

82:                                               ; preds = %81
  %83 = load i32, ptr %5, align 4, !tbaa !9
  %.not32.8 = icmp eq i32 %83, 0
  br i1 %.not32.8, label %.loopexit.loopexit, label %84

84:                                               ; preds = %82
  %85 = load i32, ptr %1, align 4, !tbaa !9
  %86 = or i32 %85, 256
  store i32 %86, ptr %1, align 4, !tbaa !9
  br label %.loopexit.loopexit

.loopexit.loopexit:                               ; preds = %84, %82
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #4
  br label %.loopexit

.loopexit:                                        ; preds = %.loopexit.loopexit, %30, %21, %10
  %.2 = phi i32 [ %8, %10 ], [ 2, %21 ], [ %.lcssa, %30 ], [ 0, %.loopexit.loopexit ]
  %.022 = phi ptr [ null, %10 ], [ null, %21 ], [ %17, %30 ], [ %17, %.loopexit.loopexit ]
  %87 = invoke ptr @get_KeyUsage_desc()
          to label %88 unwind label %11

88:                                               ; preds = %.loopexit
  invoke void @asn_free(ptr noundef %87, ptr noundef %.022)
          to label %89 unwind label %11

89:                                               ; preds = %88
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #4
  call void @_ZN7UapkiNS7SmartBAD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %3) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #4
  ret i32 %.2

90:                                               ; preds = %24, %11
  %.pn = phi { ptr, i32 } [ %12, %11 ], [ %lpad.phi, %24 ]
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #4
  call void @_ZN7UapkiNS7SmartBAD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %3) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #4
  resume { ptr, i32 } %.pn
}

declare ptr @get_KeyUsage_desc() local_unnamed_addr #2

declare i32 @asn_BITSTRING_get_bit(ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { "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 = { 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 = !{!"bool", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"any pointer", !7, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass