; LLVM IR from albertobsd/keyhunt :: hash/sha512.ll (Z18pbkdf2_hmac_sha512PhmPKhmS1_mm)

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

%class.CSHA512 = type { [8 x i64], [128 x i8], i64, i64 }

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7CSHA5125WriteEPKhm(ptr noundef nonnull align 8 dereferenceable(208), ptr noundef, i64 noundef) #0 align 2

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN7CSHA51213WriteDirect64EPKh(ptr noundef nonnull align 8 dereferenceable(208), ptr noundef) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7CSHA5128FinalizeEPh(ptr noundef nonnull align 8 dereferenceable(208), ptr noundef) #0 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z16hmac_sha512_initR7CSHA512PKh(ptr noundef nonnull align 8 dereferenceable(208), ptr noundef) #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z16hmac_sha512_doneR7CSHA512PKhPh(ptr noundef nonnull align 8 dereferenceable(208), ptr noundef, ptr noundef) #0

; Function Attrs: mustprogress uwtable
define dso_local void @_Z18pbkdf2_hmac_sha512PhmPKhmS1_mm(ptr noundef %0, i64 noundef %1, ptr noundef %2, i64 noundef %3, ptr noundef %4, i64 noundef %5, i64 noundef %6) #0 {
  %8 = alloca ptr, align 8
  %9 = alloca i64, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i64, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca %class.CSHA512, align 8
  %16 = alloca %class.CSHA512, align 8
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i64, align 8
  %20 = alloca i32, align 4
  %21 = alloca [128 x i8], align 16
  %22 = alloca [64 x i8], align 16
  %23 = alloca [64 x i8], align 16
  %24 = alloca ptr, align 8
  %25 = alloca ptr, align 8
  %26 = alloca i64, align 8
  store ptr %0, ptr %8, align 8, !tbaa !5
  store i64 %1, ptr %9, align 8, !tbaa !9
  store ptr %2, ptr %10, align 8, !tbaa !5
  store i64 %3, ptr %11, align 8, !tbaa !9
  store ptr %4, ptr %12, align 8, !tbaa !5
  store i64 %5, ptr %13, align 8, !tbaa !9
  store i64 %6, ptr %14, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 208, ptr %15) #6
  call void @_ZN7CSHA512C1Ev(ptr noundef nonnull align 8 dereferenceable(208) %15)
  call void @llvm.lifetime.start.p0(i64 208, ptr %16) #6
  call void @_ZN7CSHA512C1Ev(ptr noundef nonnull align 8 dereferenceable(208) %16)
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #6
  call void @llvm.lifetime.start.p0(i64 128, ptr %21) #6
  call void @llvm.lifetime.start.p0(i64 64, ptr %22) #6
  call void @llvm.lifetime.start.p0(i64 64, ptr %23) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #6
  %27 = getelementptr inbounds [64 x i8], ptr %22, i64 0, i64 0
  store ptr %27, ptr %24, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #6
  %28 = getelementptr inbounds [64 x i8], ptr %23, i64 0, i64 0
  store ptr %28, ptr %25, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #6
  %29 = load i64, ptr %11, align 8, !tbaa !9
  %30 = icmp ult i64 %29, 128
  br i1 %30, label %31, label %40

31:                                               ; preds = %7
  %32 = getelementptr inbounds [128 x i8], ptr %21, i64 0, i64 0
  %33 = load ptr, ptr %10, align 8, !tbaa !5
  %34 = load i64, ptr %11, align 8, !tbaa !9
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %32, ptr align 1 %33, i64 %34, i1 false)
  %35 = getelementptr inbounds [128 x i8], ptr %21, i64 0, i64 0
  %36 = load i64, ptr %11, align 8, !tbaa !9
  %37 = getelementptr inbounds i8, ptr %35, i64 %36
  %38 = load i64, ptr %11, align 8, !tbaa !9
  %39 = sub i64 128, %38
  call void @llvm.memset.p0.i64(ptr align 1 %37, i8 0, i64 %39, i1 false)
  br label %46

40:                                               ; preds = %7
  %41 = load ptr, ptr %10, align 8, !tbaa !5
  %42 = load i64, ptr %11, align 8, !tbaa !9
  call void @_ZN7CSHA5125WriteEPKhm(ptr noundef nonnull align 8 dereferenceable(208) %15, ptr noundef %41, i64 noundef %42)
  %43 = getelementptr inbounds [128 x i8], ptr %21, i64 0, i64 0
  call void @_ZN7CSHA5128FinalizeEPh(ptr noundef nonnull align 8 dereferenceable(208) %15, ptr noundef %43)
  %44 = getelementptr inbounds [128 x i8], ptr %21, i64 0, i64 0
  %45 = getelementptr inbounds i8, ptr %44, i64 64
  call void @llvm.memset.p0.i64(ptr align 1 %45, i8 0, i64 64, i1 false)
  br label %46

46:                                               ; preds = %40, %31
  %47 = getelementptr inbounds [128 x i8], ptr %21, i64 0, i64 0
  call void @_Z16hmac_sha512_initR7CSHA512PKh(ptr noundef nonnull align 8 dereferenceable(208) %16, ptr noundef %47)
  %48 = load ptr, ptr %12, align 8, !tbaa !5
  %49 = load i64, ptr %13, align 8, !tbaa !9
  call void @_ZN7CSHA5125WriteEPKhm(ptr noundef nonnull align 8 dereferenceable(208) %16, ptr noundef %48, i64 noundef %49)
  store i32 1, ptr %17, align 4, !tbaa !11
  br label %50

50:                                               ; preds = %108, %46
  %51 = load i64, ptr %9, align 8, !tbaa !9
  %52 = icmp ugt i64 %51, 0
  br i1 %52, label %53, label %111

53:                                               ; preds = %50
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %15, ptr align 8 %16, i64 208, i1 false), !tbaa.struct !13
  %54 = load i32, ptr %17, align 4, !tbaa !11
  %55 = call i32 @llvm.bswap.i32(i32 %54)
  store i32 %55, ptr %18, align 4, !tbaa !11
  call void @_ZN7CSHA5125WriteEPKhm(ptr noundef nonnull align 8 dereferenceable(208) %15, ptr noundef %18, i64 noundef 4)
  %56 = getelementptr inbounds [128 x i8], ptr %21, i64 0, i64 0
  %57 = getelementptr inbounds [64 x i8], ptr %23, i64 0, i64 0
  call void @_Z16hmac_sha512_doneR7CSHA512PKhPh(ptr noundef nonnull align 8 dereferenceable(208) %15, ptr noundef %56, ptr noundef %57)
  %58 = getelementptr inbounds [64 x i8], ptr %22, i64 0, i64 0
  %59 = getelementptr inbounds [64 x i8], ptr %23, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %58, ptr align 16 %59, i64 64, i1 false)
  store i64 2, ptr %19, align 8, !tbaa !9
  br label %60

60:                                               ; preds = %88, %53
  %61 = load i64, ptr %19, align 8, !tbaa !9
  %62 = load i64, ptr %14, align 8, !tbaa !9
  %63 = icmp ule i64 %61, %62
  br i1 %63, label %64, label %91

64:                                               ; preds = %60
  %65 = getelementptr inbounds [128 x i8], ptr %21, i64 0, i64 0
  call void @_Z16hmac_sha512_initR7CSHA512PKh(ptr noundef nonnull align 8 dereferenceable(208) %15, ptr noundef %65)
  %66 = getelementptr inbounds [64 x i8], ptr %23, i64 0, i64 0
  call void @_ZN7CSHA51213WriteDirect64EPKh(ptr noundef nonnull align 8 dereferenceable(208) %15, ptr noundef %66)
  %67 = getelementptr inbounds [128 x i8], ptr %21, i64 0, i64 0
  %68 = getelementptr inbounds [64 x i8], ptr %23, i64 0, i64 0
  call void @_Z16hmac_sha512_doneR7CSHA512PKhPh(ptr noundef nonnull align 8 dereferenceable(208) %15, ptr noundef %67, ptr noundef %68)
  store i32 0, ptr %20, align 4, !tbaa !11
  br label %69

69:                                               ; preds = %84, %64
  %70 = load i32, ptr %20, align 4, !tbaa !11
  %71 = icmp slt i32 %70, 8
  br i1 %71, label %72, label %87

72:                                               ; preds = %69
  %73 = load ptr, ptr %25, align 8, !tbaa !5
  %74 = load i32, ptr %20, align 4, !tbaa !11
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds i64, ptr %73, i64 %75
  %77 = load i64, ptr %76, align 8, !tbaa !9
  %78 = load ptr, ptr %24, align 8, !tbaa !5
  %79 = load i32, ptr %20, align 4, !tbaa !11
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds i64, ptr %78, i64 %80
  %82 = load i64, ptr %81, align 8, !tbaa !9
  %83 = xor i64 %82, %77
  store i64 %83, ptr %81, align 8, !tbaa !9
  br label %84

84:                                               ; preds = %72
  %85 = load i32, ptr %20, align 4, !tbaa !11
  %86 = add nsw i32 %85, 1
  store i32 %86, ptr %20, align 4, !tbaa !11
  br label %69, !llvm.loop !15

87:                                               ; preds = %69
  br label %88

88:                                               ; preds = %87
  %89 = load i64, ptr %19, align 8, !tbaa !9
  %90 = add i64 %89, 1
  store i64 %90, ptr %19, align 8, !tbaa !9
  br label %60, !llvm.loop !17

91:                                               ; preds = %60
  %92 = load i64, ptr %9, align 8, !tbaa !9
  %93 = icmp ult i64 64, %92
  br i1 %93, label %94, label %95

94:                                               ; preds = %91
  br label %97

95:                                               ; preds = %91
  %96 = load i64, ptr %9, align 8, !tbaa !9
  br label %97

97:                                               ; preds = %95, %94
  %98 = phi i64 [ 64, %94 ], [ %96, %95 ]
  store i64 %98, ptr %26, align 8, !tbaa !9
  %99 = load ptr, ptr %8, align 8, !tbaa !5
  %100 = getelementptr inbounds [64 x i8], ptr %22, i64 0, i64 0
  %101 = load i64, ptr %26, align 8, !tbaa !9
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %99, ptr align 16 %100, i64 %101, i1 false)
  %102 = load i64, ptr %26, align 8, !tbaa !9
  %103 = load ptr, ptr %8, align 8, !tbaa !5
  %104 = getelementptr inbounds i8, ptr %103, i64 %102
  store ptr %104, ptr %8, align 8, !tbaa !5
  %105 = load i64, ptr %26, align 8, !tbaa !9
  %106 = load i64, ptr %9, align 8, !tbaa !9
  %107 = sub i64 %106, %105
  store i64 %107, ptr %9, align 8, !tbaa !9
  br label %108

108:                                              ; preds = %97
  %109 = load i32, ptr %17, align 4, !tbaa !11
  %110 = add i32 %109, 1
  store i32 %110, ptr %17, align 4, !tbaa !11
  br label %50, !llvm.loop !18

111:                                              ; preds = %50
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #6
  call void @llvm.lifetime.end.p0(i64 64, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 64, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 128, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 208, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 208, ptr %15) #6
  ret void
}

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.bswap.i32(i32) #5

declare void @_ZN7CSHA512C1Ev(ptr)

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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress 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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { 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 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{i64 0, i64 64, !14, i64 64, i64 128, !14, i64 192, i64 8, !9, i64 200, i64 8, !9}
!14 = !{!7, !7, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}
!18 = distinct !{!18, !16}


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

%class.CSHA512 = type { [8 x i64], [128 x i8], i64, i64 }

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7CSHA5125WriteEPKhm(ptr noundef nonnull align 8 dereferenceable(208), ptr noundef, i64 noundef) local_unnamed_addr #0 align 2

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN7CSHA51213WriteDirect64EPKh(ptr noundef nonnull align 8 dereferenceable(208), ptr noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7CSHA5128FinalizeEPh(ptr noundef nonnull align 8 dereferenceable(208), ptr noundef) local_unnamed_addr #0 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z16hmac_sha512_initR7CSHA512PKh(ptr noundef nonnull align 8 dereferenceable(208), ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z16hmac_sha512_doneR7CSHA512PKhPh(ptr noundef nonnull align 8 dereferenceable(208), ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local void @_Z18pbkdf2_hmac_sha512PhmPKhmS1_mm(ptr nocapture noundef writeonly %0, i64 noundef %1, ptr noundef %2, i64 noundef %3, ptr noundef %4, i64 noundef %5, i64 noundef %6) local_unnamed_addr #0 {
  %8 = alloca %class.CSHA512, align 8
  %9 = alloca %class.CSHA512, align 8
  %10 = alloca i32, align 4
  %11 = alloca [128 x i8], align 16
  %12 = alloca [64 x i8], align 16
  %13 = alloca [64 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 208, ptr nonnull %8) #7
  call void @_ZN7CSHA512C1Ev(ptr noundef nonnull align 8 dereferenceable(208) %8)
  call void @llvm.lifetime.start.p0(i64 208, ptr nonnull %9) #7
  call void @_ZN7CSHA512C1Ev(ptr noundef nonnull align 8 dereferenceable(208) %9)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #7
  call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %11) #7
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %12)
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %13) #7
  %14 = icmp ult i64 %3, 128
  br i1 %14, label %15, label %18

15:                                               ; preds = %7
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 16 %11, ptr align 1 %2, i64 %3, i1 false)
  %16 = getelementptr inbounds i8, ptr %11, i64 %3
  %17 = sub nuw nsw i64 128, %3
  call void @llvm.memset.p0.i64(ptr nonnull align 1 %16, i8 0, i64 %17, i1 false)
  br label %20

18:                                               ; preds = %7
  call void @_ZN7CSHA5125WriteEPKhm(ptr noundef nonnull align 8 dereferenceable(208) %8, ptr noundef %2, i64 noundef %3)
  call void @_ZN7CSHA5128FinalizeEPh(ptr noundef nonnull align 8 dereferenceable(208) %8, ptr noundef nonnull %11)
  %19 = getelementptr inbounds i8, ptr %11, i64 64
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(64) %19, i8 0, i64 64, i1 false)
  br label %20

20:                                               ; preds = %18, %15
  call void @_Z16hmac_sha512_initR7CSHA512PKh(ptr noundef nonnull align 8 dereferenceable(208) %9, ptr noundef nonnull %11)
  call void @_ZN7CSHA5125WriteEPKhm(ptr noundef nonnull align 8 dereferenceable(208) %9, ptr noundef %4, i64 noundef %5)
  %.not37 = icmp eq i64 %1, 0
  br i1 %.not37, label %._crit_edge43, label %.lr.ph42

.lr.ph42:                                         ; preds = %20
  %.not3335 = icmp ult i64 %6, 2
  br i1 %.not3335, label %.lr.ph42.split.us, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %.lr.ph42
  %21 = getelementptr inbounds i8, ptr %13, i64 16
  %22 = getelementptr inbounds i8, ptr %13, i64 32
  %23 = getelementptr inbounds i8, ptr %13, i64 48
  %.16.sroa_idx81 = getelementptr inbounds i8, ptr %12, i64 16
  %.32.sroa_idx82 = getelementptr inbounds i8, ptr %12, i64 32
  %.48.sroa_idx83 = getelementptr inbounds i8, ptr %12, i64 48
  %.16.sroa_idx = getelementptr inbounds i8, ptr %12, i64 16
  %.32.sroa_idx = getelementptr inbounds i8, ptr %12, i64 32
  %.48.sroa_idx = getelementptr inbounds i8, ptr %12, i64 48
  br label %.lr.ph

.lr.ph42.split.us:                                ; preds = %.lr.ph42, %.lr.ph42.split.us
  %.040.us = phi ptr [ %26, %.lr.ph42.split.us ], [ %0, %.lr.ph42 ]
  %.02839.us = phi i64 [ %27, %.lr.ph42.split.us ], [ %1, %.lr.ph42 ]
  %.02938.us = phi i32 [ %28, %.lr.ph42.split.us ], [ 1, %.lr.ph42 ]
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(208) %8, ptr noundef nonnull align 8 dereferenceable(208) %9, i64 208, i1 false), !tbaa.struct !5
  %24 = call i32 @llvm.bswap.i32(i32 %.02938.us)
  store i32 %24, ptr %10, align 4, !tbaa !11
  call void @_ZN7CSHA5125WriteEPKhm(ptr noundef nonnull align 8 dereferenceable(208) %8, ptr noundef nonnull %10, i64 noundef 4)
  call void @_Z16hmac_sha512_doneR7CSHA512PKhPh(ptr noundef nonnull align 8 dereferenceable(208) %8, ptr noundef nonnull %11, ptr noundef nonnull %13)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(64) %12, ptr noundef nonnull align 16 dereferenceable(64) %13, i64 64, i1 false)
  %25 = call i64 @llvm.umin.i64(i64 %.02839.us, i64 64)
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %.040.us, ptr nonnull align 16 %12, i64 %25, i1 false)
  %26 = getelementptr inbounds i8, ptr %.040.us, i64 %25
  %27 = sub i64 %.02839.us, %25
  %28 = add i32 %.02938.us, 1
  %.not.us = icmp eq i64 %27, 0
  br i1 %.not.us, label %._crit_edge43, label %.lr.ph42.split.us, !llvm.loop !13

.lr.ph:                                           ; preds = %.lr.ph.preheader, %._crit_edge
  %.040 = phi ptr [ %45, %._crit_edge ], [ %0, %.lr.ph.preheader ]
  %.02839 = phi i64 [ %46, %._crit_edge ], [ %1, %.lr.ph.preheader ]
  %.02938 = phi i32 [ %47, %._crit_edge ], [ 1, %.lr.ph.preheader ]
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(208) %8, ptr noundef nonnull align 8 dereferenceable(208) %9, i64 208, i1 false), !tbaa.struct !5
  %29 = call i32 @llvm.bswap.i32(i32 %.02938)
  store i32 %29, ptr %10, align 4, !tbaa !11
  call void @_ZN7CSHA5125WriteEPKhm(ptr noundef nonnull align 8 dereferenceable(208) %8, ptr noundef nonnull %10, i64 noundef 4)
  call void @_Z16hmac_sha512_doneR7CSHA512PKhPh(ptr noundef nonnull align 8 dereferenceable(208) %8, ptr noundef nonnull %11, ptr noundef nonnull %13)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(64) %12, ptr noundef nonnull align 16 dereferenceable(64) %13, i64 64, i1 false)
  %.0. = load <2 x i64>, ptr %12, align 16, !tbaa !9
  %.16. = load <2 x i64>, ptr %.16.sroa_idx81, align 16, !tbaa !9
  %.32. = load <2 x i64>, ptr %.32.sroa_idx82, align 16, !tbaa !9
  %.48. = load <2 x i64>, ptr %.48.sroa_idx83, align 16, !tbaa !9
  br label %30

30:                                               ; preds = %.lr.ph, %30
  %.03136 = phi i64 [ 2, %.lr.ph ], [ %43, %30 ]
  %31 = phi <2 x i64> [ %.0., %.lr.ph ], [ %36, %30 ]
  %32 = phi <2 x i64> [ %.16., %.lr.ph ], [ %38, %30 ]
  %33 = phi <2 x i64> [ %.32., %.lr.ph ], [ %40, %30 ]
  %34 = phi <2 x i64> [ %.48., %.lr.ph ], [ %42, %30 ]
  call void @_Z16hmac_sha512_initR7CSHA512PKh(ptr noundef nonnull align 8 dereferenceable(208) %8, ptr noundef nonnull %11)
  call void @_ZN7CSHA51213WriteDirect64EPKh(ptr noundef nonnull align 8 dereferenceable(208) %8, ptr noundef nonnull %13)
  call void @_Z16hmac_sha512_doneR7CSHA512PKhPh(ptr noundef nonnull align 8 dereferenceable(208) %8, ptr noundef nonnull %11, ptr noundef nonnull %13)
  %35 = load <2 x i64>, ptr %13, align 16, !tbaa !9
  %36 = xor <2 x i64> %31, %35
  %37 = load <2 x i64>, ptr %21, align 16, !tbaa !9
  %38 = xor <2 x i64> %32, %37
  %39 = load <2 x i64>, ptr %22, align 16, !tbaa !9
  %40 = xor <2 x i64> %33, %39
  %41 = load <2 x i64>, ptr %23, align 16, !tbaa !9
  %42 = xor <2 x i64> %34, %41
  %43 = add i64 %.03136, 1
  %.not33 = icmp ugt i64 %43, %6
  br i1 %.not33, label %._crit_edge, label %30, !llvm.loop !15

._crit_edge:                                      ; preds = %30
  store <2 x i64> %36, ptr %12, align 16, !tbaa !9
  store <2 x i64> %38, ptr %.16.sroa_idx, align 16, !tbaa !9
  store <2 x i64> %40, ptr %.32.sroa_idx, align 16, !tbaa !9
  store <2 x i64> %42, ptr %.48.sroa_idx, align 16, !tbaa !9
  %44 = call i64 @llvm.umin.i64(i64 %.02839, i64 64)
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %.040, ptr nonnull align 16 %12, i64 %44, i1 false)
  %45 = getelementptr inbounds i8, ptr %.040, i64 %44
  %46 = sub i64 %.02839, %44
  %47 = add i32 %.02938, 1
  %.not = icmp eq i64 %46, 0
  br i1 %.not, label %._crit_edge43, label %.lr.ph, !llvm.loop !13

._crit_edge43:                                    ; preds = %._crit_edge, %.lr.ph42.split.us, %20
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %13) #7
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %12)
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %11) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 208, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 208, ptr nonnull %8) #7
  ret void
}

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.bswap.i32(i32) #5

declare void @_ZN7CSHA512C1Ev(ptr) local_unnamed_addr

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.umin.i64(i64, i64) #6

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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { 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 = !{i64 0, i64 64, !6, i64 64, i64 128, !6, i64 192, i64 8, !9, i64 200, i64 8, !9}
!6 = !{!7, !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}


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