; LLVM IR from ARMmbed/mbed-crypto :: programs/pkey (rsa_verify)

; 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_rsa_context = type { i32, i64, %struct.mbedtls_mpi, %struct.mbedtls_mpi, %struct.mbedtls_mpi, %struct.mbedtls_mpi, %struct.mbedtls_mpi, %struct.mbedtls_mpi, %struct.mbedtls_mpi, %struct.mbedtls_mpi, %struct.mbedtls_mpi, %struct.mbedtls_mpi, %struct.mbedtls_mpi, %struct.mbedtls_mpi, %struct.mbedtls_mpi, i32, i32 }
%struct.mbedtls_mpi = type { i32, i64, ptr }

@.str = external hidden unnamed_addr constant [30 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [41 x i8], align 1
@stdout = external global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [73 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [55 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [35 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @main(i32 noundef %0, ptr noundef %1) #0 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i64, align 8
  %11 = alloca %struct.mbedtls_rsa_context, align 8
  %12 = alloca [32 x i8], align 16
  %13 = alloca [1024 x i8], align 16
  %14 = alloca [512 x i8], align 16
  store i32 0, ptr %3, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  store i32 1, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  store i32 1, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.start.p0(i64 336, ptr %11) #4
  call void @llvm.lifetime.start.p0(i64 32, ptr %12) #4
  call void @llvm.lifetime.start.p0(i64 1024, ptr %13) #4
  call void @llvm.lifetime.start.p0(i64 512, ptr %14) #4
  call void @mbedtls_rsa_init(ptr noundef %11, i32 noundef 0, i32 noundef 0)
  %15 = load i32, ptr %4, align 4, !tbaa !5
  %16 = icmp ne i32 %15, 2
  br i1 %16, label %17, label %19

17:                                               ; preds = %2
  %18 = call i32 (ptr, ...) @printf(ptr noundef @.str)
  br label %113

19:                                               ; preds = %2
  %20 = call i32 (ptr, ...) @printf(ptr noundef @.str.1)
  %21 = load ptr, ptr @stdout, align 8, !tbaa !9
  %22 = call i32 @fflush(ptr noundef %21)
  %23 = call noalias ptr @fopen(ptr noundef @.str.2, ptr noundef @.str.3)
  store ptr %23, ptr %6, align 8, !tbaa !9
  %24 = icmp eq ptr %23, null
  br i1 %24, label %25, label %27

25:                                               ; preds = %19
  %26 = call i32 (ptr, ...) @printf(ptr noundef @.str.4)
  br label %113

27:                                               ; preds = %19
  %28 = getelementptr inbounds %struct.mbedtls_rsa_context, ptr %11, i32 0, i32 2
  %29 = load ptr, ptr %6, align 8, !tbaa !9
  %30 = call i32 @mbedtls_mpi_read_file(ptr noundef %28, i32 noundef 16, ptr noundef %29)
  store i32 %30, ptr %7, align 4, !tbaa !5
  %31 = icmp ne i32 %30, 0
  br i1 %31, label %37, label %32

32:                                               ; preds = %27
  %33 = getelementptr inbounds %struct.mbedtls_rsa_context, ptr %11, i32 0, i32 3
  %34 = load ptr, ptr %6, align 8, !tbaa !9
  %35 = call i32 @mbedtls_mpi_read_file(ptr noundef %33, i32 noundef 16, ptr noundef %34)
  store i32 %35, ptr %7, align 4, !tbaa !5
  %36 = icmp ne i32 %35, 0
  br i1 %36, label %37, label %42

37:                                               ; preds = %32, %27
  %38 = load i32, ptr %7, align 4, !tbaa !5
  %39 = call i32 (ptr, ...) @printf(ptr noundef @.str.5, i32 noundef %38)
  %40 = load ptr, ptr %6, align 8, !tbaa !9
  %41 = call i32 @fclose(ptr noundef %40)
  br label %113

42:                                               ; preds = %32
  %43 = getelementptr inbounds %struct.mbedtls_rsa_context, ptr %11, i32 0, i32 2
  %44 = call i64 @mbedtls_mpi_bitlen(ptr noundef %43)
  %45 = add i64 %44, 7
  %46 = lshr i64 %45, 3
  %47 = getelementptr inbounds %struct.mbedtls_rsa_context, ptr %11, i32 0, i32 1
  store i64 %46, ptr %47, align 8, !tbaa !11
  %48 = load ptr, ptr %6, align 8, !tbaa !9
  %49 = call i32 @fclose(ptr noundef %48)
  %50 = getelementptr inbounds [512 x i8], ptr %14, i64 0, i64 0
  %51 = load ptr, ptr %5, align 8, !tbaa !9
  %52 = getelementptr inbounds ptr, ptr %51, i64 1
  %53 = load ptr, ptr %52, align 8, !tbaa !9
  %54 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef %50, i64 noundef 512, ptr noundef @.str.6, ptr noundef %53) #4
  %55 = getelementptr inbounds [512 x i8], ptr %14, i64 0, i64 0
  %56 = call noalias ptr @fopen(ptr noundef %55, ptr noundef @.str.3)
  store ptr %56, ptr %6, align 8, !tbaa !9
  %57 = icmp eq ptr %56, null
  br i1 %57, label %58, label %61

58:                                               ; preds = %42
  %59 = getelementptr inbounds [512 x i8], ptr %14, i64 0, i64 0
  %60 = call i32 (ptr, ...) @printf(ptr noundef @.str.7, ptr noundef %59)
  br label %113

61:                                               ; preds = %42
  store i64 0, ptr %10, align 8, !tbaa !15
  br label %62

62:                                               ; preds = %71, %61
  %63 = load ptr, ptr %6, align 8, !tbaa !9
  %64 = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef %63, ptr noundef @.str.8, ptr noundef %8)
  %65 = icmp sgt i32 %64, 0
  br i1 %65, label %66, label %69

66:                                               ; preds = %62
  %67 = load i64, ptr %10, align 8, !tbaa !15
  %68 = icmp ult i64 %67, 1024
  br label %69

69:                                               ; preds = %66, %62
  %70 = phi i1 [ false, %62 ], [ %68, %66 ]
  br i1 %70, label %71, label %77

71:                                               ; preds = %69
  %72 = load i32, ptr %8, align 4, !tbaa !5
  %73 = trunc i32 %72 to i8
  %74 = load i64, ptr %10, align 8, !tbaa !15
  %75 = add i64 %74, 1
  store i64 %75, ptr %10, align 8, !tbaa !15
  %76 = getelementptr inbounds [1024 x i8], ptr %13, i64 0, i64 %74
  store i8 %73, ptr %76, align 1, !tbaa !16
  br label %62, !llvm.loop !17

77:                                               ; preds = %69
  %78 = load ptr, ptr %6, align 8, !tbaa !9
  %79 = call i32 @fclose(ptr noundef %78)
  %80 = load i64, ptr %10, align 8, !tbaa !15
  %81 = getelementptr inbounds %struct.mbedtls_rsa_context, ptr %11, i32 0, i32 1
  %82 = load i64, ptr %81, align 8, !tbaa !11
  %83 = icmp ne i64 %80, %82
  br i1 %83, label %84, label %86

84:                                               ; preds = %77
  %85 = call i32 (ptr, ...) @printf(ptr noundef @.str.9)
  br label %113

86:                                               ; preds = %77
  %87 = call i32 (ptr, ...) @printf(ptr noundef @.str.10)
  %88 = load ptr, ptr @stdout, align 8, !tbaa !9
  %89 = call i32 @fflush(ptr noundef %88)
  %90 = call ptr @mbedtls_md_info_from_type(i32 noundef 6)
  %91 = load ptr, ptr %5, align 8, !tbaa !9
  %92 = getelementptr inbounds ptr, ptr %91, i64 1
  %93 = load ptr, ptr %92, align 8, !tbaa !9
  %94 = getelementptr inbounds [32 x i8], ptr %12, i64 0, i64 0
  %95 = call i32 @mbedtls_md_file(ptr noundef %90, ptr noundef %93, ptr noundef %94)
  store i32 %95, ptr %7, align 4, !tbaa !5
  %96 = icmp ne i32 %95, 0
  br i1 %96, label %97, label %102

97:                                               ; preds = %86
  %98 = load ptr, ptr %5, align 8, !tbaa !9
  %99 = getelementptr inbounds ptr, ptr %98, i64 1
  %100 = load ptr, ptr %99, align 8, !tbaa !9
  %101 = call i32 (ptr, ...) @printf(ptr noundef @.str.11, ptr noundef %100)
  br label %113

102:                                              ; preds = %86
  %103 = getelementptr inbounds [32 x i8], ptr %12, i64 0, i64 0
  %104 = getelementptr inbounds [1024 x i8], ptr %13, i64 0, i64 0
  %105 = call i32 @mbedtls_rsa_pkcs1_verify(ptr noundef %11, ptr noundef null, ptr noundef null, i32 noundef 0, i32 noundef 6, i32 noundef 20, ptr noundef %103, ptr noundef %104)
  store i32 %105, ptr %7, align 4, !tbaa !5
  %106 = icmp ne i32 %105, 0
  br i1 %106, label %107, label %111

107:                                              ; preds = %102
  %108 = load i32, ptr %7, align 4, !tbaa !5
  %109 = sub nsw i32 0, %108
  %110 = call i32 (ptr, ...) @printf(ptr noundef @.str.12, i32 noundef %109)
  br label %113

111:                                              ; preds = %102
  %112 = call i32 (ptr, ...) @printf(ptr noundef @.str.13)
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %113

113:                                              ; preds = %111, %107, %97, %84, %58, %37, %25, %17
  call void @mbedtls_rsa_free(ptr noundef %11)
  %114 = load i32, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 512, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 1024, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 336, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  ret i32 %114
}

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

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

declare i32 @printf(ptr noundef, ...) #2

declare i32 @fflush(ptr noundef) #2

declare noalias ptr @fopen(ptr noundef, ptr noundef) #2

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

declare i32 @fclose(ptr noundef) #2

declare i64 @mbedtls_mpi_bitlen(ptr noundef) #2

; Function Attrs: nounwind
declare i32 @snprintf(ptr noundef, i64 noundef, ptr noundef, ...) #3

declare i32 @__isoc99_fscanf(ptr noundef, ptr noundef, ...) #2

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

declare ptr @mbedtls_md_info_from_type(i32 noundef) #2

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

declare void @mbedtls_rsa_free(ptr noundef) #2

; 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 "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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !13, i64 8}
!12 = !{!"mbedtls_rsa_context", !6, i64 0, !13, i64 8, !14, i64 16, !14, i64 40, !14, i64 64, !14, i64 88, !14, i64 112, !14, i64 136, !14, i64 160, !14, i64 184, !14, i64 208, !14, i64 232, !14, i64 256, !14, i64 280, !14, i64 304, !6, i64 328, !6, i64 332}
!13 = !{!"long", !7, i64 0}
!14 = !{!"mbedtls_mpi", !6, i64 0, !13, i64 8, !10, i64 16}
!15 = !{!13, !13, i64 0}
!16 = !{!7, !7, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}


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

%struct.mbedtls_rsa_context = type { i32, i64, %struct.mbedtls_mpi, %struct.mbedtls_mpi, %struct.mbedtls_mpi, %struct.mbedtls_mpi, %struct.mbedtls_mpi, %struct.mbedtls_mpi, %struct.mbedtls_mpi, %struct.mbedtls_mpi, %struct.mbedtls_mpi, %struct.mbedtls_mpi, %struct.mbedtls_mpi, %struct.mbedtls_mpi, %struct.mbedtls_mpi, i32, i32 }
%struct.mbedtls_mpi = type { i32, i64, ptr }

@.str = external hidden unnamed_addr constant [30 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [41 x i8], align 1
@stdout = external local_unnamed_addr global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [73 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [55 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [35 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @main(i32 noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 {
  %3 = alloca i32, align 4
  %4 = alloca %struct.mbedtls_rsa_context, align 8
  %5 = alloca [32 x i8], align 16
  %6 = alloca [1024 x i8], align 16
  %7 = alloca [512 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #4
  call void @llvm.lifetime.start.p0(i64 336, ptr nonnull %4) #4
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #4
  call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %6) #4
  call void @llvm.lifetime.start.p0(i64 512, ptr nonnull %7) #4
  call void @mbedtls_rsa_init(ptr noundef nonnull %4, i32 noundef 0, i32 noundef 0) #4
  %.not = icmp eq i32 %0, 2
  br i1 %.not, label %10, label %8

8:                                                ; preds = %2
  %9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str)
  br label %71

10:                                               ; preds = %2
  %11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
  %12 = load ptr, ptr @stdout, align 8, !tbaa !5
  %13 = call i32 @fflush(ptr noundef %12)
  %14 = call noalias ptr @fopen(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.3)
  %15 = icmp eq ptr %14, null
  br i1 %15, label %16, label %18

16:                                               ; preds = %10
  %17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4)
  br label %71

18:                                               ; preds = %10
  %19 = getelementptr inbounds i8, ptr %4, i64 16
  %20 = call i32 @mbedtls_mpi_read_file(ptr noundef nonnull %19, i32 noundef 16, ptr noundef nonnull %14) #4
  %.not22 = icmp eq i32 %20, 0
  br i1 %.not22, label %21, label %24

21:                                               ; preds = %18
  %22 = getelementptr inbounds i8, ptr %4, i64 40
  %23 = call i32 @mbedtls_mpi_read_file(ptr noundef nonnull %22, i32 noundef 16, ptr noundef nonnull %14) #4
  %.not23 = icmp eq i32 %23, 0
  br i1 %.not23, label %27, label %24

24:                                               ; preds = %21, %18
  %.016 = phi i32 [ %20, %18 ], [ %23, %21 ]
  %25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %.016)
  %26 = call i32 @fclose(ptr noundef nonnull %14)
  br label %71

27:                                               ; preds = %21
  %28 = call i64 @mbedtls_mpi_bitlen(ptr noundef nonnull %19) #4
  %29 = add i64 %28, 7
  %30 = lshr i64 %29, 3
  %31 = getelementptr inbounds i8, ptr %4, i64 8
  store i64 %30, ptr %31, align 8, !tbaa !9
  %32 = call i32 @fclose(ptr noundef nonnull %14)
  %33 = getelementptr inbounds i8, ptr %1, i64 8
  %34 = load ptr, ptr %33, align 8, !tbaa !5
  %35 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef nonnull dereferenceable(1) %7, i64 noundef 512, ptr noundef nonnull @.str.6, ptr noundef %34) #4
  %36 = call noalias ptr @fopen(ptr noundef nonnull %7, ptr noundef nonnull @.str.3)
  %37 = icmp eq ptr %36, null
  br i1 %37, label %40, label %.preheader

.preheader:                                       ; preds = %27
  %38 = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef nonnull %36, ptr noundef nonnull @.str.8, ptr noundef nonnull %3) #4
  %39 = icmp sgt i32 %38, 0
  br i1 %39, label %.lr.ph, label %._crit_edge

40:                                               ; preds = %27
  %41 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7, ptr noundef nonnull %7)
  br label %71

.lr.ph:                                           ; preds = %.preheader, %.lr.ph
  %.027 = phi i64 [ %44, %.lr.ph ], [ 0, %.preheader ]
  %42 = load i32, ptr %3, align 4, !tbaa !14
  %43 = trunc i32 %42 to i8
  %44 = add nuw nsw i64 %.027, 1
  %45 = getelementptr inbounds [1024 x i8], ptr %6, i64 0, i64 %.027
  store i8 %43, ptr %45, align 1, !tbaa !15
  %46 = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef nonnull %36, ptr noundef nonnull @.str.8, ptr noundef nonnull %3) #4
  %47 = icmp sgt i32 %46, 0
  %48 = icmp ult i64 %.027, 1023
  %49 = and i1 %47, %48
  br i1 %49, label %.lr.ph, label %._crit_edge, !llvm.loop !16

._crit_edge:                                      ; preds = %.lr.ph, %.preheader
  %.0.lcssa = phi i64 [ 0, %.preheader ], [ %44, %.lr.ph ]
  %50 = call i32 @fclose(ptr noundef nonnull %36)
  %51 = load i64, ptr %31, align 8, !tbaa !9
  %.not24 = icmp eq i64 %.0.lcssa, %51
  br i1 %.not24, label %54, label %52

52:                                               ; preds = %._crit_edge
  %53 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.9)
  br label %71

54:                                               ; preds = %._crit_edge
  %55 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.10)
  %56 = load ptr, ptr @stdout, align 8, !tbaa !5
  %57 = call i32 @fflush(ptr noundef %56)
  %58 = call ptr @mbedtls_md_info_from_type(i32 noundef 6) #4
  %59 = load ptr, ptr %33, align 8, !tbaa !5
  %60 = call i32 @mbedtls_md_file(ptr noundef %58, ptr noundef %59, ptr noundef nonnull %5) #4
  %.not25 = icmp eq i32 %60, 0
  br i1 %.not25, label %64, label %61

61:                                               ; preds = %54
  %62 = load ptr, ptr %33, align 8, !tbaa !5
  %63 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11, ptr noundef %62)
  br label %71

64:                                               ; preds = %54
  %65 = call i32 @mbedtls_rsa_pkcs1_verify(ptr noundef nonnull %4, ptr noundef null, ptr noundef null, i32 noundef 0, i32 noundef 6, i32 noundef 20, ptr noundef nonnull %5, ptr noundef nonnull %6) #4
  %.not26 = icmp eq i32 %65, 0
  br i1 %.not26, label %69, label %66

66:                                               ; preds = %64
  %67 = sub nsw i32 0, %65
  %68 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.12, i32 noundef %67)
  br label %71

69:                                               ; preds = %64
  %70 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.13)
  br label %71

71:                                               ; preds = %69, %66, %61, %52, %40, %24, %16, %8
  %.015 = phi i32 [ 1, %8 ], [ 1, %16 ], [ 1, %24 ], [ 1, %40 ], [ 1, %52 ], [ 1, %61 ], [ 1, %66 ], [ 0, %69 ]
  call void @mbedtls_rsa_free(ptr noundef nonnull %4) #4
  call void @llvm.lifetime.end.p0(i64 512, ptr nonnull %7) #4
  call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %6) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #4
  call void @llvm.lifetime.end.p0(i64 336, ptr nonnull %4) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #4
  ret i32 %.015
}

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

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

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3

; Function Attrs: nofree nounwind
declare noundef i32 @fflush(ptr nocapture noundef) local_unnamed_addr #3

; Function Attrs: nofree nounwind
declare noalias noundef ptr @fopen(ptr nocapture noundef readonly, ptr nocapture noundef readonly) local_unnamed_addr #3

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

; Function Attrs: nofree nounwind
declare noundef i32 @fclose(ptr nocapture noundef) local_unnamed_addr #3

declare i64 @mbedtls_mpi_bitlen(ptr noundef) local_unnamed_addr #2

; Function Attrs: nofree nounwind
declare noundef i32 @snprintf(ptr noalias nocapture noundef writeonly, i64 noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #3

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

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

declare ptr @mbedtls_md_info_from_type(i32 noundef) local_unnamed_addr #2

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

declare void @mbedtls_rsa_free(ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress 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 = { mustprogress 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 = { nofree nounwind "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, !12, i64 8}
!10 = !{!"mbedtls_rsa_context", !11, i64 0, !12, i64 8, !13, i64 16, !13, i64 40, !13, i64 64, !13, i64 88, !13, i64 112, !13, i64 136, !13, i64 160, !13, i64 184, !13, i64 208, !13, i64 232, !13, i64 256, !13, i64 280, !13, i64 304, !11, i64 328, !11, i64 332}
!11 = !{!"int", !7, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!"mbedtls_mpi", !11, i64 0, !12, i64 8, !6, i64 16}
!14 = !{!11, !11, i64 0}
!15 = !{!7, !7, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass