; LLVM IR from openssl/openssl :: crypto/x509 (pcy_node)

; 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.X509_POLICY_TREE_st = type { i64, i64, ptr, i32, ptr, ptr, ptr, i32 }
%struct.X509_POLICY_NODE_st = type { ptr, ptr, i32 }
%struct.X509_POLICY_DATA_st = type { i32, ptr, ptr, ptr }
%struct.X509_POLICY_LEVEL_st = type { ptr, ptr, ptr, i32 }

@.str = external hidden unnamed_addr constant [72 x i8], align 1
@__func__.ossl_policy_level_add_node = external hidden unnamed_addr constant [27 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local ptr @ossl_policy_node_cmp_new() #0

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @ossl_check_X509_POLICY_NODE_sk_type(ptr noundef) #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @ossl_check_X509_POLICY_NODE_type(ptr noundef) #2

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

; Function Attrs: nounwind uwtable
define dso_local ptr @ossl_policy_level_add_node(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, i32 noundef %4) #0 {
  %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 ptr, align 8
  %13 = alloca i32, align 4
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  store ptr %2, ptr %9, align 8, !tbaa !5
  store ptr %3, ptr %10, align 8, !tbaa !5
  store i32 %4, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  %14 = load ptr, ptr %10, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct.X509_POLICY_TREE_st, ptr %14, i32 0, i32 1
  %16 = load i64, ptr %15, align 8, !tbaa !11
  %17 = icmp ugt i64 %16, 0
  br i1 %17, label %18, label %27

18:                                               ; preds = %5
  %19 = load ptr, ptr %10, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.X509_POLICY_TREE_st, ptr %19, i32 0, i32 0
  %21 = load i64, ptr %20, align 8, !tbaa !14
  %22 = load ptr, ptr %10, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.X509_POLICY_TREE_st, ptr %22, i32 0, i32 1
  %24 = load i64, ptr %23, align 8, !tbaa !11
  %25 = icmp uge i64 %21, %24
  br i1 %25, label %26, label %27

26:                                               ; preds = %18
  store ptr null, ptr %6, align 8
  store i32 1, ptr %13, align 4
  br label %147

27:                                               ; preds = %18, %5
  %28 = call ptr @CRYPTO_zalloc(i64 noundef 24, ptr noundef @.str, i32 noundef 71)
  store ptr %28, ptr %12, align 8, !tbaa !5
  %29 = load ptr, ptr %12, align 8, !tbaa !5
  %30 = icmp eq ptr %29, null
  br i1 %30, label %31, label %32

31:                                               ; preds = %27
  store ptr null, ptr %6, align 8
  store i32 1, ptr %13, align 4
  br label %147

32:                                               ; preds = %27
  %33 = load ptr, ptr %8, align 8, !tbaa !5
  %34 = load ptr, ptr %12, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.X509_POLICY_NODE_st, ptr %34, i32 0, i32 0
  store ptr %33, ptr %35, align 8, !tbaa !15
  %36 = load ptr, ptr %9, align 8, !tbaa !5
  %37 = load ptr, ptr %12, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.X509_POLICY_NODE_st, ptr %37, i32 0, i32 1
  store ptr %36, ptr %38, align 8, !tbaa !17
  %39 = load ptr, ptr %7, align 8, !tbaa !5
  %40 = icmp ne ptr %39, null
  br i1 %40, label %41, label %84

41:                                               ; preds = %32
  %42 = load ptr, ptr %8, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.X509_POLICY_DATA_st, ptr %42, i32 0, i32 1
  %44 = load ptr, ptr %43, align 8, !tbaa !18
  %45 = call i32 @OBJ_obj2nid(ptr noundef %44)
  %46 = icmp eq i32 %45, 746
  br i1 %46, label %47, label %57

47:                                               ; preds = %41
  %48 = load ptr, ptr %7, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.X509_POLICY_LEVEL_st, ptr %48, i32 0, i32 2
  %50 = load ptr, ptr %49, align 8, !tbaa !20
  %51 = icmp ne ptr %50, null
  br i1 %51, label %52, label %53

52:                                               ; preds = %47
  br label %145

53:                                               ; preds = %47
  %54 = load ptr, ptr %12, align 8, !tbaa !5
  %55 = load ptr, ptr %7, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.X509_POLICY_LEVEL_st, ptr %55, i32 0, i32 2
  store ptr %54, ptr %56, align 8, !tbaa !20
  br label %83

57:                                               ; preds = %41
  %58 = load ptr, ptr %7, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.X509_POLICY_LEVEL_st, ptr %58, i32 0, i32 1
  %60 = load ptr, ptr %59, align 8, !tbaa !22
  %61 = icmp eq ptr %60, null
  br i1 %61, label %62, label %66

62:                                               ; preds = %57
  %63 = call ptr @ossl_policy_node_cmp_new()
  %64 = load ptr, ptr %7, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.X509_POLICY_LEVEL_st, ptr %64, i32 0, i32 1
  store ptr %63, ptr %65, align 8, !tbaa !22
  br label %66

66:                                               ; preds = %62, %57
  %67 = load ptr, ptr %7, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.X509_POLICY_LEVEL_st, ptr %67, i32 0, i32 1
  %69 = load ptr, ptr %68, align 8, !tbaa !22
  %70 = icmp eq ptr %69, null
  br i1 %70, label %71, label %72

71:                                               ; preds = %66
  call void @ERR_new()
  call void @ERR_set_debug(ptr noundef @.str, i32 noundef 86, ptr noundef @__func__.ossl_policy_level_add_node)
  call void (i32, i32, ptr, ...) @ERR_set_error(i32 noundef 34, i32 noundef 524299, ptr noundef null)
  br label %145

72:                                               ; preds = %66
  %73 = load ptr, ptr %7, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.X509_POLICY_LEVEL_st, ptr %73, i32 0, i32 1
  %75 = load ptr, ptr %74, align 8, !tbaa !22
  %76 = call ptr @ossl_check_X509_POLICY_NODE_sk_type(ptr noundef %75)
  %77 = load ptr, ptr %12, align 8, !tbaa !5
  %78 = call ptr @ossl_check_X509_POLICY_NODE_type(ptr noundef %77)
  %79 = call i32 @OPENSSL_sk_push(ptr noundef %76, ptr noundef %78)
  %80 = icmp ne i32 %79, 0
  br i1 %80, label %82, label %81

81:                                               ; preds = %72
  call void @ERR_new()
  call void @ERR_set_debug(ptr noundef @.str, i32 noundef 90, ptr noundef @__func__.ossl_policy_level_add_node)
  call void (i32, i32, ptr, ...) @ERR_set_error(i32 noundef 34, i32 noundef 524303, ptr noundef null)
  br label %145

82:                                               ; preds = %72
  br label %83

83:                                               ; preds = %82, %53
  br label %84

84:                                               ; preds = %83, %32
  %85 = load i32, ptr %11, align 4, !tbaa !9
  %86 = icmp ne i32 %85, 0
  br i1 %86, label %87, label %111

87:                                               ; preds = %84
  %88 = load ptr, ptr %10, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.X509_POLICY_TREE_st, ptr %88, i32 0, i32 4
  %90 = load ptr, ptr %89, align 8, !tbaa !23
  %91 = icmp eq ptr %90, null
  br i1 %91, label %92, label %96

92:                                               ; preds = %87
  %93 = call ptr @sk_X509_POLICY_DATA_new_null()
  %94 = load ptr, ptr %10, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.X509_POLICY_TREE_st, ptr %94, i32 0, i32 4
  store ptr %93, ptr %95, align 8, !tbaa !23
  br label %96

96:                                               ; preds = %92, %87
  %97 = load ptr, ptr %10, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.X509_POLICY_TREE_st, ptr %97, i32 0, i32 4
  %99 = load ptr, ptr %98, align 8, !tbaa !23
  %100 = icmp eq ptr %99, null
  br i1 %100, label %101, label %102

101:                                              ; preds = %96
  call void @ERR_new()
  call void @ERR_set_debug(ptr noundef @.str, i32 noundef 100, ptr noundef @__func__.ossl_policy_level_add_node)
  call void (i32, i32, ptr, ...) @ERR_set_error(i32 noundef 34, i32 noundef 524303, ptr noundef null)
  br label %125

102:                                              ; preds = %96
  %103 = load ptr, ptr %10, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.X509_POLICY_TREE_st, ptr %103, i32 0, i32 4
  %105 = load ptr, ptr %104, align 8, !tbaa !23
  %106 = load ptr, ptr %8, align 8, !tbaa !5
  %107 = call i32 @sk_X509_POLICY_DATA_push(ptr noundef %105, ptr noundef %106)
  %108 = icmp ne i32 %107, 0
  br i1 %108, label %110, label %109

109:                                              ; preds = %102
  call void @ERR_new()
  call void @ERR_set_debug(ptr noundef @.str, i32 noundef 104, ptr noundef @__func__.ossl_policy_level_add_node)
  call void (i32, i32, ptr, ...) @ERR_set_error(i32 noundef 34, i32 noundef 524303, ptr noundef null)
  br label %125

110:                                              ; preds = %102
  br label %111

111:                                              ; preds = %110, %84
  %112 = load ptr, ptr %10, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.X509_POLICY_TREE_st, ptr %112, i32 0, i32 0
  %114 = load i64, ptr %113, align 8, !tbaa !14
  %115 = add i64 %114, 1
  store i64 %115, ptr %113, align 8, !tbaa !14
  %116 = load ptr, ptr %9, align 8, !tbaa !5
  %117 = icmp ne ptr %116, null
  br i1 %117, label %118, label %123

118:                                              ; preds = %111
  %119 = load ptr, ptr %9, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.X509_POLICY_NODE_st, ptr %119, i32 0, i32 2
  %121 = load i32, ptr %120, align 8, !tbaa !24
  %122 = add nsw i32 %121, 1
  store i32 %122, ptr %120, align 8, !tbaa !24
  br label %123

123:                                              ; preds = %118, %111
  %124 = load ptr, ptr %12, align 8, !tbaa !5
  store ptr %124, ptr %6, align 8
  store i32 1, ptr %13, align 4
  br label %147

125:                                              ; preds = %109, %101
  %126 = load ptr, ptr %7, align 8, !tbaa !5
  %127 = icmp ne ptr %126, null
  br i1 %127, label %128, label %144

128:                                              ; preds = %125
  %129 = load ptr, ptr %7, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.X509_POLICY_LEVEL_st, ptr %129, i32 0, i32 2
  %131 = load ptr, ptr %130, align 8, !tbaa !20
  %132 = load ptr, ptr %12, align 8, !tbaa !5
  %133 = icmp eq ptr %131, %132
  br i1 %133, label %134, label %137

134:                                              ; preds = %128
  %135 = load ptr, ptr %7, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.X509_POLICY_LEVEL_st, ptr %135, i32 0, i32 2
  store ptr null, ptr %136, align 8, !tbaa !20
  br label %143

137:                                              ; preds = %128
  %138 = load ptr, ptr %7, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct.X509_POLICY_LEVEL_st, ptr %138, i32 0, i32 1
  %140 = load ptr, ptr %139, align 8, !tbaa !22
  %141 = call ptr @ossl_check_X509_POLICY_NODE_sk_type(ptr noundef %140)
  %142 = call ptr @OPENSSL_sk_pop(ptr noundef %141)
  br label %143

143:                                              ; preds = %137, %134
  br label %144

144:                                              ; preds = %143, %125
  br label %145

145:                                              ; preds = %144, %81, %71, %52
  %146 = load ptr, ptr %12, align 8, !tbaa !5
  call void @ossl_policy_node_free(ptr noundef %146)
  store ptr null, ptr %6, align 8
  store i32 1, ptr %13, align 4
  br label %147

147:                                              ; preds = %145, %123, %31, %26
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  %148 = load ptr, ptr %6, align 8
  ret ptr %148
}

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

declare i32 @OBJ_obj2nid(ptr noundef) #3

declare void @ERR_new() #3

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

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

declare i32 @OPENSSL_sk_push(ptr noundef, ptr noundef) #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @sk_X509_POLICY_DATA_new_null() #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @sk_X509_POLICY_DATA_push(ptr noundef, ptr noundef) #2

declare ptr @OPENSSL_sk_pop(ptr noundef) #3

; Function Attrs: nounwind uwtable
declare dso_local void @ossl_policy_node_free(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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { inlinehint 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 #3 = { "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/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !13, i64 8}
!12 = !{!"X509_POLICY_TREE_st", !13, i64 0, !13, i64 8, !6, i64 16, !10, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !10, i64 56}
!13 = !{!"long", !7, i64 0}
!14 = !{!12, !13, i64 0}
!15 = !{!16, !6, i64 0}
!16 = !{!"X509_POLICY_NODE_st", !6, i64 0, !6, i64 8, !10, i64 16}
!17 = !{!16, !6, i64 8}
!18 = !{!19, !6, i64 8}
!19 = !{!"X509_POLICY_DATA_st", !10, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!20 = !{!21, !6, i64 16}
!21 = !{!"X509_POLICY_LEVEL_st", !6, i64 0, !6, i64 8, !6, i64 16, !10, i64 24}
!22 = !{!21, !6, i64 8}
!23 = !{!12, !6, i64 32}
!24 = !{!16, !10, i64 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"

@.str = external hidden unnamed_addr constant [72 x i8], align 1
@__func__.ossl_policy_level_add_node = external hidden unnamed_addr constant [27 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local ptr @ossl_policy_node_cmp_new() local_unnamed_addr #0

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @ossl_check_X509_POLICY_NODE_sk_type(ptr noundef) local_unnamed_addr #1

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @ossl_check_X509_POLICY_NODE_type(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local ptr @ossl_policy_level_add_node(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr nocapture noundef %3, i32 noundef %4) local_unnamed_addr #0 {
  %6 = getelementptr inbounds i8, ptr %3, i64 8
  %7 = load i64, ptr %6, align 8, !tbaa !5
  %.not = icmp eq i64 %7, 0
  br i1 %.not, label %10, label %8

8:                                                ; preds = %5
  %9 = load i64, ptr %3, align 8, !tbaa !12
  %.not40 = icmp ult i64 %9, %7
  br i1 %.not40, label %10, label %66

10:                                               ; preds = %8, %5
  %11 = tail call ptr @CRYPTO_zalloc(i64 noundef 24, ptr noundef nonnull @.str, i32 noundef 71) #3
  %12 = icmp eq ptr %11, null
  br i1 %12, label %66, label %13

13:                                               ; preds = %10
  store ptr %1, ptr %11, align 8, !tbaa !13
  %14 = getelementptr inbounds i8, ptr %11, i64 8
  store ptr %2, ptr %14, align 8, !tbaa !15
  %.not41 = icmp eq ptr %0, null
  br i1 %.not41, label %37, label %15

15:                                               ; preds = %13
  %16 = getelementptr inbounds i8, ptr %1, i64 8
  %17 = load ptr, ptr %16, align 8, !tbaa !16
  %18 = tail call i32 @OBJ_obj2nid(ptr noundef %17) #3
  %19 = icmp eq i32 %18, 746
  br i1 %19, label %20, label %24

20:                                               ; preds = %15
  %21 = getelementptr inbounds i8, ptr %0, i64 16
  %22 = load ptr, ptr %21, align 8, !tbaa !18
  %.not43 = icmp eq ptr %22, null
  br i1 %.not43, label %23, label %65

23:                                               ; preds = %20
  store ptr %11, ptr %21, align 8, !tbaa !18
  br label %37

24:                                               ; preds = %15
  %25 = getelementptr inbounds i8, ptr %0, i64 8
  %26 = load ptr, ptr %25, align 8, !tbaa !20
  %27 = icmp eq ptr %26, null
  br i1 %27, label %28, label %.thread

28:                                               ; preds = %24
  %29 = tail call ptr @ossl_policy_node_cmp_new()
  store ptr %29, ptr %25, align 8, !tbaa !20
  %30 = icmp eq ptr %29, null
  br i1 %30, label %31, label %.thread

31:                                               ; preds = %28
  tail call void @ERR_new() #3
  tail call void @ERR_set_debug(ptr noundef nonnull @.str, i32 noundef 86, ptr noundef nonnull @__func__.ossl_policy_level_add_node) #3
  tail call void (i32, i32, ptr, ...) @ERR_set_error(i32 noundef 34, i32 noundef 524299, ptr noundef null) #3
  br label %65

.thread:                                          ; preds = %24, %28
  %32 = phi ptr [ %29, %28 ], [ %26, %24 ]
  %33 = tail call ptr @ossl_check_X509_POLICY_NODE_sk_type(ptr noundef nonnull %32)
  %34 = tail call ptr @ossl_check_X509_POLICY_NODE_type(ptr noundef nonnull %11)
  %35 = tail call i32 @OPENSSL_sk_push(ptr noundef %33, ptr noundef %34) #3
  %.not42 = icmp eq i32 %35, 0
  br i1 %.not42, label %36, label %37

36:                                               ; preds = %.thread
  tail call void @ERR_new() #3
  tail call void @ERR_set_debug(ptr noundef nonnull @.str, i32 noundef 90, ptr noundef nonnull @__func__.ossl_policy_level_add_node) #3
  tail call void (i32, i32, ptr, ...) @ERR_set_error(i32 noundef 34, i32 noundef 524303, ptr noundef null) #3
  br label %65

37:                                               ; preds = %23, %.thread, %13
  %.not44 = icmp eq i32 %4, 0
  br i1 %.not44, label %47, label %38

38:                                               ; preds = %37
  %39 = getelementptr inbounds i8, ptr %3, i64 32
  %40 = load ptr, ptr %39, align 8, !tbaa !21
  %41 = icmp eq ptr %40, null
  br i1 %41, label %42, label %.thread47

42:                                               ; preds = %38
  %43 = tail call ptr @sk_X509_POLICY_DATA_new_null()
  store ptr %43, ptr %39, align 8, !tbaa !21
  %44 = icmp eq ptr %43, null
  br i1 %44, label %54, label %.thread47

.thread47:                                        ; preds = %38, %42
  %45 = phi ptr [ %43, %42 ], [ %40, %38 ]
  %46 = tail call i32 @sk_X509_POLICY_DATA_push(ptr noundef nonnull %45, ptr noundef %1)
  %.not45 = icmp eq i32 %46, 0
  br i1 %.not45, label %54, label %47

47:                                               ; preds = %.thread47, %37
  %48 = load i64, ptr %3, align 8, !tbaa !12
  %49 = add i64 %48, 1
  store i64 %49, ptr %3, align 8, !tbaa !12
  %.not46 = icmp eq ptr %2, null
  br i1 %.not46, label %66, label %50

50:                                               ; preds = %47
  %51 = getelementptr inbounds i8, ptr %2, i64 16
  %52 = load i32, ptr %51, align 8, !tbaa !22
  %53 = add nsw i32 %52, 1
  store i32 %53, ptr %51, align 8, !tbaa !22
  br label %66

54:                                               ; preds = %.thread47, %42
  %.sink = phi i32 [ 100, %42 ], [ 104, %.thread47 ]
  tail call void @ERR_new() #3
  tail call void @ERR_set_debug(ptr noundef nonnull @.str, i32 noundef %.sink, ptr noundef nonnull @__func__.ossl_policy_level_add_node) #3
  tail call void (i32, i32, ptr, ...) @ERR_set_error(i32 noundef 34, i32 noundef 524303, ptr noundef null) #3
  br i1 %.not41, label %65, label %55

55:                                               ; preds = %54
  %56 = getelementptr inbounds i8, ptr %0, i64 16
  %57 = load ptr, ptr %56, align 8, !tbaa !18
  %58 = icmp eq ptr %57, %11
  br i1 %58, label %59, label %60

59:                                               ; preds = %55
  store ptr null, ptr %56, align 8, !tbaa !18
  br label %65

60:                                               ; preds = %55
  %61 = getelementptr inbounds i8, ptr %0, i64 8
  %62 = load ptr, ptr %61, align 8, !tbaa !20
  %63 = tail call ptr @ossl_check_X509_POLICY_NODE_sk_type(ptr noundef %62)
  %64 = tail call ptr @OPENSSL_sk_pop(ptr noundef %63) #3
  br label %65

65:                                               ; preds = %54, %60, %59, %20, %36, %31
  tail call void @ossl_policy_node_free(ptr noundef nonnull %11)
  br label %66

66:                                               ; preds = %47, %50, %10, %8, %65
  %.0 = phi ptr [ null, %65 ], [ null, %8 ], [ null, %10 ], [ %11, %50 ], [ %11, %47 ]
  ret ptr %.0
}

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

declare i32 @OBJ_obj2nid(ptr noundef) local_unnamed_addr #2

declare void @ERR_new() local_unnamed_addr #2

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

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

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @sk_X509_POLICY_DATA_new_null() local_unnamed_addr #1

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @sk_X509_POLICY_DATA_push(ptr noundef, ptr noundef) local_unnamed_addr #1

declare ptr @OPENSSL_sk_pop(ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local void @ossl_policy_node_free(ptr noundef) local_unnamed_addr #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 = { inlinehint 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 = { 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, !7, i64 8}
!6 = !{!"X509_POLICY_TREE_st", !7, i64 0, !7, i64 8, !10, i64 16, !11, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !11, i64 56}
!7 = !{!"long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"int", !8, i64 0}
!12 = !{!6, !7, i64 0}
!13 = !{!14, !10, i64 0}
!14 = !{!"X509_POLICY_NODE_st", !10, i64 0, !10, i64 8, !11, i64 16}
!15 = !{!14, !10, i64 8}
!16 = !{!17, !10, i64 8}
!17 = !{!"X509_POLICY_DATA_st", !11, i64 0, !10, i64 8, !10, i64 16, !10, i64 24}
!18 = !{!19, !10, i64 16}
!19 = !{!"X509_POLICY_LEVEL_st", !10, i64 0, !10, i64 8, !10, i64 16, !11, i64 24}
!20 = !{!19, !10, i64 8}
!21 = !{!6, !10, i64 32}
!22 = !{!14, !11, i64 16}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass