; LLVM IR from openssl/openssl :: providers/implementations/encode_decode (ml_common_codecs)

; 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"

%struct.ML_COMMON_PKCS8_FMT = type { ptr, i64, i32, i32, i16, i64, i64, i32, i64, i64, i64, i64 }
%struct.ML_COMMON_PKCS8_FMT_PREF = type { ptr, i32 }

@.str = external hidden unnamed_addr constant [4 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [108 x i8], align 1
@__func__.ossl_ml_common_pkcs8_fmt_order = external hidden unnamed_addr constant [31 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [41 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local ptr @ossl_ml_common_pkcs8_fmt_order(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3) #0 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store ptr %3, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  store i32 0, ptr %12, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  %17 = load ptr, ptr %9, align 8, !tbaa !5
  store ptr %17, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  store ptr @.str, ptr %15, align 8, !tbaa !5
  %18 = call ptr @CRYPTO_zalloc(i64 noundef 112, ptr noundef @.str.1, i32 noundef 45)
  store ptr %18, ptr %10, align 8, !tbaa !5
  %19 = icmp eq ptr %18, null
  br i1 %19, label %20, label %21

20:                                               ; preds = %4
  store ptr null, ptr %5, align 8
  store i32 1, ptr %16, align 4
  br label %125

21:                                               ; preds = %4
  store i32 0, ptr %11, align 4, !tbaa !9
  br label %22

22:                                               ; preds = %40, %21
  %23 = load i32, ptr %11, align 4, !tbaa !9
  %24 = icmp slt i32 %23, 6
  br i1 %24, label %25, label %43

25:                                               ; preds = %22
  %26 = load ptr, ptr %7, align 8, !tbaa !5
  %27 = load i32, ptr %11, align 4, !tbaa !9
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds %struct.ML_COMMON_PKCS8_FMT, ptr %26, i64 %28
  %30 = load ptr, ptr %10, align 8, !tbaa !5
  %31 = load i32, ptr %11, align 4, !tbaa !9
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds %struct.ML_COMMON_PKCS8_FMT_PREF, ptr %30, i64 %32
  %34 = getelementptr inbounds %struct.ML_COMMON_PKCS8_FMT_PREF, ptr %33, i32 0, i32 0
  store ptr %29, ptr %34, align 8, !tbaa !11
  %35 = load ptr, ptr %10, align 8, !tbaa !5
  %36 = load i32, ptr %11, align 4, !tbaa !9
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds %struct.ML_COMMON_PKCS8_FMT_PREF, ptr %35, i64 %37
  %39 = getelementptr inbounds %struct.ML_COMMON_PKCS8_FMT_PREF, ptr %38, i32 0, i32 1
  store i32 0, ptr %39, align 8, !tbaa !13
  br label %40

40:                                               ; preds = %25
  %41 = load i32, ptr %11, align 4, !tbaa !9
  %42 = add nsw i32 %41, 1
  store i32 %42, ptr %11, align 4, !tbaa !9
  br label %22, !llvm.loop !14

43:                                               ; preds = %22
  %44 = load ptr, ptr %9, align 8, !tbaa !5
  %45 = icmp eq ptr %44, null
  br i1 %45, label %46, label %48

46:                                               ; preds = %43
  %47 = load ptr, ptr %10, align 8, !tbaa !5
  store ptr %47, ptr %5, align 8
  store i32 1, ptr %16, align 4
  br label %125

48:                                               ; preds = %43
  br label %49

49:                                               ; preds = %107, %48
  %50 = load ptr, ptr %13, align 8, !tbaa !5
  %51 = load ptr, ptr %15, align 8, !tbaa !5
  %52 = call i64 @strspn(ptr noundef %50, ptr noundef %51) #5
  %53 = load ptr, ptr %13, align 8, !tbaa !5
  %54 = getelementptr inbounds i8, ptr %53, i64 %52
  store ptr %54, ptr %13, align 8, !tbaa !5
  %55 = load i8, ptr %54, align 1, !tbaa !16
  %56 = sext i8 %55 to i32
  %57 = icmp eq i32 %56, 0
  br i1 %57, label %58, label %59

58:                                               ; preds = %49
  br label %110

59:                                               ; preds = %49
  %60 = load ptr, ptr %13, align 8, !tbaa !5
  %61 = load ptr, ptr %13, align 8, !tbaa !5
  %62 = load ptr, ptr %15, align 8, !tbaa !5
  %63 = call i64 @strcspn(ptr noundef %61, ptr noundef %62) #5
  %64 = getelementptr inbounds i8, ptr %60, i64 %63
  store ptr %64, ptr %14, align 8, !tbaa !5
  store i32 0, ptr %11, align 4, !tbaa !9
  br label %65

65:                                               ; preds = %102, %59
  %66 = load i32, ptr %11, align 4, !tbaa !9
  %67 = icmp slt i32 %66, 6
  br i1 %67, label %68, label %105

68:                                               ; preds = %65
  %69 = load ptr, ptr %10, align 8, !tbaa !5
  %70 = load i32, ptr %11, align 4, !tbaa !9
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds %struct.ML_COMMON_PKCS8_FMT_PREF, ptr %69, i64 %71
  %73 = getelementptr inbounds %struct.ML_COMMON_PKCS8_FMT_PREF, ptr %72, i32 0, i32 1
  %74 = load i32, ptr %73, align 8, !tbaa !13
  %75 = icmp sgt i32 %74, 0
  br i1 %75, label %93, label %76

76:                                               ; preds = %68
  %77 = load ptr, ptr %10, align 8, !tbaa !5
  %78 = load i32, ptr %11, align 4, !tbaa !9
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds %struct.ML_COMMON_PKCS8_FMT_PREF, ptr %77, i64 %79
  %81 = getelementptr inbounds %struct.ML_COMMON_PKCS8_FMT_PREF, ptr %80, i32 0, i32 0
  %82 = load ptr, ptr %81, align 8, !tbaa !11
  %83 = getelementptr inbounds %struct.ML_COMMON_PKCS8_FMT, ptr %82, i32 0, i32 0
  %84 = load ptr, ptr %83, align 8, !tbaa !17
  %85 = load ptr, ptr %13, align 8, !tbaa !5
  %86 = load ptr, ptr %14, align 8, !tbaa !5
  %87 = load ptr, ptr %13, align 8, !tbaa !5
  %88 = ptrtoint ptr %86 to i64
  %89 = ptrtoint ptr %87 to i64
  %90 = sub i64 %88, %89
  %91 = call i32 @OPENSSL_strncasecmp(ptr noundef %84, ptr noundef %85, i64 noundef %90)
  %92 = icmp ne i32 %91, 0
  br i1 %92, label %93, label %94

93:                                               ; preds = %76, %68
  br label %102

94:                                               ; preds = %76
  %95 = load i32, ptr %12, align 4, !tbaa !9
  %96 = add nsw i32 %95, 1
  store i32 %96, ptr %12, align 4, !tbaa !9
  %97 = load ptr, ptr %10, align 8, !tbaa !5
  %98 = load i32, ptr %11, align 4, !tbaa !9
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds %struct.ML_COMMON_PKCS8_FMT_PREF, ptr %97, i64 %99
  %101 = getelementptr inbounds %struct.ML_COMMON_PKCS8_FMT_PREF, ptr %100, i32 0, i32 1
  store i32 %96, ptr %101, align 8, !tbaa !13
  br label %105

102:                                              ; preds = %93
  %103 = load i32, ptr %11, align 4, !tbaa !9
  %104 = add nsw i32 %103, 1
  store i32 %104, ptr %11, align 4, !tbaa !9
  br label %65, !llvm.loop !21

105:                                              ; preds = %94, %65
  %106 = load ptr, ptr %14, align 8, !tbaa !5
  store ptr %106, ptr %13, align 8, !tbaa !5
  br label %107

107:                                              ; preds = %105
  %108 = load i32, ptr %12, align 4, !tbaa !9
  %109 = icmp slt i32 %108, 6
  br i1 %109, label %49, label %110, !llvm.loop !22

110:                                              ; preds = %107, %58
  %111 = load i32, ptr %12, align 4, !tbaa !9
  %112 = icmp eq i32 %111, 0
  br i1 %112, label %113, label %117

113:                                              ; preds = %110
  %114 = load ptr, ptr %10, align 8, !tbaa !5
  call void @CRYPTO_free(ptr noundef %114, ptr noundef @.str.1, i32 noundef 81)
  call void @ERR_new()
  call void @ERR_set_debug(ptr noundef @.str.1, i32 noundef 82, ptr noundef @__func__.ossl_ml_common_pkcs8_fmt_order)
  %115 = load ptr, ptr %6, align 8, !tbaa !5
  %116 = load ptr, ptr %8, align 8, !tbaa !5
  call void (i32, i32, ptr, ...) @ERR_set_error(i32 noundef 57, i32 noundef 245, ptr noundef @.str.2, ptr noundef %115, ptr noundef %116)
  store ptr null, ptr %5, align 8
  store i32 1, ptr %16, align 4
  br label %125

117:                                              ; preds = %110
  %118 = load ptr, ptr %10, align 8, !tbaa !5
  call void @qsort(ptr noundef %118, i64 noundef 6, i64 noundef 16, ptr noundef @pref_cmp)
  %119 = load ptr, ptr %10, align 8, !tbaa !5
  %120 = load i32, ptr %12, align 4, !tbaa !9
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds %struct.ML_COMMON_PKCS8_FMT_PREF, ptr %119, i64 %121
  %123 = getelementptr inbounds %struct.ML_COMMON_PKCS8_FMT_PREF, ptr %122, i32 0, i32 0
  store ptr null, ptr %123, align 8, !tbaa !11
  %124 = load ptr, ptr %10, align 8, !tbaa !5
  store ptr %124, ptr %5, align 8
  store i32 1, ptr %16, align 4
  br label %125

125:                                              ; preds = %117, %113, %46, %20
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  %126 = load ptr, ptr %5, align 8
  ret ptr %126
}

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

declare ptr @CRYPTO_zalloc(i64 noundef, ptr noundef, i32 noundef) #2

; Function Attrs: nounwind willreturn memory(read)
declare i64 @strspn(ptr noundef, ptr noundef) #3

; Function Attrs: nounwind willreturn memory(read)
declare i64 @strcspn(ptr noundef, ptr noundef) #3

declare i32 @OPENSSL_strncasecmp(ptr noundef, ptr noundef, i64 noundef) #2

declare void @CRYPTO_free(ptr noundef, ptr noundef, i32 noundef) #2

declare void @ERR_new() #2

declare void @ERR_set_debug(ptr noundef, i32 noundef, ptr noundef) #2

declare void @ERR_set_error(i32 noundef, i32 noundef, ptr noundef, ...) #2

declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
declare hidden i32 @pref_cmp(ptr noundef, ptr noundef) #0

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

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { nounwind willreturn memory(read) "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 }
attributes #5 = { nounwind willreturn memory(read) }

!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/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 0}
!12 = !{!"", !6, i64 0, !10, i64 8}
!13 = !{!12, !10, i64 8}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = !{!7, !7, i64 0}
!17 = !{!18, !6, i64 0}
!18 = !{!"", !6, i64 0, !19, i64 8, !10, i64 16, !10, i64 20, !20, i64 24, !19, i64 32, !19, i64 40, !10, i64 48, !19, i64 56, !19, i64 64, !19, i64 72, !19, i64 80}
!19 = !{!"long", !7, i64 0}
!20 = !{!"short", !7, i64 0}
!21 = distinct !{!21, !15}
!22 = distinct !{!22, !15}


; 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"

%struct.ML_COMMON_PKCS8_FMT_PREF = type { ptr, i32 }

@.str = external hidden unnamed_addr constant [4 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [108 x i8], align 1
@__func__.ossl_ml_common_pkcs8_fmt_order = external hidden unnamed_addr constant [31 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [41 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local ptr @ossl_ml_common_pkcs8_fmt_order(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3) local_unnamed_addr #0 {
  %5 = tail call ptr @CRYPTO_zalloc(i64 noundef 112, ptr noundef nonnull @.str.1, i32 noundef 45) #4
  %6 = icmp eq ptr %5, null
  br i1 %6, label %81, label %.preheader47.preheader

.preheader47.preheader:                           ; preds = %4
  store ptr %1, ptr %5, align 8, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %5, i64 8
  store i32 0, ptr %7, align 8, !tbaa !11
  %8 = getelementptr inbounds i8, ptr %1, i64 88
  %9 = getelementptr inbounds i8, ptr %5, i64 16
  store ptr %8, ptr %9, align 8, !tbaa !5
  %10 = getelementptr inbounds i8, ptr %5, i64 24
  store i32 0, ptr %10, align 8, !tbaa !11
  %11 = getelementptr inbounds i8, ptr %1, i64 176
  %12 = getelementptr inbounds i8, ptr %5, i64 32
  store ptr %11, ptr %12, align 8, !tbaa !5
  %13 = getelementptr inbounds i8, ptr %5, i64 40
  store i32 0, ptr %13, align 8, !tbaa !11
  %14 = getelementptr inbounds i8, ptr %1, i64 264
  %15 = getelementptr inbounds i8, ptr %5, i64 48
  store ptr %14, ptr %15, align 8, !tbaa !5
  %16 = getelementptr inbounds i8, ptr %5, i64 56
  store i32 0, ptr %16, align 8, !tbaa !11
  %17 = getelementptr inbounds i8, ptr %1, i64 352
  %18 = getelementptr inbounds i8, ptr %5, i64 64
  store ptr %17, ptr %18, align 8, !tbaa !5
  %19 = getelementptr inbounds i8, ptr %5, i64 72
  store i32 0, ptr %19, align 8, !tbaa !11
  %20 = getelementptr inbounds i8, ptr %1, i64 440
  %21 = getelementptr inbounds i8, ptr %5, i64 80
  store ptr %20, ptr %21, align 8, !tbaa !5
  %22 = getelementptr inbounds i8, ptr %5, i64 88
  store i32 0, ptr %22, align 8, !tbaa !11
  %23 = icmp eq ptr %3, null
  br i1 %23, label %81, label %.preheader

.preheader:                                       ; preds = %.preheader47.preheader, %.loopexit
  %.041 = phi i32 [ %.142, %.loopexit ], [ 0, %.preheader47.preheader ]
  %.040 = phi ptr [ %30, %.loopexit ], [ %3, %.preheader47.preheader ]
  %24 = tail call i64 @strspn(ptr noundef %.040, ptr noundef nonnull @.str) #5
  %25 = getelementptr inbounds i8, ptr %.040, i64 %24
  %26 = load i8, ptr %25, align 1, !tbaa !12
  %27 = icmp eq i8 %26, 0
  br i1 %27, label %76, label %28

28:                                               ; preds = %.preheader
  %29 = tail call i64 @strcspn(ptr noundef nonnull %25, ptr noundef nonnull @.str) #5
  %30 = getelementptr inbounds i8, ptr %25, i64 %29
  %31 = load i32, ptr %7, align 8, !tbaa !11
  %32 = icmp sgt i32 %31, 0
  br i1 %32, label %40, label %33

33:                                               ; preds = %28
  %34 = load ptr, ptr %5, align 8, !tbaa !5
  %35 = load ptr, ptr %34, align 8, !tbaa !13
  %36 = tail call i32 @OPENSSL_strncasecmp(ptr noundef %35, ptr noundef nonnull %25, i64 noundef %29) #4
  %.not = icmp eq i32 %36, 0
  br i1 %.not, label %37, label %40

37:                                               ; preds = %71, %64, %57, %50, %43, %33
  %.lcssa = phi ptr [ %5, %33 ], [ %9, %43 ], [ %12, %50 ], [ %15, %57 ], [ %18, %64 ], [ %21, %71 ]
  %38 = getelementptr inbounds i8, ptr %.lcssa, i64 8
  %39 = add nsw i32 %.041, 1
  store i32 %39, ptr %38, align 8, !tbaa !11
  br label %.loopexit

40:                                               ; preds = %28, %33
  %41 = load i32, ptr %10, align 8, !tbaa !11
  %42 = icmp sgt i32 %41, 0
  br i1 %42, label %47, label %43

43:                                               ; preds = %40
  %44 = load ptr, ptr %9, align 8, !tbaa !5
  %45 = load ptr, ptr %44, align 8, !tbaa !13
  %46 = tail call i32 @OPENSSL_strncasecmp(ptr noundef %45, ptr noundef nonnull %25, i64 noundef %29) #4
  %.not.1 = icmp eq i32 %46, 0
  br i1 %.not.1, label %37, label %47

47:                                               ; preds = %43, %40
  %48 = load i32, ptr %13, align 8, !tbaa !11
  %49 = icmp sgt i32 %48, 0
  br i1 %49, label %54, label %50

50:                                               ; preds = %47
  %51 = load ptr, ptr %12, align 8, !tbaa !5
  %52 = load ptr, ptr %51, align 8, !tbaa !13
  %53 = tail call i32 @OPENSSL_strncasecmp(ptr noundef %52, ptr noundef nonnull %25, i64 noundef %29) #4
  %.not.2 = icmp eq i32 %53, 0
  br i1 %.not.2, label %37, label %54

54:                                               ; preds = %50, %47
  %55 = load i32, ptr %16, align 8, !tbaa !11
  %56 = icmp sgt i32 %55, 0
  br i1 %56, label %61, label %57

57:                                               ; preds = %54
  %58 = load ptr, ptr %15, align 8, !tbaa !5
  %59 = load ptr, ptr %58, align 8, !tbaa !13
  %60 = tail call i32 @OPENSSL_strncasecmp(ptr noundef %59, ptr noundef nonnull %25, i64 noundef %29) #4
  %.not.3 = icmp eq i32 %60, 0
  br i1 %.not.3, label %37, label %61

61:                                               ; preds = %57, %54
  %62 = load i32, ptr %19, align 8, !tbaa !11
  %63 = icmp sgt i32 %62, 0
  br i1 %63, label %68, label %64

64:                                               ; preds = %61
  %65 = load ptr, ptr %18, align 8, !tbaa !5
  %66 = load ptr, ptr %65, align 8, !tbaa !13
  %67 = tail call i32 @OPENSSL_strncasecmp(ptr noundef %66, ptr noundef nonnull %25, i64 noundef %29) #4
  %.not.4 = icmp eq i32 %67, 0
  br i1 %.not.4, label %37, label %68

68:                                               ; preds = %64, %61
  %69 = load i32, ptr %22, align 8, !tbaa !11
  %70 = icmp sgt i32 %69, 0
  br i1 %70, label %.loopexit, label %71

71:                                               ; preds = %68
  %72 = load ptr, ptr %21, align 8, !tbaa !5
  %73 = load ptr, ptr %72, align 8, !tbaa !13
  %74 = tail call i32 @OPENSSL_strncasecmp(ptr noundef %73, ptr noundef nonnull %25, i64 noundef %29) #4
  %.not.5 = icmp eq i32 %74, 0
  br i1 %.not.5, label %37, label %.loopexit

.loopexit:                                        ; preds = %68, %71, %37
  %.142 = phi i32 [ %39, %37 ], [ %.041, %71 ], [ %.041, %68 ]
  %75 = icmp slt i32 %.142, 6
  br i1 %75, label %.preheader, label %.thread, !llvm.loop !17

76:                                               ; preds = %.preheader
  %77 = icmp eq i32 %.041, 0
  br i1 %77, label %78, label %.thread

78:                                               ; preds = %76
  tail call void @CRYPTO_free(ptr noundef nonnull %5, ptr noundef nonnull @.str.1, i32 noundef 81) #4
  tail call void @ERR_new() #4
  tail call void @ERR_set_debug(ptr noundef nonnull @.str.1, i32 noundef 82, ptr noundef nonnull @__func__.ossl_ml_common_pkcs8_fmt_order) #4
  tail call void (i32, i32, ptr, ...) @ERR_set_error(i32 noundef 57, i32 noundef 245, ptr noundef nonnull @.str.2, ptr noundef %0, ptr noundef %2) #4
  br label %81

.thread:                                          ; preds = %.loopexit, %76
  %.246 = phi i32 [ %.041, %76 ], [ %.142, %.loopexit ]
  tail call void @qsort(ptr noundef nonnull %5, i64 noundef 6, i64 noundef 16, ptr noundef nonnull @pref_cmp) #4
  %79 = sext i32 %.246 to i64
  %80 = getelementptr inbounds %struct.ML_COMMON_PKCS8_FMT_PREF, ptr %5, i64 %79
  store ptr null, ptr %80, align 8, !tbaa !5
  br label %81

81:                                               ; preds = %.preheader47.preheader, %4, %.thread, %78
  %.0 = phi ptr [ null, %78 ], [ %5, %.thread ], [ null, %4 ], [ %5, %.preheader47.preheader ]
  ret ptr %.0
}

declare ptr @CRYPTO_zalloc(i64 noundef, ptr noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strspn(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strcspn(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #2

declare i32 @OPENSSL_strncasecmp(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #1

declare void @CRYPTO_free(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #1

declare void @ERR_new() local_unnamed_addr #1

declare void @ERR_set_debug(ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

declare void @ERR_set_error(i32 noundef, i32 noundef, ptr noundef, ...) local_unnamed_addr #1

; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare hidden i32 @pref_cmp(ptr noundef, ptr noundef) #0

attributes #0 = { 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 #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 nofree nounwind willreturn memory(argmem: read) "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 = { nofree "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 }
attributes #5 = { nounwind willreturn memory(read) }

!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, !7, i64 0}
!6 = !{!"", !7, i64 0, !10, i64 8}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!6, !10, i64 8}
!12 = !{!8, !8, i64 0}
!13 = !{!14, !7, i64 0}
!14 = !{!"", !7, i64 0, !15, i64 8, !10, i64 16, !10, i64 20, !16, i64 24, !15, i64 32, !15, i64 40, !10, i64 48, !15, i64 56, !15, i64 64, !15, i64 72, !15, i64 80}
!15 = !{!"long", !8, i64 0}
!16 = !{!"short", !8, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass