; LLVM IR from vergecurrency/verge :: src/crypto/pow/pbkdf2.ll (Z16HMAC_SHA256_InitP18HMAC_SHA256ContextPKvm)

; 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.HMAC_SHA256Context = type { %struct.SHA256state_st, %struct.SHA256state_st }
%struct.SHA256state_st = type { [8 x i32], i32, i32, [16 x i32], i32, i32 }

; Function Attrs: mustprogress uwtable
define dso_local void @_Z16HMAC_SHA256_InitP18HMAC_SHA256ContextPKvm(ptr noundef %0, ptr noundef %1, i64 noundef %2) #0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i64, align 8
  %7 = alloca [64 x i8], align 16
  %8 = alloca [32 x i8], align 16
  %9 = alloca ptr, align 8
  %10 = alloca i64, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store i64 %2, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 64, ptr %7) #4
  call void @llvm.lifetime.start.p0(i64 32, ptr %8) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %11 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %11, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %12 = load i64, ptr %6, align 8, !tbaa !9
  %13 = icmp ugt i64 %12, 64
  br i1 %13, label %14, label %28

14:                                               ; preds = %3
  %15 = load ptr, ptr %4, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct.HMAC_SHA256Context, ptr %15, i32 0, i32 0
  %17 = call i32 @SHA256_Init(ptr noundef %16)
  %18 = load ptr, ptr %4, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.HMAC_SHA256Context, ptr %18, i32 0, i32 0
  %20 = load ptr, ptr %9, align 8, !tbaa !5
  %21 = load i64, ptr %6, align 8, !tbaa !9
  %22 = call i32 @SHA256_Update(ptr noundef %19, ptr noundef %20, i64 noundef %21)
  %23 = getelementptr inbounds [32 x i8], ptr %8, i64 0, i64 0
  %24 = load ptr, ptr %4, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.HMAC_SHA256Context, ptr %24, i32 0, i32 0
  %26 = call i32 @SHA256_Final(ptr noundef %23, ptr noundef %25)
  %27 = getelementptr inbounds [32 x i8], ptr %8, i64 0, i64 0
  store ptr %27, ptr %9, align 8, !tbaa !5
  store i64 32, ptr %6, align 8, !tbaa !9
  br label %28

28:                                               ; preds = %14, %3
  %29 = load ptr, ptr %4, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.HMAC_SHA256Context, ptr %29, i32 0, i32 0
  %31 = call i32 @SHA256_Init(ptr noundef %30)
  %32 = getelementptr inbounds [64 x i8], ptr %7, i64 0, i64 0
  call void @llvm.memset.p0.i64(ptr align 16 %32, i8 54, i64 64, i1 false)
  store i64 0, ptr %10, align 8, !tbaa !9
  br label %33

33:                                               ; preds = %49, %28
  %34 = load i64, ptr %10, align 8, !tbaa !9
  %35 = load i64, ptr %6, align 8, !tbaa !9
  %36 = icmp ult i64 %34, %35
  br i1 %36, label %37, label %52

37:                                               ; preds = %33
  %38 = load ptr, ptr %9, align 8, !tbaa !5
  %39 = load i64, ptr %10, align 8, !tbaa !9
  %40 = getelementptr inbounds i8, ptr %38, i64 %39
  %41 = load i8, ptr %40, align 1, !tbaa !11
  %42 = zext i8 %41 to i32
  %43 = load i64, ptr %10, align 8, !tbaa !9
  %44 = getelementptr inbounds [64 x i8], ptr %7, i64 0, i64 %43
  %45 = load i8, ptr %44, align 1, !tbaa !11
  %46 = zext i8 %45 to i32
  %47 = xor i32 %46, %42
  %48 = trunc i32 %47 to i8
  store i8 %48, ptr %44, align 1, !tbaa !11
  br label %49

49:                                               ; preds = %37
  %50 = load i64, ptr %10, align 8, !tbaa !9
  %51 = add i64 %50, 1
  store i64 %51, ptr %10, align 8, !tbaa !9
  br label %33, !llvm.loop !12

52:                                               ; preds = %33
  %53 = load ptr, ptr %4, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.HMAC_SHA256Context, ptr %53, i32 0, i32 0
  %55 = getelementptr inbounds [64 x i8], ptr %7, i64 0, i64 0
  %56 = call i32 @SHA256_Update(ptr noundef %54, ptr noundef %55, i64 noundef 64)
  %57 = load ptr, ptr %4, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.HMAC_SHA256Context, ptr %57, i32 0, i32 1
  %59 = call i32 @SHA256_Init(ptr noundef %58)
  %60 = getelementptr inbounds [64 x i8], ptr %7, i64 0, i64 0
  call void @llvm.memset.p0.i64(ptr align 16 %60, i8 92, i64 64, i1 false)
  store i64 0, ptr %10, align 8, !tbaa !9
  br label %61

61:                                               ; preds = %77, %52
  %62 = load i64, ptr %10, align 8, !tbaa !9
  %63 = load i64, ptr %6, align 8, !tbaa !9
  %64 = icmp ult i64 %62, %63
  br i1 %64, label %65, label %80

65:                                               ; preds = %61
  %66 = load ptr, ptr %9, align 8, !tbaa !5
  %67 = load i64, ptr %10, align 8, !tbaa !9
  %68 = getelementptr inbounds i8, ptr %66, i64 %67
  %69 = load i8, ptr %68, align 1, !tbaa !11
  %70 = zext i8 %69 to i32
  %71 = load i64, ptr %10, align 8, !tbaa !9
  %72 = getelementptr inbounds [64 x i8], ptr %7, i64 0, i64 %71
  %73 = load i8, ptr %72, align 1, !tbaa !11
  %74 = zext i8 %73 to i32
  %75 = xor i32 %74, %70
  %76 = trunc i32 %75 to i8
  store i8 %76, ptr %72, align 1, !tbaa !11
  br label %77

77:                                               ; preds = %65
  %78 = load i64, ptr %10, align 8, !tbaa !9
  %79 = add i64 %78, 1
  store i64 %79, ptr %10, align 8, !tbaa !9
  br label %61, !llvm.loop !14

80:                                               ; preds = %61
  %81 = load ptr, ptr %4, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.HMAC_SHA256Context, ptr %81, i32 0, i32 1
  %83 = getelementptr inbounds [64 x i8], ptr %7, i64 0, i64 0
  %84 = call i32 @SHA256_Update(ptr noundef %82, ptr noundef %83, i64 noundef 64)
  %85 = getelementptr inbounds [32 x i8], ptr %8, i64 0, i64 0
  call void @llvm.memset.p0.i64(ptr align 16 %85, i8 0, i64 32, i1 false)
  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 32, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 64, ptr %7) #4
  ret void
}

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

declare i32 @SHA256_Init(ptr noundef) #2

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

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

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

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

attributes #0 = { mustprogress 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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}


; 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 uwtable
define dso_local void @_Z16HMAC_SHA256_InitP18HMAC_SHA256ContextPKvm(ptr noundef %0, ptr noundef %1, i64 noundef %2) local_unnamed_addr #0 {
  %4 = alloca [64 x i8], align 16
  %5 = alloca [32 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %4) #4
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #4
  %6 = icmp ugt i64 %2, 64
  br i1 %6, label %7, label %11

7:                                                ; preds = %3
  %8 = tail call i32 @SHA256_Init(ptr noundef %0)
  %9 = tail call i32 @SHA256_Update(ptr noundef %0, ptr noundef %1, i64 noundef %2)
  %10 = call i32 @SHA256_Final(ptr noundef nonnull %5, ptr noundef %0)
  br label %11

11:                                               ; preds = %7, %3
  %.023 = phi i64 [ 32, %7 ], [ %2, %3 ]
  %.022 = phi ptr [ %5, %7 ], [ %1, %3 ]
  %.022.sroa.phi90 = getelementptr inbounds i8, ptr %.022, i64 8
  %.022.sroa.phi87 = getelementptr inbounds i8, ptr %.022, i64 96
  %.022.sroa.phi84 = getelementptr inbounds i8, ptr %.022, i64 80
  %.022.sroa.phi81 = getelementptr inbounds i8, ptr %.022, i64 64
  %.022.sroa.phi78 = getelementptr inbounds i8, ptr %.022, i64 48
  %.022.sroa.phi75 = getelementptr inbounds i8, ptr %.022, i64 32
  %.022.sroa.phi72 = getelementptr inbounds i8, ptr %.022, i64 16
  %.022.sroa.phi69 = getelementptr inbounds i8, ptr %.022, i64 8
  %.022.sroa.phi66 = getelementptr inbounds i8, ptr %.022, i64 96
  %.022.sroa.phi63 = getelementptr inbounds i8, ptr %.022, i64 80
  %.022.sroa.phi60 = getelementptr inbounds i8, ptr %.022, i64 64
  %.022.sroa.phi57 = getelementptr inbounds i8, ptr %.022, i64 48
  %.022.sroa.phi54 = getelementptr inbounds i8, ptr %.022, i64 32
  %.022.sroa.phi = getelementptr inbounds i8, ptr %.022, i64 16
  %12 = call i32 @SHA256_Init(ptr noundef %0)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(64) %4, i8 54, i64 64, i1 false)
  %.not = icmp eq i64 %.023, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %11
  %min.iters.check = icmp ult i64 %.023, 16
  br i1 %min.iters.check, label %.lr.ph.preheader52, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph.preheader
  %n.vec = and i64 %.023, 112
  %wide.load = load <8 x i8>, ptr %.022, align 1, !tbaa !5
  %wide.load33 = load <8 x i8>, ptr %.022.sroa.phi69, align 1, !tbaa !5
  %13 = getelementptr inbounds i8, ptr %4, i64 8
  %wide.load34 = load <8 x i8>, ptr %4, align 16, !tbaa !5
  %wide.load35 = load <8 x i8>, ptr %13, align 8, !tbaa !5
  %14 = xor <8 x i8> %wide.load34, %wide.load
  %15 = xor <8 x i8> %wide.load35, %wide.load33
  store <8 x i8> %14, ptr %4, align 16, !tbaa !5
  store <8 x i8> %15, ptr %13, align 8, !tbaa !5
  %16 = icmp eq i64 %n.vec, 16
  br i1 %16, label %middle.block, label %vector.body.1, !llvm.loop !8

vector.body.1:                                    ; preds = %vector.ph
  %17 = getelementptr inbounds i8, ptr %.022, i64 24
  %wide.load.1 = load <8 x i8>, ptr %.022.sroa.phi, align 1, !tbaa !5
  %wide.load33.1 = load <8 x i8>, ptr %17, align 1, !tbaa !5
  %18 = getelementptr inbounds i8, ptr %4, i64 16
  %19 = getelementptr inbounds i8, ptr %4, i64 24
  %wide.load34.1 = load <8 x i8>, ptr %18, align 16, !tbaa !5
  %wide.load35.1 = load <8 x i8>, ptr %19, align 8, !tbaa !5
  %20 = xor <8 x i8> %wide.load34.1, %wide.load.1
  %21 = xor <8 x i8> %wide.load35.1, %wide.load33.1
  store <8 x i8> %20, ptr %18, align 16, !tbaa !5
  store <8 x i8> %21, ptr %19, align 8, !tbaa !5
  %22 = icmp eq i64 %n.vec, 32
  br i1 %22, label %middle.block, label %vector.body.2, !llvm.loop !8

vector.body.2:                                    ; preds = %vector.body.1
  %23 = getelementptr inbounds i8, ptr %.022, i64 40
  %wide.load.2 = load <8 x i8>, ptr %.022.sroa.phi54, align 1, !tbaa !5
  %wide.load33.2 = load <8 x i8>, ptr %23, align 1, !tbaa !5
  %24 = getelementptr inbounds i8, ptr %4, i64 32
  %25 = getelementptr inbounds i8, ptr %4, i64 40
  %wide.load34.2 = load <8 x i8>, ptr %24, align 16, !tbaa !5
  %wide.load35.2 = load <8 x i8>, ptr %25, align 8, !tbaa !5
  %26 = xor <8 x i8> %wide.load34.2, %wide.load.2
  %27 = xor <8 x i8> %wide.load35.2, %wide.load33.2
  store <8 x i8> %26, ptr %24, align 16, !tbaa !5
  store <8 x i8> %27, ptr %25, align 8, !tbaa !5
  %28 = icmp eq i64 %n.vec, 48
  br i1 %28, label %middle.block, label %vector.body.3, !llvm.loop !8

vector.body.3:                                    ; preds = %vector.body.2
  %29 = getelementptr inbounds i8, ptr %.022, i64 56
  %wide.load.3 = load <8 x i8>, ptr %.022.sroa.phi57, align 1, !tbaa !5
  %wide.load33.3 = load <8 x i8>, ptr %29, align 1, !tbaa !5
  %30 = getelementptr inbounds i8, ptr %4, i64 48
  %31 = getelementptr inbounds i8, ptr %4, i64 56
  %wide.load34.3 = load <8 x i8>, ptr %30, align 16, !tbaa !5
  %wide.load35.3 = load <8 x i8>, ptr %31, align 8, !tbaa !5
  %32 = xor <8 x i8> %wide.load34.3, %wide.load.3
  %33 = xor <8 x i8> %wide.load35.3, %wide.load33.3
  store <8 x i8> %32, ptr %30, align 16, !tbaa !5
  store <8 x i8> %33, ptr %31, align 8, !tbaa !5
  %34 = icmp eq i64 %n.vec, 64
  br i1 %34, label %middle.block, label %vector.body.4, !llvm.loop !8

vector.body.4:                                    ; preds = %vector.body.3
  %35 = getelementptr inbounds i8, ptr %.022, i64 72
  %wide.load.4 = load <8 x i8>, ptr %.022.sroa.phi60, align 1, !tbaa !5
  %wide.load33.4 = load <8 x i8>, ptr %35, align 1, !tbaa !5
  %36 = getelementptr inbounds i8, ptr %4, i64 64
  %37 = getelementptr inbounds i8, ptr %4, i64 72
  %wide.load34.4 = load <8 x i8>, ptr %36, align 16, !tbaa !5
  %wide.load35.4 = load <8 x i8>, ptr %37, align 8, !tbaa !5
  %38 = xor <8 x i8> %wide.load34.4, %wide.load.4
  %39 = xor <8 x i8> %wide.load35.4, %wide.load33.4
  store <8 x i8> %38, ptr %36, align 16, !tbaa !5
  store <8 x i8> %39, ptr %37, align 8, !tbaa !5
  %40 = icmp eq i64 %n.vec, 80
  br i1 %40, label %middle.block, label %vector.body.5, !llvm.loop !8

vector.body.5:                                    ; preds = %vector.body.4
  %41 = getelementptr inbounds i8, ptr %.022, i64 88
  %wide.load.5 = load <8 x i8>, ptr %.022.sroa.phi63, align 1, !tbaa !5
  %wide.load33.5 = load <8 x i8>, ptr %41, align 1, !tbaa !5
  %42 = getelementptr inbounds i8, ptr %4, i64 80
  %43 = getelementptr inbounds i8, ptr %4, i64 88
  %wide.load34.5 = load <8 x i8>, ptr %42, align 16, !tbaa !5
  %wide.load35.5 = load <8 x i8>, ptr %43, align 8, !tbaa !5
  %44 = xor <8 x i8> %wide.load34.5, %wide.load.5
  %45 = xor <8 x i8> %wide.load35.5, %wide.load33.5
  store <8 x i8> %44, ptr %42, align 16, !tbaa !5
  store <8 x i8> %45, ptr %43, align 8, !tbaa !5
  %46 = icmp eq i64 %n.vec, 96
  br i1 %46, label %middle.block, label %vector.body.6, !llvm.loop !8

vector.body.6:                                    ; preds = %vector.body.5
  %47 = getelementptr inbounds i8, ptr %.022, i64 104
  %wide.load.6 = load <8 x i8>, ptr %.022.sroa.phi66, align 1, !tbaa !5
  %wide.load33.6 = load <8 x i8>, ptr %47, align 1, !tbaa !5
  %48 = getelementptr inbounds i8, ptr %4, i64 96
  %49 = getelementptr inbounds i8, ptr %4, i64 104
  %wide.load34.6 = load <8 x i8>, ptr %48, align 16, !tbaa !5
  %wide.load35.6 = load <8 x i8>, ptr %49, align 8, !tbaa !5
  %50 = xor <8 x i8> %wide.load34.6, %wide.load.6
  %51 = xor <8 x i8> %wide.load35.6, %wide.load33.6
  store <8 x i8> %50, ptr %48, align 16, !tbaa !5
  store <8 x i8> %51, ptr %49, align 8, !tbaa !5
  br label %middle.block

middle.block:                                     ; preds = %vector.body.6, %vector.body.5, %vector.body.4, %vector.body.3, %vector.body.2, %vector.body.1, %vector.ph
  %cmp.n = icmp eq i64 %.023, %n.vec
  br i1 %cmp.n, label %._crit_edge, label %.lr.ph.preheader52

.lr.ph.preheader52:                               ; preds = %middle.block, %.lr.ph.preheader
  %.026.ph = phi i64 [ 0, %.lr.ph.preheader ], [ %n.vec, %middle.block ]
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader52, %.lr.ph
  %.026 = phi i64 [ %57, %.lr.ph ], [ %.026.ph, %.lr.ph.preheader52 ]
  %52 = getelementptr inbounds i8, ptr %.022, i64 %.026
  %53 = load i8, ptr %52, align 1, !tbaa !5
  %54 = getelementptr inbounds [64 x i8], ptr %4, i64 0, i64 %.026
  %55 = load i8, ptr %54, align 1, !tbaa !5
  %56 = xor i8 %55, %53
  store i8 %56, ptr %54, align 1, !tbaa !5
  %57 = add nuw nsw i64 %.026, 1
  %exitcond.not = icmp eq i64 %57, %.023
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !12

._crit_edge:                                      ; preds = %.lr.ph, %middle.block, %11
  %58 = call i32 @SHA256_Update(ptr noundef %0, ptr noundef nonnull %4, i64 noundef 64)
  %59 = getelementptr inbounds i8, ptr %0, i64 112
  %60 = call i32 @SHA256_Init(ptr noundef nonnull %59)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(64) %4, i8 92, i64 64, i1 false)
  br i1 %.not, label %._crit_edge30, label %.lr.ph29.preheader

.lr.ph29.preheader:                               ; preds = %._crit_edge
  %min.iters.check38 = icmp ult i64 %.023, 16
  br i1 %min.iters.check38, label %.lr.ph29.preheader51, label %vector.ph39

vector.ph39:                                      ; preds = %.lr.ph29.preheader
  %n.vec41 = and i64 %.023, 112
  %wide.load45 = load <8 x i8>, ptr %.022, align 1, !tbaa !5
  %wide.load46 = load <8 x i8>, ptr %.022.sroa.phi90, align 1, !tbaa !5
  %61 = getelementptr inbounds i8, ptr %4, i64 8
  %wide.load47 = load <8 x i8>, ptr %4, align 16, !tbaa !5
  %wide.load48 = load <8 x i8>, ptr %61, align 8, !tbaa !5
  %62 = xor <8 x i8> %wide.load47, %wide.load45
  %63 = xor <8 x i8> %wide.load48, %wide.load46
  store <8 x i8> %62, ptr %4, align 16, !tbaa !5
  store <8 x i8> %63, ptr %61, align 8, !tbaa !5
  %64 = icmp eq i64 %n.vec41, 16
  br i1 %64, label %middle.block36, label %vector.body43.1, !llvm.loop !13

vector.body43.1:                                  ; preds = %vector.ph39
  %65 = getelementptr inbounds i8, ptr %.022, i64 24
  %wide.load45.1 = load <8 x i8>, ptr %.022.sroa.phi72, align 1, !tbaa !5
  %wide.load46.1 = load <8 x i8>, ptr %65, align 1, !tbaa !5
  %66 = getelementptr inbounds i8, ptr %4, i64 16
  %67 = getelementptr inbounds i8, ptr %4, i64 24
  %wide.load47.1 = load <8 x i8>, ptr %66, align 16, !tbaa !5
  %wide.load48.1 = load <8 x i8>, ptr %67, align 8, !tbaa !5
  %68 = xor <8 x i8> %wide.load47.1, %wide.load45.1
  %69 = xor <8 x i8> %wide.load48.1, %wide.load46.1
  store <8 x i8> %68, ptr %66, align 16, !tbaa !5
  store <8 x i8> %69, ptr %67, align 8, !tbaa !5
  %70 = icmp eq i64 %n.vec41, 32
  br i1 %70, label %middle.block36, label %vector.body43.2, !llvm.loop !13

vector.body43.2:                                  ; preds = %vector.body43.1
  %71 = getelementptr inbounds i8, ptr %.022, i64 40
  %wide.load45.2 = load <8 x i8>, ptr %.022.sroa.phi75, align 1, !tbaa !5
  %wide.load46.2 = load <8 x i8>, ptr %71, align 1, !tbaa !5
  %72 = getelementptr inbounds i8, ptr %4, i64 32
  %73 = getelementptr inbounds i8, ptr %4, i64 40
  %wide.load47.2 = load <8 x i8>, ptr %72, align 16, !tbaa !5
  %wide.load48.2 = load <8 x i8>, ptr %73, align 8, !tbaa !5
  %74 = xor <8 x i8> %wide.load47.2, %wide.load45.2
  %75 = xor <8 x i8> %wide.load48.2, %wide.load46.2
  store <8 x i8> %74, ptr %72, align 16, !tbaa !5
  store <8 x i8> %75, ptr %73, align 8, !tbaa !5
  %76 = icmp eq i64 %n.vec41, 48
  br i1 %76, label %middle.block36, label %vector.body43.3, !llvm.loop !13

vector.body43.3:                                  ; preds = %vector.body43.2
  %77 = getelementptr inbounds i8, ptr %.022, i64 56
  %wide.load45.3 = load <8 x i8>, ptr %.022.sroa.phi78, align 1, !tbaa !5
  %wide.load46.3 = load <8 x i8>, ptr %77, align 1, !tbaa !5
  %78 = getelementptr inbounds i8, ptr %4, i64 48
  %79 = getelementptr inbounds i8, ptr %4, i64 56
  %wide.load47.3 = load <8 x i8>, ptr %78, align 16, !tbaa !5
  %wide.load48.3 = load <8 x i8>, ptr %79, align 8, !tbaa !5
  %80 = xor <8 x i8> %wide.load47.3, %wide.load45.3
  %81 = xor <8 x i8> %wide.load48.3, %wide.load46.3
  store <8 x i8> %80, ptr %78, align 16, !tbaa !5
  store <8 x i8> %81, ptr %79, align 8, !tbaa !5
  %82 = icmp eq i64 %n.vec41, 64
  br i1 %82, label %middle.block36, label %vector.body43.4, !llvm.loop !13

vector.body43.4:                                  ; preds = %vector.body43.3
  %83 = getelementptr inbounds i8, ptr %.022, i64 72
  %wide.load45.4 = load <8 x i8>, ptr %.022.sroa.phi81, align 1, !tbaa !5
  %wide.load46.4 = load <8 x i8>, ptr %83, align 1, !tbaa !5
  %84 = getelementptr inbounds i8, ptr %4, i64 64
  %85 = getelementptr inbounds i8, ptr %4, i64 72
  %wide.load47.4 = load <8 x i8>, ptr %84, align 16, !tbaa !5
  %wide.load48.4 = load <8 x i8>, ptr %85, align 8, !tbaa !5
  %86 = xor <8 x i8> %wide.load47.4, %wide.load45.4
  %87 = xor <8 x i8> %wide.load48.4, %wide.load46.4
  store <8 x i8> %86, ptr %84, align 16, !tbaa !5
  store <8 x i8> %87, ptr %85, align 8, !tbaa !5
  %88 = icmp eq i64 %n.vec41, 80
  br i1 %88, label %middle.block36, label %vector.body43.5, !llvm.loop !13

vector.body43.5:                                  ; preds = %vector.body43.4
  %89 = getelementptr inbounds i8, ptr %.022, i64 88
  %wide.load45.5 = load <8 x i8>, ptr %.022.sroa.phi84, align 1, !tbaa !5
  %wide.load46.5 = load <8 x i8>, ptr %89, align 1, !tbaa !5
  %90 = getelementptr inbounds i8, ptr %4, i64 80
  %91 = getelementptr inbounds i8, ptr %4, i64 88
  %wide.load47.5 = load <8 x i8>, ptr %90, align 16, !tbaa !5
  %wide.load48.5 = load <8 x i8>, ptr %91, align 8, !tbaa !5
  %92 = xor <8 x i8> %wide.load47.5, %wide.load45.5
  %93 = xor <8 x i8> %wide.load48.5, %wide.load46.5
  store <8 x i8> %92, ptr %90, align 16, !tbaa !5
  store <8 x i8> %93, ptr %91, align 8, !tbaa !5
  %94 = icmp eq i64 %n.vec41, 96
  br i1 %94, label %middle.block36, label %vector.body43.6, !llvm.loop !13

vector.body43.6:                                  ; preds = %vector.body43.5
  %95 = getelementptr inbounds i8, ptr %.022, i64 104
  %wide.load45.6 = load <8 x i8>, ptr %.022.sroa.phi87, align 1, !tbaa !5
  %wide.load46.6 = load <8 x i8>, ptr %95, align 1, !tbaa !5
  %96 = getelementptr inbounds i8, ptr %4, i64 96
  %97 = getelementptr inbounds i8, ptr %4, i64 104
  %wide.load47.6 = load <8 x i8>, ptr %96, align 16, !tbaa !5
  %wide.load48.6 = load <8 x i8>, ptr %97, align 8, !tbaa !5
  %98 = xor <8 x i8> %wide.load47.6, %wide.load45.6
  %99 = xor <8 x i8> %wide.load48.6, %wide.load46.6
  store <8 x i8> %98, ptr %96, align 16, !tbaa !5
  store <8 x i8> %99, ptr %97, align 8, !tbaa !5
  br label %middle.block36

middle.block36:                                   ; preds = %vector.body43.6, %vector.body43.5, %vector.body43.4, %vector.body43.3, %vector.body43.2, %vector.body43.1, %vector.ph39
  %cmp.n50 = icmp eq i64 %.023, %n.vec41
  br i1 %cmp.n50, label %._crit_edge30, label %.lr.ph29.preheader51

.lr.ph29.preheader51:                             ; preds = %middle.block36, %.lr.ph29.preheader
  %.127.ph = phi i64 [ 0, %.lr.ph29.preheader ], [ %n.vec41, %middle.block36 ]
  br label %.lr.ph29

.lr.ph29:                                         ; preds = %.lr.ph29.preheader51, %.lr.ph29
  %.127 = phi i64 [ %105, %.lr.ph29 ], [ %.127.ph, %.lr.ph29.preheader51 ]
  %100 = getelementptr inbounds i8, ptr %.022, i64 %.127
  %101 = load i8, ptr %100, align 1, !tbaa !5
  %102 = getelementptr inbounds [64 x i8], ptr %4, i64 0, i64 %.127
  %103 = load i8, ptr %102, align 1, !tbaa !5
  %104 = xor i8 %103, %101
  store i8 %104, ptr %102, align 1, !tbaa !5
  %105 = add nuw nsw i64 %.127, 1
  %exitcond32.not = icmp eq i64 %105, %.023
  br i1 %exitcond32.not, label %._crit_edge30, label %.lr.ph29, !llvm.loop !14

._crit_edge30:                                    ; preds = %.lr.ph29, %middle.block36, %._crit_edge
  %106 = call i32 @SHA256_Update(ptr noundef nonnull %59, ptr noundef nonnull %4, i64 noundef 64)
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #4
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %4) #4
  ret void
}

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

declare i32 @SHA256_Init(ptr noundef) local_unnamed_addr #2

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

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

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

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

attributes #0 = { mustprogress 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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++ TBAA"}
!8 = distinct !{!8, !9, !10, !11}
!9 = !{!"llvm.loop.mustprogress"}
!10 = !{!"llvm.loop.isvectorized", i32 1}
!11 = !{!"llvm.loop.unroll.runtime.disable"}
!12 = distinct !{!12, !9, !11, !10}
!13 = distinct !{!13, !9, !10, !11}
!14 = distinct !{!14, !9, !11, !10}


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