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

; 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_md_context_t = type { ptr, ptr, ptr }
%struct.mbedtls_md_info_t = type { ptr, i32, i8, i8 }

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0

declare void @mbedtls_platform_zeroize(ptr noundef, i64 noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @mbedtls_md_starts(ptr noundef) #2

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local i32 @mbedtls_md_hmac_starts(ptr noundef %0, ptr noundef %1, i64 noundef %2) #2 {
  %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 [64 x i8], align 16
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i64, 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 64, 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 8, ptr %12) #4
  %14 = load ptr, ptr %5, align 8, !tbaa !5
  %15 = icmp eq ptr %14, null
  br i1 %15, label %26, label %16

16:                                               ; preds = %3
  %17 = load ptr, ptr %5, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.mbedtls_md_context_t, ptr %17, i32 0, i32 0
  %19 = load ptr, ptr %18, align 8, !tbaa !13
  %20 = icmp eq ptr %19, null
  br i1 %20, label %26, label %21

21:                                               ; preds = %16
  %22 = load ptr, ptr %5, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.mbedtls_md_context_t, ptr %22, i32 0, i32 2
  %24 = load ptr, ptr %23, align 8, !tbaa !15
  %25 = icmp eq ptr %24, null
  br i1 %25, label %26, label %27

26:                                               ; preds = %21, %16, %3
  store i32 -20736, ptr %4, align 4
  store i32 1, ptr %13, align 4
  br label %150

27:                                               ; preds = %21
  %28 = load i64, ptr %7, align 8, !tbaa !9
  %29 = load ptr, ptr %5, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.mbedtls_md_context_t, ptr %29, i32 0, i32 0
  %31 = load ptr, ptr %30, align 8, !tbaa !13
  %32 = getelementptr inbounds %struct.mbedtls_md_info_t, ptr %31, i32 0, i32 3
  %33 = load i8, ptr %32, align 1, !tbaa !16
  %34 = zext i8 %33 to i64
  %35 = icmp ugt i64 %28, %34
  br i1 %35, label %36, label %62

36:                                               ; preds = %27
  %37 = load ptr, ptr %5, align 8, !tbaa !5
  %38 = call i32 @mbedtls_md_starts(ptr noundef %37)
  store i32 %38, ptr %8, align 4, !tbaa !11
  %39 = icmp ne i32 %38, 0
  br i1 %39, label %40, label %41

40:                                               ; preds = %36
  br label %147

41:                                               ; preds = %36
  %42 = load ptr, ptr %5, align 8, !tbaa !5
  %43 = load ptr, ptr %6, align 8, !tbaa !5
  %44 = load i64, ptr %7, align 8, !tbaa !9
  %45 = call i32 @mbedtls_md_update(ptr noundef %42, ptr noundef %43, i64 noundef %44)
  store i32 %45, ptr %8, align 4, !tbaa !11
  %46 = icmp ne i32 %45, 0
  br i1 %46, label %47, label %48

47:                                               ; preds = %41
  br label %147

48:                                               ; preds = %41
  %49 = load ptr, ptr %5, align 8, !tbaa !5
  %50 = getelementptr inbounds [64 x i8], ptr %9, i64 0, i64 0
  %51 = call i32 @mbedtls_md_finish(ptr noundef %49, ptr noundef %50)
  store i32 %51, ptr %8, align 4, !tbaa !11
  %52 = icmp ne i32 %51, 0
  br i1 %52, label %53, label %54

53:                                               ; preds = %48
  br label %147

54:                                               ; preds = %48
  %55 = load ptr, ptr %5, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.mbedtls_md_context_t, ptr %55, i32 0, i32 0
  %57 = load ptr, ptr %56, align 8, !tbaa !13
  %58 = getelementptr inbounds %struct.mbedtls_md_info_t, ptr %57, i32 0, i32 2
  %59 = load i8, ptr %58, align 4, !tbaa !18
  %60 = zext i8 %59 to i64
  store i64 %60, ptr %7, align 8, !tbaa !9
  %61 = getelementptr inbounds [64 x i8], ptr %9, i64 0, i64 0
  store ptr %61, ptr %6, align 8, !tbaa !5
  br label %62

62:                                               ; preds = %54, %27
  %63 = load ptr, ptr %5, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.mbedtls_md_context_t, ptr %63, i32 0, i32 2
  %65 = load ptr, ptr %64, align 8, !tbaa !15
  store ptr %65, ptr %10, align 8, !tbaa !5
  %66 = load ptr, ptr %5, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.mbedtls_md_context_t, ptr %66, i32 0, i32 2
  %68 = load ptr, ptr %67, align 8, !tbaa !15
  %69 = load ptr, ptr %5, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.mbedtls_md_context_t, ptr %69, i32 0, i32 0
  %71 = load ptr, ptr %70, align 8, !tbaa !13
  %72 = getelementptr inbounds %struct.mbedtls_md_info_t, ptr %71, i32 0, i32 3
  %73 = load i8, ptr %72, align 1, !tbaa !16
  %74 = zext i8 %73 to i32
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds i8, ptr %68, i64 %75
  store ptr %76, ptr %11, align 8, !tbaa !5
  %77 = load ptr, ptr %10, align 8, !tbaa !5
  %78 = load ptr, ptr %5, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.mbedtls_md_context_t, ptr %78, i32 0, i32 0
  %80 = load ptr, ptr %79, align 8, !tbaa !13
  %81 = getelementptr inbounds %struct.mbedtls_md_info_t, ptr %80, i32 0, i32 3
  %82 = load i8, ptr %81, align 1, !tbaa !16
  %83 = zext i8 %82 to i64
  call void @llvm.memset.p0.i64(ptr align 1 %77, i8 54, i64 %83, i1 false)
  %84 = load ptr, ptr %11, align 8, !tbaa !5
  %85 = load ptr, ptr %5, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.mbedtls_md_context_t, ptr %85, i32 0, i32 0
  %87 = load ptr, ptr %86, align 8, !tbaa !13
  %88 = getelementptr inbounds %struct.mbedtls_md_info_t, ptr %87, i32 0, i32 3
  %89 = load i8, ptr %88, align 1, !tbaa !16
  %90 = zext i8 %89 to i64
  call void @llvm.memset.p0.i64(ptr align 1 %84, i8 92, i64 %90, i1 false)
  store i64 0, ptr %12, align 8, !tbaa !9
  br label %91

91:                                               ; preds = %126, %62
  %92 = load i64, ptr %12, align 8, !tbaa !9
  %93 = load i64, ptr %7, align 8, !tbaa !9
  %94 = icmp ult i64 %92, %93
  br i1 %94, label %95, label %129

95:                                               ; preds = %91
  %96 = load ptr, ptr %10, align 8, !tbaa !5
  %97 = load i64, ptr %12, align 8, !tbaa !9
  %98 = getelementptr inbounds i8, ptr %96, i64 %97
  %99 = load i8, ptr %98, align 1, !tbaa !19
  %100 = zext i8 %99 to i32
  %101 = load ptr, ptr %6, align 8, !tbaa !5
  %102 = load i64, ptr %12, align 8, !tbaa !9
  %103 = getelementptr inbounds i8, ptr %101, i64 %102
  %104 = load i8, ptr %103, align 1, !tbaa !19
  %105 = zext i8 %104 to i32
  %106 = xor i32 %100, %105
  %107 = trunc i32 %106 to i8
  %108 = load ptr, ptr %10, align 8, !tbaa !5
  %109 = load i64, ptr %12, align 8, !tbaa !9
  %110 = getelementptr inbounds i8, ptr %108, i64 %109
  store i8 %107, ptr %110, align 1, !tbaa !19
  %111 = load ptr, ptr %11, align 8, !tbaa !5
  %112 = load i64, ptr %12, align 8, !tbaa !9
  %113 = getelementptr inbounds i8, ptr %111, i64 %112
  %114 = load i8, ptr %113, align 1, !tbaa !19
  %115 = zext i8 %114 to i32
  %116 = load ptr, ptr %6, align 8, !tbaa !5
  %117 = load i64, ptr %12, align 8, !tbaa !9
  %118 = getelementptr inbounds i8, ptr %116, i64 %117
  %119 = load i8, ptr %118, align 1, !tbaa !19
  %120 = zext i8 %119 to i32
  %121 = xor i32 %115, %120
  %122 = trunc i32 %121 to i8
  %123 = load ptr, ptr %11, align 8, !tbaa !5
  %124 = load i64, ptr %12, align 8, !tbaa !9
  %125 = getelementptr inbounds i8, ptr %123, i64 %124
  store i8 %122, ptr %125, align 1, !tbaa !19
  br label %126

126:                                              ; preds = %95
  %127 = load i64, ptr %12, align 8, !tbaa !9
  %128 = add i64 %127, 1
  store i64 %128, ptr %12, align 8, !tbaa !9
  br label %91, !llvm.loop !20

129:                                              ; preds = %91
  %130 = load ptr, ptr %5, align 8, !tbaa !5
  %131 = call i32 @mbedtls_md_starts(ptr noundef %130)
  store i32 %131, ptr %8, align 4, !tbaa !11
  %132 = icmp ne i32 %131, 0
  br i1 %132, label %133, label %134

133:                                              ; preds = %129
  br label %147

134:                                              ; preds = %129
  %135 = load ptr, ptr %5, align 8, !tbaa !5
  %136 = load ptr, ptr %10, align 8, !tbaa !5
  %137 = load ptr, ptr %5, align 8, !tbaa !5
  %138 = getelementptr inbounds %struct.mbedtls_md_context_t, ptr %137, i32 0, i32 0
  %139 = load ptr, ptr %138, align 8, !tbaa !13
  %140 = getelementptr inbounds %struct.mbedtls_md_info_t, ptr %139, i32 0, i32 3
  %141 = load i8, ptr %140, align 1, !tbaa !16
  %142 = zext i8 %141 to i64
  %143 = call i32 @mbedtls_md_update(ptr noundef %135, ptr noundef %136, i64 noundef %142)
  store i32 %143, ptr %8, align 4, !tbaa !11
  %144 = icmp ne i32 %143, 0
  br i1 %144, label %145, label %146

145:                                              ; preds = %134
  br label %147

146:                                              ; preds = %134
  br label %147

147:                                              ; preds = %146, %145, %133, %53, %47, %40
  %148 = getelementptr inbounds [64 x i8], ptr %9, i64 0, i64 0
  call void @mbedtls_platform_zeroize(ptr noundef %148, i64 noundef 64)
  %149 = load i32, ptr %8, align 4, !tbaa !11
  store i32 %149, ptr %4, align 4
  store i32 1, ptr %13, align 4
  br label %150

150:                                              ; preds = %147, %26
  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 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 64, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  %151 = load i32, ptr %4, align 4
  ret i32 %151
}

attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 0}
!14 = !{!"mbedtls_md_context_t", !6, i64 0, !6, i64 8, !6, i64 16}
!15 = !{!14, !6, i64 16}
!16 = !{!17, !7, i64 13}
!17 = !{!"mbedtls_md_info_t", !6, i64 0, !12, i64 8, !7, i64 12, !7, i64 13}
!18 = !{!17, !7, i64 12}
!19 = !{!7, !7, i64 0}
!20 = distinct !{!20, !21}
!21 = !{!"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"

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #0

declare void @mbedtls_platform_zeroize(ptr noundef, i64 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @mbedtls_md_starts(ptr noundef) local_unnamed_addr #2

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local i32 @mbedtls_md_hmac_starts(ptr noundef %0, ptr noundef %1, i64 noundef %2) local_unnamed_addr #2 {
  %4 = alloca [64 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %4) #4
  %5 = icmp eq ptr %0, null
  br i1 %5, label %93, label %6

6:                                                ; preds = %3
  %7 = load ptr, ptr %0, align 8, !tbaa !5
  %8 = icmp eq ptr %7, null
  br i1 %8, label %93, label %9

9:                                                ; preds = %6
  %10 = getelementptr inbounds i8, ptr %0, i64 16
  %11 = load ptr, ptr %10, align 8, !tbaa !10
  %12 = icmp eq ptr %11, null
  br i1 %12, label %93, label %13

13:                                               ; preds = %9
  %14 = getelementptr inbounds i8, ptr %7, i64 13
  %15 = load i8, ptr %14, align 1, !tbaa !11
  %16 = zext i8 %15 to i64
  %17 = icmp ult i64 %16, %2
  br i1 %17, label %18, label %29

18:                                               ; preds = %13
  %19 = tail call i32 @mbedtls_md_starts(ptr noundef nonnull %0)
  %.not = icmp eq i32 %19, 0
  br i1 %.not, label %20, label %92

20:                                               ; preds = %18
  %21 = tail call i32 @mbedtls_md_update(ptr noundef nonnull %0, ptr noundef %1, i64 noundef %2)
  %.not49 = icmp eq i32 %21, 0
  br i1 %.not49, label %22, label %92

22:                                               ; preds = %20
  %23 = call i32 @mbedtls_md_finish(ptr noundef nonnull %0, ptr noundef nonnull %4)
  %.not50 = icmp eq i32 %23, 0
  br i1 %.not50, label %24, label %92

24:                                               ; preds = %22
  %25 = load ptr, ptr %0, align 8, !tbaa !5
  %26 = getelementptr inbounds i8, ptr %25, i64 12
  %27 = load i8, ptr %26, align 4, !tbaa !14
  %28 = zext i8 %27 to i64
  %.pre = load ptr, ptr %10, align 8, !tbaa !10
  %.phi.trans.insert = getelementptr inbounds i8, ptr %25, i64 13
  %.pre54 = load i8, ptr %.phi.trans.insert, align 1, !tbaa !11
  %.pre55 = zext i8 %.pre54 to i64
  br label %29

29:                                               ; preds = %24, %13
  %.pre-phi = phi i64 [ %.pre55, %24 ], [ %16, %13 ]
  %30 = phi ptr [ %.pre, %24 ], [ %11, %13 ]
  %.041 = phi i64 [ %28, %24 ], [ %2, %13 ]
  %.039 = phi ptr [ %4, %24 ], [ %1, %13 ]
  %31 = getelementptr i8, ptr %30, i64 %.pre-phi
  call void @llvm.memset.p0.i64(ptr align 1 %30, i8 54, i64 %.pre-phi, i1 false)
  %32 = load ptr, ptr %0, align 8, !tbaa !5
  %33 = getelementptr inbounds i8, ptr %32, i64 13
  %34 = load i8, ptr %33, align 1, !tbaa !11
  %35 = zext i8 %34 to i64
  call void @llvm.memset.p0.i64(ptr align 1 %31, i8 92, i64 %35, i1 false)
  %.not53 = icmp eq i64 %.041, 0
  br i1 %.not53, label %._crit_edge, label %iter.check

iter.check:                                       ; preds = %29
  %min.iters.check = icmp ult i64 %.041, 8
  br i1 %min.iters.check, label %.lr.ph.preheader, label %vector.memcheck

vector.memcheck:                                  ; preds = %iter.check
  %scevgep = getelementptr i8, ptr %30, i64 %.041
  %36 = add i64 %.pre-phi, %.041
  %scevgep56 = getelementptr i8, ptr %30, i64 %36
  %scevgep57 = getelementptr i8, ptr %.039, i64 %.041
  %bound0 = icmp ult ptr %30, %scevgep56
  %bound1 = icmp ult ptr %31, %scevgep
  %found.conflict = and i1 %bound0, %bound1
  %bound058 = icmp ult ptr %30, %scevgep57
  %bound159 = icmp ult ptr %.039, %scevgep
  %found.conflict60 = and i1 %bound058, %bound159
  %conflict.rdx = or i1 %found.conflict, %found.conflict60
  %bound061 = icmp ult ptr %31, %scevgep57
  %bound162 = icmp ult ptr %.039, %scevgep56
  %found.conflict63 = and i1 %bound061, %bound162
  %conflict.rdx64 = or i1 %conflict.rdx, %found.conflict63
  br i1 %conflict.rdx64, label %.lr.ph.preheader, label %vector.main.loop.iter.check

vector.main.loop.iter.check:                      ; preds = %vector.memcheck
  %min.iters.check65 = icmp ult i64 %.041, 32
  br i1 %min.iters.check65, label %vec.epilog.ph, label %vector.ph

vector.ph:                                        ; preds = %vector.main.loop.iter.check
  %n.vec = and i64 %.041, -32
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %37 = getelementptr inbounds i8, ptr %30, i64 %index
  %38 = getelementptr inbounds i8, ptr %37, i64 16
  %wide.load = load <16 x i8>, ptr %37, align 1, !tbaa !15, !alias.scope !16, !noalias !19
  %wide.load66 = load <16 x i8>, ptr %38, align 1, !tbaa !15, !alias.scope !16, !noalias !19
  %39 = getelementptr inbounds i8, ptr %.039, i64 %index
  %40 = getelementptr inbounds i8, ptr %39, i64 16
  %wide.load67 = load <16 x i8>, ptr %39, align 1, !tbaa !15, !alias.scope !22
  %wide.load68 = load <16 x i8>, ptr %40, align 1, !tbaa !15, !alias.scope !22
  %41 = xor <16 x i8> %wide.load67, %wide.load
  %42 = xor <16 x i8> %wide.load68, %wide.load66
  store <16 x i8> %41, ptr %37, align 1, !tbaa !15, !alias.scope !16, !noalias !19
  store <16 x i8> %42, ptr %38, align 1, !tbaa !15, !alias.scope !16, !noalias !19
  %43 = getelementptr inbounds i8, ptr %31, i64 %index
  %44 = getelementptr inbounds i8, ptr %43, i64 16
  %wide.load69 = load <16 x i8>, ptr %43, align 1, !tbaa !15, !alias.scope !23, !noalias !22
  %wide.load70 = load <16 x i8>, ptr %44, align 1, !tbaa !15, !alias.scope !23, !noalias !22
  %wide.load71 = load <16 x i8>, ptr %39, align 1, !tbaa !15, !alias.scope !22
  %wide.load72 = load <16 x i8>, ptr %40, align 1, !tbaa !15, !alias.scope !22
  %45 = xor <16 x i8> %wide.load71, %wide.load69
  %46 = xor <16 x i8> %wide.load72, %wide.load70
  store <16 x i8> %45, ptr %43, align 1, !tbaa !15, !alias.scope !23, !noalias !22
  store <16 x i8> %46, ptr %44, align 1, !tbaa !15, !alias.scope !23, !noalias !22
  %index.next = add nuw i64 %index, 32
  %47 = icmp eq i64 %index.next, %n.vec
  br i1 %47, label %middle.block, label %vector.body, !llvm.loop !24

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %.041, %n.vec
  br i1 %cmp.n, label %._crit_edge, label %vec.epilog.iter.check

vec.epilog.iter.check:                            ; preds = %middle.block
  %n.vec.remaining = and i64 %.041, 24
  %min.epilog.iters.check = icmp eq i64 %n.vec.remaining, 0
  br i1 %min.epilog.iters.check, label %.lr.ph.preheader, label %vec.epilog.ph

vec.epilog.ph:                                    ; preds = %vector.main.loop.iter.check, %vec.epilog.iter.check
  %vec.epilog.resume.val = phi i64 [ %n.vec, %vec.epilog.iter.check ], [ 0, %vector.main.loop.iter.check ]
  %n.vec74 = and i64 %.041, -8
  br label %vec.epilog.vector.body

vec.epilog.vector.body:                           ; preds = %vec.epilog.vector.body, %vec.epilog.ph
  %index75 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next80, %vec.epilog.vector.body ]
  %48 = getelementptr inbounds i8, ptr %30, i64 %index75
  %wide.load76 = load <8 x i8>, ptr %48, align 1, !tbaa !15, !alias.scope !28, !noalias !31
  %49 = getelementptr inbounds i8, ptr %.039, i64 %index75
  %wide.load77 = load <8 x i8>, ptr %49, align 1, !tbaa !15, !alias.scope !34
  %50 = xor <8 x i8> %wide.load77, %wide.load76
  store <8 x i8> %50, ptr %48, align 1, !tbaa !15, !alias.scope !28, !noalias !31
  %51 = getelementptr inbounds i8, ptr %31, i64 %index75
  %wide.load78 = load <8 x i8>, ptr %51, align 1, !tbaa !15, !alias.scope !35, !noalias !34
  %52 = xor <8 x i8> %wide.load77, %wide.load78
  store <8 x i8> %52, ptr %51, align 1, !tbaa !15, !alias.scope !35, !noalias !34
  %index.next80 = add nuw i64 %index75, 8
  %53 = icmp eq i64 %index.next80, %n.vec74
  br i1 %53, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !36

vec.epilog.middle.block:                          ; preds = %vec.epilog.vector.body
  %cmp.n81 = icmp eq i64 %.041, %n.vec74
  br i1 %cmp.n81, label %._crit_edge, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %vec.epilog.middle.block, %vector.memcheck, %iter.check, %vec.epilog.iter.check
  %.052.ph = phi i64 [ 0, %iter.check ], [ 0, %vector.memcheck ], [ %n.vec, %vec.epilog.iter.check ], [ %n.vec74, %vec.epilog.middle.block ]
  %.neg = or disjoint i64 %.052.ph, 1
  %xtraiter = and i64 %.041, 1
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.lr.ph.prol.loopexit, label %.lr.ph.prol

.lr.ph.prol:                                      ; preds = %.lr.ph.preheader
  %54 = getelementptr inbounds i8, ptr %30, i64 %.052.ph
  %55 = load i8, ptr %54, align 1, !tbaa !15
  %56 = getelementptr inbounds i8, ptr %.039, i64 %.052.ph
  %57 = load i8, ptr %56, align 1, !tbaa !15
  %58 = xor i8 %57, %55
  store i8 %58, ptr %54, align 1, !tbaa !15
  %59 = getelementptr inbounds i8, ptr %31, i64 %.052.ph
  %60 = load i8, ptr %59, align 1, !tbaa !15
  %61 = load i8, ptr %56, align 1, !tbaa !15
  %62 = xor i8 %61, %60
  store i8 %62, ptr %59, align 1, !tbaa !15
  %63 = or disjoint i64 %.052.ph, 1
  br label %.lr.ph.prol.loopexit

.lr.ph.prol.loopexit:                             ; preds = %.lr.ph.prol, %.lr.ph.preheader
  %.052.unr = phi i64 [ %.052.ph, %.lr.ph.preheader ], [ %63, %.lr.ph.prol ]
  %64 = icmp eq i64 %.041, %.neg
  br i1 %64, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.prol.loopexit, %.lr.ph
  %.052 = phi i64 [ %84, %.lr.ph ], [ %.052.unr, %.lr.ph.prol.loopexit ]
  %65 = getelementptr inbounds i8, ptr %30, i64 %.052
  %66 = load i8, ptr %65, align 1, !tbaa !15
  %67 = getelementptr inbounds i8, ptr %.039, i64 %.052
  %68 = load i8, ptr %67, align 1, !tbaa !15
  %69 = xor i8 %68, %66
  store i8 %69, ptr %65, align 1, !tbaa !15
  %70 = getelementptr inbounds i8, ptr %31, i64 %.052
  %71 = load i8, ptr %70, align 1, !tbaa !15
  %72 = load i8, ptr %67, align 1, !tbaa !15
  %73 = xor i8 %72, %71
  store i8 %73, ptr %70, align 1, !tbaa !15
  %74 = add nuw nsw i64 %.052, 1
  %75 = getelementptr inbounds i8, ptr %30, i64 %74
  %76 = load i8, ptr %75, align 1, !tbaa !15
  %77 = getelementptr inbounds i8, ptr %.039, i64 %74
  %78 = load i8, ptr %77, align 1, !tbaa !15
  %79 = xor i8 %78, %76
  store i8 %79, ptr %75, align 1, !tbaa !15
  %80 = getelementptr inbounds i8, ptr %31, i64 %74
  %81 = load i8, ptr %80, align 1, !tbaa !15
  %82 = load i8, ptr %77, align 1, !tbaa !15
  %83 = xor i8 %82, %81
  store i8 %83, ptr %80, align 1, !tbaa !15
  %84 = add nuw nsw i64 %.052, 2
  %exitcond.not.1 = icmp eq i64 %84, %.041
  br i1 %exitcond.not.1, label %._crit_edge, label %.lr.ph, !llvm.loop !37

._crit_edge:                                      ; preds = %.lr.ph.prol.loopexit, %.lr.ph, %middle.block, %vec.epilog.middle.block, %29
  %85 = call i32 @mbedtls_md_starts(ptr noundef nonnull %0)
  %.not51 = icmp eq i32 %85, 0
  br i1 %.not51, label %86, label %92

86:                                               ; preds = %._crit_edge
  %87 = load ptr, ptr %0, align 8, !tbaa !5
  %88 = getelementptr inbounds i8, ptr %87, i64 13
  %89 = load i8, ptr %88, align 1, !tbaa !11
  %90 = zext i8 %89 to i64
  %91 = call i32 @mbedtls_md_update(ptr noundef nonnull %0, ptr noundef %30, i64 noundef %90)
  br label %92

92:                                               ; preds = %86, %._crit_edge, %22, %20, %18
  %.040 = phi i32 [ %19, %18 ], [ %21, %20 ], [ %23, %22 ], [ %85, %._crit_edge ], [ %91, %86 ]
  call void @mbedtls_platform_zeroize(ptr noundef nonnull %4, i64 noundef 64) #4
  br label %93

93:                                               ; preds = %3, %6, %9, %92
  %.038 = phi i32 [ %.040, %92 ], [ -20736, %9 ], [ -20736, %6 ], [ -20736, %3 ]
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %4) #4
  ret i32 %.038
}

attributes #0 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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, !7, i64 0}
!6 = !{!"mbedtls_md_context_t", !7, i64 0, !7, i64 8, !7, i64 16}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!6, !7, i64 16}
!11 = !{!12, !8, i64 13}
!12 = !{!"mbedtls_md_info_t", !7, i64 0, !13, i64 8, !8, i64 12, !8, i64 13}
!13 = !{!"int", !8, i64 0}
!14 = !{!12, !8, i64 12}
!15 = !{!8, !8, i64 0}
!16 = !{!17}
!17 = distinct !{!17, !18}
!18 = distinct !{!18, !"LVerDomain"}
!19 = !{!20, !21}
!20 = distinct !{!20, !18}
!21 = distinct !{!21, !18}
!22 = !{!21}
!23 = !{!20}
!24 = distinct !{!24, !25, !26, !27}
!25 = !{!"llvm.loop.mustprogress"}
!26 = !{!"llvm.loop.isvectorized", i32 1}
!27 = !{!"llvm.loop.unroll.runtime.disable"}
!28 = !{!29}
!29 = distinct !{!29, !30}
!30 = distinct !{!30, !"LVerDomain"}
!31 = !{!32, !33}
!32 = distinct !{!32, !30}
!33 = distinct !{!33, !30}
!34 = !{!33}
!35 = !{!32}
!36 = distinct !{!36, !25, !26, !27}
!37 = distinct !{!37, !25, !26}


; Effective O3 passes: BDCEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass