; LLVM IR from machinefi/psa-crypto-esp32 :: psa_layer (psa_crypto)

; 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.psa_key_slot_t = type { %struct.psa_core_key_attributes_t, i64, %struct.key_data }
%struct.psa_core_key_attributes_t = type { i16, i16, i32, i32, %struct.psa_key_policy_s, i16 }
%struct.psa_key_policy_s = type { i32, i32, i32 }
%struct.key_data = type { ptr, i64 }
%struct.psa_key_attributes_s = type { %struct.psa_core_key_attributes_t, ptr, i64 }

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

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @psa_allocate_buffer_to_slot(ptr noundef, i64 noundef) #1

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

20:                                               ; preds = %4
  store i32 -135, ptr %5, align 4
  store i32 1, ptr %15, align 4
  br label %132

21:                                               ; preds = %4
  %22 = load i64, ptr %8, align 8, !tbaa !9
  %23 = icmp ugt i64 %22, 2305843009213693951
  br i1 %23, label %24, label %25

24:                                               ; preds = %21
  store i32 -134, ptr %5, align 4
  store i32 1, ptr %15, align 4
  br label %132

25:                                               ; preds = %21
  %26 = load ptr, ptr %6, align 8, !tbaa !5
  %27 = call i32 @psa_start_key_creation(i32 noundef 0, ptr noundef %26, ptr noundef %11, ptr noundef %12)
  store i32 %27, ptr %10, align 4, !tbaa !11
  %28 = load i32, ptr %10, align 4, !tbaa !11
  %29 = icmp ne i32 %28, 0
  br i1 %29, label %30, label %31

30:                                               ; preds = %25
  br label %124

31:                                               ; preds = %25
  %32 = load ptr, ptr %11, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.psa_key_slot_t, ptr %32, i32 0, i32 2
  %34 = getelementptr inbounds %struct.key_data, ptr %33, i32 0, i32 0
  %35 = load ptr, ptr %34, align 8, !tbaa !13
  %36 = icmp eq ptr %35, null
  br i1 %36, label %37, label %61

37:                                               ; preds = %31
  %38 = load ptr, ptr %6, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.psa_key_attributes_s, ptr %38, i32 0, i32 0
  %40 = getelementptr inbounds %struct.psa_core_key_attributes_t, ptr %39, i32 0, i32 2
  %41 = load i32, ptr %40, align 4, !tbaa !19
  %42 = call i32 @psa_key_lifetime_is_external(i32 noundef %41)
  %43 = icmp ne i32 %42, 0
  br i1 %43, label %44, label %53

44:                                               ; preds = %37
  %45 = load ptr, ptr %6, align 8, !tbaa !5
  %46 = load ptr, ptr %7, align 8, !tbaa !5
  %47 = load i64, ptr %8, align 8, !tbaa !9
  %48 = call i32 @psa_driver_wrapper_get_key_buffer_size_from_key_data(ptr noundef %45, ptr noundef %46, i64 noundef %47, ptr noundef %14)
  store i32 %48, ptr %10, align 4, !tbaa !11
  %49 = load i32, ptr %10, align 4, !tbaa !11
  %50 = icmp ne i32 %49, 0
  br i1 %50, label %51, label %52

51:                                               ; preds = %44
  br label %124

52:                                               ; preds = %44
  br label %53

53:                                               ; preds = %52, %37
  %54 = load ptr, ptr %11, align 8, !tbaa !5
  %55 = load i64, ptr %14, align 8, !tbaa !9
  %56 = call i32 @psa_allocate_buffer_to_slot(ptr noundef %54, i64 noundef %55)
  store i32 %56, ptr %10, align 4, !tbaa !11
  %57 = load i32, ptr %10, align 4, !tbaa !11
  %58 = icmp ne i32 %57, 0
  br i1 %58, label %59, label %60

59:                                               ; preds = %53
  br label %124

60:                                               ; preds = %53
  br label %61

61:                                               ; preds = %60, %31
  %62 = load ptr, ptr %11, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.psa_key_slot_t, ptr %62, i32 0, i32 0
  %64 = getelementptr inbounds %struct.psa_core_key_attributes_t, ptr %63, i32 0, i32 1
  %65 = load i16, ptr %64, align 2, !tbaa !21
  %66 = zext i16 %65 to i64
  store i64 %66, ptr %13, align 8, !tbaa !9
  %67 = load ptr, ptr %6, align 8, !tbaa !5
  %68 = load ptr, ptr %7, align 8, !tbaa !5
  %69 = load i64, ptr %8, align 8, !tbaa !9
  %70 = load ptr, ptr %11, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.psa_key_slot_t, ptr %70, i32 0, i32 2
  %72 = getelementptr inbounds %struct.key_data, ptr %71, i32 0, i32 0
  %73 = load ptr, ptr %72, align 8, !tbaa !13
  %74 = load ptr, ptr %11, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.psa_key_slot_t, ptr %74, i32 0, i32 2
  %76 = getelementptr inbounds %struct.key_data, ptr %75, i32 0, i32 1
  %77 = load i64, ptr %76, align 8, !tbaa !22
  %78 = load ptr, ptr %11, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.psa_key_slot_t, ptr %78, i32 0, i32 2
  %80 = getelementptr inbounds %struct.key_data, ptr %79, i32 0, i32 1
  %81 = call i32 @psa_driver_wrapper_import_key(ptr noundef %67, ptr noundef %68, i64 noundef %69, ptr noundef %73, i64 noundef %77, ptr noundef %80, ptr noundef %13)
  store i32 %81, ptr %10, align 4, !tbaa !11
  %82 = load i32, ptr %10, align 4, !tbaa !11
  %83 = icmp ne i32 %82, 0
  br i1 %83, label %84, label %85

84:                                               ; preds = %61
  br label %124

85:                                               ; preds = %61
  %86 = load ptr, ptr %11, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.psa_key_slot_t, ptr %86, i32 0, i32 0
  %88 = getelementptr inbounds %struct.psa_core_key_attributes_t, ptr %87, i32 0, i32 1
  %89 = load i16, ptr %88, align 2, !tbaa !21
  %90 = zext i16 %89 to i32
  %91 = icmp eq i32 %90, 0
  br i1 %91, label %92, label %98

92:                                               ; preds = %85
  %93 = load i64, ptr %13, align 8, !tbaa !9
  %94 = trunc i64 %93 to i16
  %95 = load ptr, ptr %11, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.psa_key_slot_t, ptr %95, i32 0, i32 0
  %97 = getelementptr inbounds %struct.psa_core_key_attributes_t, ptr %96, i32 0, i32 1
  store i16 %94, ptr %97, align 2, !tbaa !21
  br label %108

98:                                               ; preds = %85
  %99 = load i64, ptr %13, align 8, !tbaa !9
  %100 = load ptr, ptr %11, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.psa_key_slot_t, ptr %100, i32 0, i32 0
  %102 = getelementptr inbounds %struct.psa_core_key_attributes_t, ptr %101, i32 0, i32 1
  %103 = load i16, ptr %102, align 2, !tbaa !21
  %104 = zext i16 %103 to i64
  %105 = icmp ne i64 %99, %104
  br i1 %105, label %106, label %107

106:                                              ; preds = %98
  store i32 -135, ptr %10, align 4, !tbaa !11
  br label %124

107:                                              ; preds = %98
  br label %108

108:                                              ; preds = %107, %92
  %109 = load i64, ptr %13, align 8, !tbaa !9
  %110 = icmp ugt i64 %109, 65528
  br i1 %110, label %111, label %112

111:                                              ; preds = %108
  store i32 -134, ptr %10, align 4, !tbaa !11
  br label %124

112:                                              ; preds = %108
  %113 = load ptr, ptr %11, align 8, !tbaa !5
  %114 = load ptr, ptr %6, align 8, !tbaa !5
  %115 = call i32 @psa_validate_optional_attributes(ptr noundef %113, ptr noundef %114)
  store i32 %115, ptr %10, align 4, !tbaa !11
  %116 = load i32, ptr %10, align 4, !tbaa !11
  %117 = icmp ne i32 %116, 0
  br i1 %117, label %118, label %119

118:                                              ; preds = %112
  br label %124

119:                                              ; preds = %112
  %120 = load ptr, ptr %11, align 8, !tbaa !5
  %121 = load ptr, ptr %12, align 8, !tbaa !5
  %122 = load ptr, ptr %9, align 8, !tbaa !5
  %123 = call i32 @psa_finish_key_creation(ptr noundef %120, ptr noundef %121, ptr noundef %122)
  store i32 %123, ptr %10, align 4, !tbaa !11
  br label %124

124:                                              ; preds = %119, %118, %111, %106, %84, %59, %51, %30
  %125 = load i32, ptr %10, align 4, !tbaa !11
  %126 = icmp ne i32 %125, 0
  br i1 %126, label %127, label %130

127:                                              ; preds = %124
  %128 = load ptr, ptr %11, align 8, !tbaa !5
  %129 = load ptr, ptr %12, align 8, !tbaa !5
  call void @psa_fail_key_creation(ptr noundef %128, ptr noundef %129)
  br label %130

130:                                              ; preds = %127, %124
  %131 = load i32, ptr %10, align 4, !tbaa !11
  store i32 %131, ptr %5, align 4
  store i32 1, ptr %15, align 4
  br label %132

132:                                              ; preds = %130, %24, %20
  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 8, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  %133 = load i32, ptr %5, align 4
  ret i32 %133
}

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

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

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

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

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

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

; Function Attrs: nounwind uwtable
declare hidden void @psa_fail_key_creation(ptr noundef, ptr noundef) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 = { 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 = !{!"long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !6, i64 40}
!14 = !{!"", !15, i64 0, !10, i64 32, !18, i64 40}
!15 = !{!"", !16, i64 0, !16, i64 2, !12, i64 4, !12, i64 8, !17, i64 12, !16, i64 24}
!16 = !{!"short", !7, i64 0}
!17 = !{!"psa_key_policy_s", !12, i64 0, !12, i64 4, !12, i64 8}
!18 = !{!"key_data", !6, i64 0, !10, i64 8}
!19 = !{!20, !12, i64 4}
!20 = !{!"psa_key_attributes_s", !15, i64 0, !6, i64 32, !10, i64 40}
!21 = !{!14, !16, i64 2}
!22 = !{!14, !10, i64 48}


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

; 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @psa_allocate_buffer_to_slot(ptr noundef, i64 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local i32 @psa_import_key(ptr noundef %0, ptr noundef %1, i64 noundef %2, ptr noundef %3) local_unnamed_addr #1 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #4
  store ptr null, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #4
  store ptr null, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #4
  store i64 %2, ptr %8, align 8, !tbaa !9
  store i32 0, ptr %3, align 4, !tbaa !11
  %9 = icmp eq i64 %2, 0
  br i1 %9, label %58, label %10

10:                                               ; preds = %4
  %11 = icmp ugt i64 %2, 2305843009213693951
  br i1 %11, label %58, label %12

12:                                               ; preds = %10
  %13 = call i32 @psa_start_key_creation(i32 noundef 0, ptr noundef %0, ptr noundef nonnull %5, ptr noundef nonnull %6)
  %.not = icmp eq i32 %13, 0
  br i1 %.not, label %14, label %.thread

14:                                               ; preds = %12
  %15 = load ptr, ptr %5, align 8, !tbaa !5
  %16 = getelementptr inbounds i8, ptr %15, i64 40
  %17 = load ptr, ptr %16, align 8, !tbaa !13
  %18 = icmp eq ptr %17, null
  br i1 %18, label %19, label %29

19:                                               ; preds = %14
  %20 = getelementptr inbounds i8, ptr %0, i64 4
  %21 = load i32, ptr %20, align 4, !tbaa !19
  %22 = call i32 @psa_key_lifetime_is_external(i32 noundef %21)
  %.not28 = icmp eq i32 %22, 0
  br i1 %.not28, label %25, label %23

23:                                               ; preds = %19
  %24 = call i32 @psa_driver_wrapper_get_key_buffer_size_from_key_data(ptr noundef nonnull %0, ptr noundef %1, i64 noundef %2, ptr noundef nonnull %8) #4
  %.not29 = icmp eq i32 %24, 0
  br i1 %.not29, label %._crit_edge, label %.thread

._crit_edge:                                      ; preds = %23
  %.pre = load i64, ptr %8, align 8, !tbaa !9
  br label %25

25:                                               ; preds = %._crit_edge, %19
  %26 = phi i64 [ %.pre, %._crit_edge ], [ %2, %19 ]
  %27 = load ptr, ptr %5, align 8, !tbaa !5
  %28 = call i32 @psa_allocate_buffer_to_slot(ptr noundef %27, i64 noundef %26)
  %.not30 = icmp eq i32 %28, 0
  br i1 %.not30, label %._crit_edge38, label %.thread

._crit_edge38:                                    ; preds = %25
  %.pre39 = load ptr, ptr %5, align 8, !tbaa !5
  %.phi.trans.insert = getelementptr inbounds i8, ptr %.pre39, i64 40
  %.pre40 = load ptr, ptr %.phi.trans.insert, align 8, !tbaa !13
  br label %29

29:                                               ; preds = %._crit_edge38, %14
  %30 = phi ptr [ %.pre40, %._crit_edge38 ], [ %17, %14 ]
  %31 = phi ptr [ %.pre39, %._crit_edge38 ], [ %15, %14 ]
  %32 = getelementptr inbounds i8, ptr %31, i64 2
  %33 = load i16, ptr %32, align 2, !tbaa !21
  %34 = zext i16 %33 to i64
  store i64 %34, ptr %7, align 8, !tbaa !9
  %35 = getelementptr inbounds i8, ptr %31, i64 48
  %36 = load i64, ptr %35, align 8, !tbaa !22
  %37 = call i32 @psa_driver_wrapper_import_key(ptr noundef %0, ptr noundef %1, i64 noundef %2, ptr noundef %30, i64 noundef %36, ptr noundef nonnull %35, ptr noundef nonnull %7) #4
  %.not31 = icmp eq i32 %37, 0
  br i1 %.not31, label %38, label %.thread

38:                                               ; preds = %29
  %39 = load ptr, ptr %5, align 8, !tbaa !5
  %40 = getelementptr inbounds i8, ptr %39, i64 2
  %41 = load i16, ptr %40, align 2, !tbaa !21
  %42 = icmp eq i16 %41, 0
  %43 = load i64, ptr %7, align 8, !tbaa !9
  br i1 %42, label %44, label %46

44:                                               ; preds = %38
  %45 = trunc i64 %43 to i16
  store i16 %45, ptr %40, align 2, !tbaa !21
  br label %48

46:                                               ; preds = %38
  %47 = zext i16 %41 to i64
  %.not32 = icmp eq i64 %43, %47
  br i1 %.not32, label %48, label %.thread

48:                                               ; preds = %46, %44
  %49 = icmp ugt i64 %43, 65528
  br i1 %49, label %.thread, label %50

50:                                               ; preds = %48
  %51 = call i32 @psa_validate_optional_attributes(ptr noundef nonnull %39, ptr noundef %0)
  %.not33 = icmp eq i32 %51, 0
  br i1 %.not33, label %52, label %.thread

52:                                               ; preds = %50
  %53 = load ptr, ptr %5, align 8, !tbaa !5
  %54 = load ptr, ptr %6, align 8, !tbaa !5
  %55 = call i32 @psa_finish_key_creation(ptr noundef %53, ptr noundef %54, ptr noundef nonnull %3)
  %.not34 = icmp eq i32 %55, 0
  br i1 %.not34, label %58, label %.thread

.thread:                                          ; preds = %48, %46, %50, %29, %25, %23, %12, %52
  %.037 = phi i32 [ %55, %52 ], [ -134, %48 ], [ -135, %46 ], [ %51, %50 ], [ %37, %29 ], [ %28, %25 ], [ %24, %23 ], [ %13, %12 ]
  %56 = load ptr, ptr %5, align 8, !tbaa !5
  %57 = load ptr, ptr %6, align 8, !tbaa !5
  call void @psa_fail_key_creation(ptr noundef %56, ptr noundef %57)
  br label %58

58:                                               ; preds = %52, %.thread, %10, %4
  %.021 = phi i32 [ -135, %4 ], [ -134, %10 ], [ %.037, %.thread ], [ 0, %52 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #4
  ret i32 %.021
}

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @psa_key_lifetime_is_external(i32 noundef) local_unnamed_addr #2

declare i32 @psa_driver_wrapper_get_key_buffer_size_from_key_data(ptr noundef, ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #3

declare i32 @psa_driver_wrapper_import_key(ptr noundef, ptr noundef, i64 noundef, ptr noundef, i64 noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

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

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

; Function Attrs: nounwind uwtable
declare hidden void @psa_fail_key_creation(ptr noundef, ptr noundef) local_unnamed_addr #1

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 = { 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 = !{!"long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !6, i64 40}
!14 = !{!"", !15, i64 0, !10, i64 32, !18, i64 40}
!15 = !{!"", !16, i64 0, !16, i64 2, !12, i64 4, !12, i64 8, !17, i64 12, !16, i64 24}
!16 = !{!"short", !7, i64 0}
!17 = !{!"psa_key_policy_s", !12, i64 0, !12, i64 4, !12, i64 8}
!18 = !{!"key_data", !6, i64 0, !10, i64 8}
!19 = !{!20, !12, i64 4}
!20 = !{!"psa_key_attributes_s", !15, i64 0, !6, i64 32, !10, i64 40}
!21 = !{!14, !16, i64 2}
!22 = !{!14, !10, i64 48}


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