; LLVM IR from ARMmbed/mbed-crypto :: library (pkparse)

; 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.mbedtls_pem_context = type { ptr, i64, ptr }

@.str.10 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [25 x i8], align 1

; 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
define dso_local i32 @mbedtls_pk_parse_public_key(ptr noundef %0, ptr noundef %1, i64 noundef %2) #1 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i64, align 8
  %12 = alloca %struct.mbedtls_pem_context, align 8
  %13 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store i64 %2, ptr %7, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  store i32 -110, ptr %8, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.start.p0(i64 24, ptr %12) #4
  br label %14

14:                                               ; preds = %3
  br label %15

15:                                               ; preds = %14
  br label %16

16:                                               ; preds = %15
  %17 = load i64, ptr %7, align 8, !tbaa !9
  %18 = icmp eq i64 %17, 0
  br i1 %18, label %19, label %20

19:                                               ; preds = %16
  store i32 -15616, ptr %4, align 4
  store i32 1, ptr %13, align 4
  br label %146

20:                                               ; preds = %16
  br label %21

21:                                               ; preds = %20
  br label %22

22:                                               ; preds = %21
  br label %23

23:                                               ; preds = %22
  call void @mbedtls_pem_init(ptr noundef %12)
  %24 = load ptr, ptr %6, align 8, !tbaa !5
  %25 = load i64, ptr %7, align 8, !tbaa !9
  %26 = sub i64 %25, 1
  %27 = getelementptr inbounds i8, ptr %24, i64 %26
  %28 = load i8, ptr %27, align 1, !tbaa !13
  %29 = zext i8 %28 to i32
  %30 = icmp ne i32 %29, 0
  br i1 %30, label %31, label %32

31:                                               ; preds = %23
  store i32 -4224, ptr %8, align 4, !tbaa !11
  br label %35

32:                                               ; preds = %23
  %33 = load ptr, ptr %6, align 8, !tbaa !5
  %34 = call i32 @mbedtls_pem_read_buffer(ptr noundef %12, ptr noundef @.str.10, ptr noundef @.str.11, ptr noundef %33, ptr noundef null, i64 noundef 0, ptr noundef %11)
  store i32 %34, ptr %8, align 4, !tbaa !11
  br label %35

35:                                               ; preds = %32, %31
  %36 = load i32, ptr %8, align 4, !tbaa !11
  %37 = icmp eq i32 %36, 0
  br i1 %37, label %38, label %68

38:                                               ; preds = %35
  %39 = getelementptr inbounds %struct.mbedtls_pem_context, ptr %12, i32 0, i32 0
  %40 = load ptr, ptr %39, align 8, !tbaa !14
  store ptr %40, ptr %9, align 8, !tbaa !5
  %41 = call ptr @mbedtls_pk_info_from_type(i32 noundef 1)
  store ptr %41, ptr %10, align 8, !tbaa !5
  %42 = icmp eq ptr %41, null
  br i1 %42, label %43, label %44

43:                                               ; preds = %38
  store i32 -15488, ptr %4, align 4
  store i32 1, ptr %13, align 4
  br label %146

44:                                               ; preds = %38
  %45 = load ptr, ptr %5, align 8, !tbaa !5
  %46 = load ptr, ptr %10, align 8, !tbaa !5
  %47 = call i32 @mbedtls_pk_setup(ptr noundef %45, ptr noundef %46)
  store i32 %47, ptr %8, align 4, !tbaa !11
  %48 = icmp ne i32 %47, 0
  br i1 %48, label %49, label %51

49:                                               ; preds = %44
  %50 = load i32, ptr %8, align 4, !tbaa !11
  store i32 %50, ptr %4, align 4
  store i32 1, ptr %13, align 4
  br label %146

51:                                               ; preds = %44
  %52 = load ptr, ptr %9, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.mbedtls_pem_context, ptr %12, i32 0, i32 1
  %54 = load i64, ptr %53, align 8, !tbaa !16
  %55 = getelementptr inbounds i8, ptr %52, i64 %54
  %56 = load ptr, ptr %5, align 8, !tbaa !5
  %57 = getelementptr inbounds { ptr, ptr }, ptr %56, i32 0, i32 0
  %58 = load ptr, ptr %57, align 8
  %59 = getelementptr inbounds { ptr, ptr }, ptr %56, i32 0, i32 1
  %60 = load ptr, ptr %59, align 8
  %61 = call ptr @mbedtls_pk_rsa(ptr %58, ptr %60)
  %62 = call i32 @pk_get_rsapubkey(ptr noundef %9, ptr noundef %55, ptr noundef %61)
  store i32 %62, ptr %8, align 4, !tbaa !11
  %63 = icmp ne i32 %62, 0
  br i1 %63, label %64, label %66

64:                                               ; preds = %51
  %65 = load ptr, ptr %5, align 8, !tbaa !5
  call void @mbedtls_pk_free(ptr noundef %65)
  br label %66

66:                                               ; preds = %64, %51
  call void @mbedtls_pem_free(ptr noundef %12)
  %67 = load i32, ptr %8, align 4, !tbaa !11
  store i32 %67, ptr %4, align 4
  store i32 1, ptr %13, align 4
  br label %146

68:                                               ; preds = %35
  %69 = load i32, ptr %8, align 4, !tbaa !11
  %70 = icmp ne i32 %69, -4224
  br i1 %70, label %71, label %73

71:                                               ; preds = %68
  call void @mbedtls_pem_free(ptr noundef %12)
  %72 = load i32, ptr %8, align 4, !tbaa !11
  store i32 %72, ptr %4, align 4
  store i32 1, ptr %13, align 4
  br label %146

73:                                               ; preds = %68
  br label %74

74:                                               ; preds = %73
  %75 = load ptr, ptr %6, align 8, !tbaa !5
  %76 = load i64, ptr %7, align 8, !tbaa !9
  %77 = sub i64 %76, 1
  %78 = getelementptr inbounds i8, ptr %75, i64 %77
  %79 = load i8, ptr %78, align 1, !tbaa !13
  %80 = zext i8 %79 to i32
  %81 = icmp ne i32 %80, 0
  br i1 %81, label %82, label %83

82:                                               ; preds = %74
  store i32 -4224, ptr %8, align 4, !tbaa !11
  br label %86

83:                                               ; preds = %74
  %84 = load ptr, ptr %6, align 8, !tbaa !5
  %85 = call i32 @mbedtls_pem_read_buffer(ptr noundef %12, ptr noundef @.str.12, ptr noundef @.str.13, ptr noundef %84, ptr noundef null, i64 noundef 0, ptr noundef %11)
  store i32 %85, ptr %8, align 4, !tbaa !11
  br label %86

86:                                               ; preds = %83, %82
  %87 = load i32, ptr %8, align 4, !tbaa !11
  %88 = icmp eq i32 %87, 0
  br i1 %88, label %89, label %99

89:                                               ; preds = %86
  %90 = getelementptr inbounds %struct.mbedtls_pem_context, ptr %12, i32 0, i32 0
  %91 = load ptr, ptr %90, align 8, !tbaa !14
  store ptr %91, ptr %9, align 8, !tbaa !5
  %92 = load ptr, ptr %9, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.mbedtls_pem_context, ptr %12, i32 0, i32 1
  %94 = load i64, ptr %93, align 8, !tbaa !16
  %95 = getelementptr inbounds i8, ptr %92, i64 %94
  %96 = load ptr, ptr %5, align 8, !tbaa !5
  %97 = call i32 @mbedtls_pk_parse_subpubkey(ptr noundef %9, ptr noundef %95, ptr noundef %96)
  store i32 %97, ptr %8, align 4, !tbaa !11
  call void @mbedtls_pem_free(ptr noundef %12)
  %98 = load i32, ptr %8, align 4, !tbaa !11
  store i32 %98, ptr %4, align 4
  store i32 1, ptr %13, align 4
  br label %146

99:                                               ; preds = %86
  %100 = load i32, ptr %8, align 4, !tbaa !11
  %101 = icmp ne i32 %100, -4224
  br i1 %101, label %102, label %104

102:                                              ; preds = %99
  call void @mbedtls_pem_free(ptr noundef %12)
  %103 = load i32, ptr %8, align 4, !tbaa !11
  store i32 %103, ptr %4, align 4
  store i32 1, ptr %13, align 4
  br label %146

104:                                              ; preds = %99
  br label %105

105:                                              ; preds = %104
  call void @mbedtls_pem_free(ptr noundef %12)
  %106 = call ptr @mbedtls_pk_info_from_type(i32 noundef 1)
  store ptr %106, ptr %10, align 8, !tbaa !5
  %107 = icmp eq ptr %106, null
  br i1 %107, label %108, label %109

108:                                              ; preds = %105
  store i32 -15488, ptr %4, align 4
  store i32 1, ptr %13, align 4
  br label %146

109:                                              ; preds = %105
  %110 = load ptr, ptr %5, align 8, !tbaa !5
  %111 = load ptr, ptr %10, align 8, !tbaa !5
  %112 = call i32 @mbedtls_pk_setup(ptr noundef %110, ptr noundef %111)
  store i32 %112, ptr %8, align 4, !tbaa !11
  %113 = icmp ne i32 %112, 0
  br i1 %113, label %114, label %116

114:                                              ; preds = %109
  %115 = load i32, ptr %8, align 4, !tbaa !11
  store i32 %115, ptr %4, align 4
  store i32 1, ptr %13, align 4
  br label %146

116:                                              ; preds = %109
  %117 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %117, ptr %9, align 8, !tbaa !5
  %118 = load ptr, ptr %9, align 8, !tbaa !5
  %119 = load i64, ptr %7, align 8, !tbaa !9
  %120 = getelementptr inbounds i8, ptr %118, i64 %119
  %121 = load ptr, ptr %5, align 8, !tbaa !5
  %122 = getelementptr inbounds { ptr, ptr }, ptr %121, i32 0, i32 0
  %123 = load ptr, ptr %122, align 8
  %124 = getelementptr inbounds { ptr, ptr }, ptr %121, i32 0, i32 1
  %125 = load ptr, ptr %124, align 8
  %126 = call ptr @mbedtls_pk_rsa(ptr %123, ptr %125)
  %127 = call i32 @pk_get_rsapubkey(ptr noundef %9, ptr noundef %120, ptr noundef %126)
  store i32 %127, ptr %8, align 4, !tbaa !11
  %128 = load i32, ptr %8, align 4, !tbaa !11
  %129 = icmp eq i32 %128, 0
  br i1 %129, label %130, label %132

130:                                              ; preds = %116
  %131 = load i32, ptr %8, align 4, !tbaa !11
  store i32 %131, ptr %4, align 4
  store i32 1, ptr %13, align 4
  br label %146

132:                                              ; preds = %116
  %133 = load ptr, ptr %5, align 8, !tbaa !5
  call void @mbedtls_pk_free(ptr noundef %133)
  %134 = load i32, ptr %8, align 4, !tbaa !11
  %135 = icmp ne i32 %134, -15202
  br i1 %135, label %136, label %138

136:                                              ; preds = %132
  %137 = load i32, ptr %8, align 4, !tbaa !11
  store i32 %137, ptr %4, align 4
  store i32 1, ptr %13, align 4
  br label %146

138:                                              ; preds = %132
  %139 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %139, ptr %9, align 8, !tbaa !5
  %140 = load ptr, ptr %9, align 8, !tbaa !5
  %141 = load i64, ptr %7, align 8, !tbaa !9
  %142 = getelementptr inbounds i8, ptr %140, i64 %141
  %143 = load ptr, ptr %5, align 8, !tbaa !5
  %144 = call i32 @mbedtls_pk_parse_subpubkey(ptr noundef %9, ptr noundef %142, ptr noundef %143)
  store i32 %144, ptr %8, align 4, !tbaa !11
  %145 = load i32, ptr %8, align 4, !tbaa !11
  store i32 %145, ptr %4, align 4
  store i32 1, ptr %13, align 4
  br label %146

146:                                              ; preds = %138, %136, %130, %114, %108, %102, %89, %71, %66, %49, %43, %19
  call void @llvm.lifetime.end.p0(i64 24, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  %147 = load i32, ptr %4, align 4
  ret i32 %147
}

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

declare ptr @mbedtls_pk_info_from_type(i32 noundef) #2

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

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @mbedtls_pk_rsa(ptr, ptr) #3

declare void @mbedtls_pk_free(ptr noundef) #2

declare void @mbedtls_pem_init(ptr noundef) #2

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

declare void @mbedtls_pem_free(ptr noundef) #2

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 = { "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 = { 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 #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 = !{!7, !7, i64 0}
!14 = !{!15, !6, i64 0}
!15 = !{!"mbedtls_pem_context", !6, i64 0, !10, i64 8, !6, i64 16}
!16 = !{!15, !10, i64 8}


; 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.mbedtls_pem_context = type { ptr, i64, ptr }

@.str.10 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [25 x i8], align 1

; 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
define dso_local i32 @mbedtls_pk_parse_public_key(ptr noundef %0, ptr noundef %1, i64 noundef %2) local_unnamed_addr #1 {
  %4 = alloca ptr, align 8
  %5 = alloca i64, align 8
  %6 = alloca %struct.mbedtls_pem_context, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #4
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #4
  %7 = icmp eq i64 %2, 0
  br i1 %7, label %57, label %8

8:                                                ; preds = %3
  call void @mbedtls_pem_init(ptr noundef nonnull %6) #4
  %9 = getelementptr i8, ptr %1, i64 %2
  %10 = getelementptr i8, ptr %9, i64 -1
  %11 = load i8, ptr %10, align 1, !tbaa !5
  %.not = icmp eq i8 %11, 0
  br i1 %.not, label %12, label %.thread54

12:                                               ; preds = %8
  %13 = call i32 @mbedtls_pem_read_buffer(ptr noundef nonnull %6, ptr noundef nonnull @.str.10, ptr noundef nonnull @.str.11, ptr noundef nonnull %1, ptr noundef null, i64 noundef 0, ptr noundef nonnull %5) #4
  switch i32 %13, label %32 [
    i32 0, label %14
    i32 -4224, label %33
  ]

14:                                               ; preds = %12
  %15 = load ptr, ptr %6, align 8, !tbaa !8
  store ptr %15, ptr %4, align 8, !tbaa !12
  %16 = call ptr @mbedtls_pk_info_from_type(i32 noundef 1) #4
  %17 = icmp eq ptr %16, null
  br i1 %17, label %57, label %18

18:                                               ; preds = %14
  %19 = call i32 @mbedtls_pk_setup(ptr noundef %0, ptr noundef nonnull %16) #4
  %.not49 = icmp eq i32 %19, 0
  br i1 %.not49, label %20, label %57

20:                                               ; preds = %18
  %21 = load ptr, ptr %4, align 8, !tbaa !12
  %22 = getelementptr inbounds i8, ptr %6, i64 8
  %23 = load i64, ptr %22, align 8, !tbaa !13
  %24 = getelementptr inbounds i8, ptr %21, i64 %23
  %25 = load ptr, ptr %0, align 8
  %26 = getelementptr inbounds i8, ptr %0, i64 8
  %27 = load ptr, ptr %26, align 8
  %28 = call ptr @mbedtls_pk_rsa(ptr %25, ptr %27)
  %29 = call i32 @pk_get_rsapubkey(ptr noundef nonnull %4, ptr noundef %24, ptr noundef %28)
  %.not50 = icmp eq i32 %29, 0
  br i1 %.not50, label %31, label %30

30:                                               ; preds = %20
  call void @mbedtls_pk_free(ptr noundef nonnull %0) #4
  br label %31

31:                                               ; preds = %30, %20
  call void @mbedtls_pem_free(ptr noundef nonnull %6) #4
  br label %57

32:                                               ; preds = %12
  call void @mbedtls_pem_free(ptr noundef nonnull %6) #4
  br label %57

33:                                               ; preds = %12
  %.pr = load i8, ptr %10, align 1, !tbaa !5
  %.not45 = icmp eq i8 %.pr, 0
  br i1 %.not45, label %34, label %.thread54

34:                                               ; preds = %33
  %35 = call i32 @mbedtls_pem_read_buffer(ptr noundef nonnull %6, ptr noundef nonnull @.str.12, ptr noundef nonnull @.str.13, ptr noundef nonnull %1, ptr noundef null, i64 noundef 0, ptr noundef nonnull %5) #4
  switch i32 %35, label %42 [
    i32 0, label %36
    i32 -4224, label %.thread54
  ]

36:                                               ; preds = %34
  %37 = load ptr, ptr %6, align 8, !tbaa !8
  store ptr %37, ptr %4, align 8, !tbaa !12
  %38 = getelementptr inbounds i8, ptr %6, i64 8
  %39 = load i64, ptr %38, align 8, !tbaa !13
  %40 = getelementptr inbounds i8, ptr %37, i64 %39
  %41 = call i32 @mbedtls_pk_parse_subpubkey(ptr noundef nonnull %4, ptr noundef %40, ptr noundef %0)
  call void @mbedtls_pem_free(ptr noundef nonnull %6) #4
  br label %57

42:                                               ; preds = %34
  call void @mbedtls_pem_free(ptr noundef nonnull %6) #4
  br label %57

.thread54:                                        ; preds = %8, %33, %34
  call void @mbedtls_pem_free(ptr noundef nonnull %6) #4
  %43 = call ptr @mbedtls_pk_info_from_type(i32 noundef 1) #4
  %44 = icmp eq ptr %43, null
  br i1 %44, label %57, label %45

45:                                               ; preds = %.thread54
  %46 = call i32 @mbedtls_pk_setup(ptr noundef %0, ptr noundef nonnull %43) #4
  %.not47 = icmp eq i32 %46, 0
  br i1 %.not47, label %47, label %57

47:                                               ; preds = %45
  store ptr %1, ptr %4, align 8, !tbaa !12
  %48 = load ptr, ptr %0, align 8
  %49 = getelementptr inbounds i8, ptr %0, i64 8
  %50 = load ptr, ptr %49, align 8
  %51 = call ptr @mbedtls_pk_rsa(ptr %48, ptr %50)
  %52 = call i32 @pk_get_rsapubkey(ptr noundef nonnull %4, ptr noundef nonnull %9, ptr noundef %51)
  %53 = icmp eq i32 %52, 0
  br i1 %53, label %57, label %54

54:                                               ; preds = %47
  call void @mbedtls_pk_free(ptr noundef nonnull %0) #4
  %.not48 = icmp eq i32 %52, -15202
  br i1 %.not48, label %55, label %57

55:                                               ; preds = %54
  store ptr %1, ptr %4, align 8, !tbaa !12
  %56 = call i32 @mbedtls_pk_parse_subpubkey(ptr noundef nonnull %4, ptr noundef nonnull %9, ptr noundef nonnull %0)
  br label %57

57:                                               ; preds = %54, %47, %45, %.thread54, %18, %14, %3, %55, %42, %36, %32, %31
  %.036 = phi i32 [ %29, %31 ], [ %13, %32 ], [ %41, %36 ], [ %35, %42 ], [ %56, %55 ], [ -15616, %3 ], [ -15488, %14 ], [ %19, %18 ], [ -15488, %.thread54 ], [ %46, %45 ], [ 0, %47 ], [ %52, %54 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #4
  ret i32 %.036
}

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

declare ptr @mbedtls_pk_info_from_type(i32 noundef) local_unnamed_addr #2

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

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @mbedtls_pk_rsa(ptr, ptr) local_unnamed_addr #3

declare void @mbedtls_pk_free(ptr noundef) local_unnamed_addr #2

declare void @mbedtls_pem_init(ptr noundef) local_unnamed_addr #2

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

declare void @mbedtls_pem_free(ptr noundef) local_unnamed_addr #2

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 = { "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 = { 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 #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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !10, i64 0}
!9 = !{!"mbedtls_pem_context", !10, i64 0, !11, i64 8, !10, i64 16}
!10 = !{!"any pointer", !6, i64 0}
!11 = !{!"long", !6, i64 0}
!12 = !{!10, !10, i64 0}
!13 = !{!9, !11, i64 8}


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