; LLVM IR from guanzhi/GmSSL :: src (hmac)

; 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_ctx_st = type { ptr, %struct.DIGEST_CTX, %struct.DIGEST_CTX, %struct.DIGEST_CTX }
%struct.DIGEST_CTX = type { %union.anon, ptr }
%union.anon = type { %struct.SM3_CTX }
%struct.SM3_CTX = type { [8 x i32], i64, [64 x i8], i64 }
%struct.DIGEST = type { i32, i64, i64, i64, ptr, ptr, ptr }

@stderr = external global ptr, align 8
@.str = external hidden unnamed_addr constant [13 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [58 x i8], align 1
@__FUNCTION__.hmac_init = external hidden unnamed_addr constant [10 x i8], align 1

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

17:                                               ; preds = %4
  %18 = load ptr, ptr %7, align 8, !tbaa !5
  %19 = icmp ne ptr %18, null
  br i1 %19, label %20, label %26

20:                                               ; preds = %17
  %21 = load ptr, ptr %8, align 8, !tbaa !5
  %22 = icmp ne ptr %21, null
  br i1 %22, label %23, label %26

23:                                               ; preds = %20
  %24 = load i64, ptr %9, align 8, !tbaa !9
  %25 = icmp ne i64 %24, 0
  br i1 %25, label %32, label %26

26:                                               ; preds = %23, %20, %17, %4
  br label %27

27:                                               ; preds = %26
  %28 = load ptr, ptr @stderr, align 8, !tbaa !5
  %29 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %28, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 28, ptr noundef @__FUNCTION__.hmac_init) #6
  br label %30

30:                                               ; preds = %27
  br label %31

31:                                               ; preds = %30
  store i32 -1, ptr %5, align 4
  store i32 1, ptr %14, align 4
  br label %112

32:                                               ; preds = %23
  %33 = load ptr, ptr %7, align 8, !tbaa !5
  %34 = load ptr, ptr %6, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.hmac_ctx_st, ptr %34, i32 0, i32 0
  store ptr %33, ptr %35, align 8, !tbaa !11
  %36 = load ptr, ptr %7, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.DIGEST, ptr %36, i32 0, i32 2
  %38 = load i64, ptr %37, align 8, !tbaa !14
  store i64 %38, ptr %12, align 8, !tbaa !9
  %39 = load i64, ptr %9, align 8, !tbaa !9
  %40 = load i64, ptr %12, align 8, !tbaa !9
  %41 = icmp ule i64 %39, %40
  br i1 %41, label %42, label %49

42:                                               ; preds = %32
  %43 = getelementptr inbounds [128 x i8], ptr %10, i64 0, i64 0
  %44 = load ptr, ptr %8, align 8, !tbaa !5
  %45 = load i64, ptr %9, align 8, !tbaa !9
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %43, ptr align 1 %44, i64 %45, i1 false)
  %46 = getelementptr inbounds [128 x i8], ptr %11, i64 0, i64 0
  %47 = load ptr, ptr %8, align 8, !tbaa !5
  %48 = load i64, ptr %9, align 8, !tbaa !9
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %46, ptr align 1 %47, i64 %48, i1 false)
  br label %66

49:                                               ; preds = %32
  %50 = load ptr, ptr %6, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.hmac_ctx_st, ptr %50, i32 0, i32 1
  %52 = load ptr, ptr %7, align 8, !tbaa !5
  %53 = call i32 @digest_init(ptr noundef %51, ptr noundef %52)
  %54 = load ptr, ptr %6, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.hmac_ctx_st, ptr %54, i32 0, i32 1
  %56 = load ptr, ptr %8, align 8, !tbaa !5
  %57 = load i64, ptr %9, align 8, !tbaa !9
  %58 = call i32 @digest_update(ptr noundef %55, ptr noundef %56, i64 noundef %57)
  %59 = load ptr, ptr %6, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.hmac_ctx_st, ptr %59, i32 0, i32 1
  %61 = getelementptr inbounds [128 x i8], ptr %10, i64 0, i64 0
  %62 = call i32 @digest_finish(ptr noundef %60, ptr noundef %61, ptr noundef %9)
  %63 = getelementptr inbounds [128 x i8], ptr %11, i64 0, i64 0
  %64 = getelementptr inbounds [128 x i8], ptr %10, i64 0, i64 0
  %65 = load i64, ptr %9, align 8, !tbaa !9
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %63, ptr align 16 %64, i64 %65, i1 false)
  br label %66

66:                                               ; preds = %49, %42
  store i64 0, ptr %13, align 8, !tbaa !9
  br label %67

67:                                               ; preds = %84, %66
  %68 = load i64, ptr %13, align 8, !tbaa !9
  %69 = load i64, ptr %12, align 8, !tbaa !9
  %70 = icmp ult i64 %68, %69
  br i1 %70, label %71, label %87

71:                                               ; preds = %67
  %72 = load i64, ptr %13, align 8, !tbaa !9
  %73 = getelementptr inbounds [128 x i8], ptr %10, i64 0, i64 %72
  %74 = load i8, ptr %73, align 1, !tbaa !17
  %75 = zext i8 %74 to i32
  %76 = xor i32 %75, 54
  %77 = trunc i32 %76 to i8
  store i8 %77, ptr %73, align 1, !tbaa !17
  %78 = load i64, ptr %13, align 8, !tbaa !9
  %79 = getelementptr inbounds [128 x i8], ptr %11, i64 0, i64 %78
  %80 = load i8, ptr %79, align 1, !tbaa !17
  %81 = zext i8 %80 to i32
  %82 = xor i32 %81, 92
  %83 = trunc i32 %82 to i8
  store i8 %83, ptr %79, align 1, !tbaa !17
  br label %84

84:                                               ; preds = %71
  %85 = load i64, ptr %13, align 8, !tbaa !9
  %86 = add i64 %85, 1
  store i64 %86, ptr %13, align 8, !tbaa !9
  br label %67, !llvm.loop !18

87:                                               ; preds = %67
  %88 = load ptr, ptr %6, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.hmac_ctx_st, ptr %88, i32 0, i32 2
  %90 = load ptr, ptr %7, align 8, !tbaa !5
  %91 = call i32 @digest_init(ptr noundef %89, ptr noundef %90)
  %92 = load ptr, ptr %6, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.hmac_ctx_st, ptr %92, i32 0, i32 2
  %94 = getelementptr inbounds [128 x i8], ptr %10, i64 0, i64 0
  %95 = load i64, ptr %12, align 8, !tbaa !9
  %96 = call i32 @digest_update(ptr noundef %93, ptr noundef %94, i64 noundef %95)
  %97 = load ptr, ptr %6, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.hmac_ctx_st, ptr %97, i32 0, i32 3
  %99 = load ptr, ptr %7, align 8, !tbaa !5
  %100 = call i32 @digest_init(ptr noundef %98, ptr noundef %99)
  %101 = load ptr, ptr %6, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.hmac_ctx_st, ptr %101, i32 0, i32 3
  %103 = getelementptr inbounds [128 x i8], ptr %11, i64 0, i64 0
  %104 = load i64, ptr %12, align 8, !tbaa !9
  %105 = call i32 @digest_update(ptr noundef %102, ptr noundef %103, i64 noundef %104)
  %106 = load ptr, ptr %6, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.hmac_ctx_st, ptr %106, i32 0, i32 1
  %108 = load ptr, ptr %6, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.hmac_ctx_st, ptr %108, i32 0, i32 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %107, ptr align 8 %109, i64 120, i1 false)
  %110 = getelementptr inbounds [128 x i8], ptr %10, i64 0, i64 0
  call void @llvm.memset.p0.i64(ptr align 16 %110, i8 0, i64 128, i1 false)
  %111 = getelementptr inbounds [128 x i8], ptr %11, i64 0, i64 0
  call void @llvm.memset.p0.i64(ptr align 16 %111, i8 0, i64 128, i1 false)
  store i32 1, ptr %5, align 4
  store i32 1, ptr %14, align 4
  br label %112

112:                                              ; preds = %87, %31
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 128, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 128, ptr %10) #6
  %113 = load i32, ptr %5, align 4
  ret i32 %113
}

; 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: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

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

; 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) #4

declare i32 @digest_init(ptr noundef, ptr noundef) #5

declare i32 @digest_update(ptr noundef, ptr noundef, i64 noundef) #5

declare i32 @digest_finish(ptr noundef, ptr noundef, ptr noundef) #5

; 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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { "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 #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/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !6, i64 0}
!12 = !{!"hmac_ctx_st", !6, i64 0, !13, i64 8, !13, i64 128, !13, i64 248}
!13 = !{!"DIGEST_CTX", !7, i64 0, !6, i64 112}
!14 = !{!15, !10, i64 16}
!15 = !{!"DIGEST", !16, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !6, i64 32, !6, i64 40, !6, i64 48}
!16 = !{!"int", !7, i64 0}
!17 = !{!7, !7, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"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"

@stderr = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [13 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [58 x i8], align 1
@__FUNCTION__.hmac_init = external hidden unnamed_addr constant [10 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local range(i32 -1, 2) i32 @hmac_init(ptr noundef %0, ptr noundef %1, ptr noundef %2, i64 noundef %3) local_unnamed_addr #0 {
  %5 = alloca i64, align 8
  %6 = alloca [128 x i8], align 16
  %7 = alloca [128 x i8], align 16
  store i64 %3, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %6) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(128) %6, i8 0, i64 128, i1 false)
  call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %7) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(128) %7, i8 0, i64 128, i1 false)
  %8 = icmp ne ptr %0, null
  %9 = icmp ne ptr %1, null
  %or.cond = and i1 %8, %9
  %10 = icmp ne ptr %2, null
  %or.cond3 = and i1 %or.cond, %10
  %11 = icmp ne i64 %3, 0
  %or.cond5 = and i1 %or.cond3, %11
  br i1 %or.cond5, label %15, label %12

12:                                               ; preds = %4
  %13 = load ptr, ptr @stderr, align 8, !tbaa !9
  %14 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %13, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 28, ptr noundef nonnull @__FUNCTION__.hmac_init) #7
  br label %52

15:                                               ; preds = %4
  store ptr %1, ptr %0, align 8, !tbaa !11
  %16 = getelementptr inbounds i8, ptr %1, i64 16
  %17 = load i64, ptr %16, align 8, !tbaa !14
  %.not = icmp ult i64 %17, %3
  br i1 %.not, label %18, label %.thread

.thread:                                          ; preds = %15
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 16 %6, ptr nonnull align 1 %2, i64 %3, i1 false)
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 16 %7, ptr nonnull align 1 %2, i64 %3, i1 false)
  br label %iter.check

18:                                               ; preds = %15
  %19 = getelementptr inbounds i8, ptr %0, i64 8
  %20 = tail call i32 @digest_init(ptr noundef nonnull %19, ptr noundef nonnull %1) #6
  %21 = tail call i32 @digest_update(ptr noundef nonnull %19, ptr noundef nonnull %2, i64 noundef %3) #6
  %22 = call i32 @digest_finish(ptr noundef nonnull %19, ptr noundef nonnull %6, ptr noundef nonnull %5) #6
  %23 = load i64, ptr %5, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 16 %7, ptr nonnull align 16 %6, i64 %23, i1 false)
  %.not41 = icmp eq i64 %17, 0
  br i1 %.not41, label %._crit_edge, label %iter.check

iter.check:                                       ; preds = %.thread, %18
  %min.iters.check = icmp ult i64 %17, 8
  br i1 %min.iters.check, label %.lr.ph.preheader, label %vector.main.loop.iter.check

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

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

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %24 = getelementptr inbounds [128 x i8], ptr %6, i64 0, i64 %index
  %25 = getelementptr inbounds i8, ptr %24, i64 16
  %wide.load = load <16 x i8>, ptr %24, align 16, !tbaa !17
  %wide.load44 = load <16 x i8>, ptr %25, align 16, !tbaa !17
  %26 = xor <16 x i8> %wide.load, <i8 54, i8 54, i8 54, i8 54, i8 54, i8 54, i8 54, i8 54, i8 54, i8 54, i8 54, i8 54, i8 54, i8 54, i8 54, i8 54>
  %27 = xor <16 x i8> %wide.load44, <i8 54, i8 54, i8 54, i8 54, i8 54, i8 54, i8 54, i8 54, i8 54, i8 54, i8 54, i8 54, i8 54, i8 54, i8 54, i8 54>
  store <16 x i8> %26, ptr %24, align 16, !tbaa !17
  store <16 x i8> %27, ptr %25, align 16, !tbaa !17
  %28 = getelementptr inbounds [128 x i8], ptr %7, i64 0, i64 %index
  %29 = getelementptr inbounds i8, ptr %28, i64 16
  %wide.load45 = load <16 x i8>, ptr %28, align 16, !tbaa !17
  %wide.load46 = load <16 x i8>, ptr %29, align 16, !tbaa !17
  %30 = xor <16 x i8> %wide.load45, <i8 92, i8 92, i8 92, i8 92, i8 92, i8 92, i8 92, i8 92, i8 92, i8 92, i8 92, i8 92, i8 92, i8 92, i8 92, i8 92>
  %31 = xor <16 x i8> %wide.load46, <i8 92, i8 92, i8 92, i8 92, i8 92, i8 92, i8 92, i8 92, i8 92, i8 92, i8 92, i8 92, i8 92, i8 92, i8 92, i8 92>
  store <16 x i8> %30, ptr %28, align 16, !tbaa !17
  store <16 x i8> %31, ptr %29, align 16, !tbaa !17
  %index.next = add nuw i64 %index, 32
  %32 = icmp eq i64 %index.next, %n.vec
  br i1 %32, label %middle.block, label %vector.body, !llvm.loop !18

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %17, %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 %17, 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.vec48 = and i64 %17, -8
  br label %vec.epilog.vector.body

vec.epilog.vector.body:                           ; preds = %vec.epilog.vector.body, %vec.epilog.ph
  %index49 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next52, %vec.epilog.vector.body ]
  %33 = getelementptr inbounds [128 x i8], ptr %6, i64 0, i64 %index49
  %wide.load50 = load <8 x i8>, ptr %33, align 8, !tbaa !17
  %34 = xor <8 x i8> %wide.load50, <i8 54, i8 54, i8 54, i8 54, i8 54, i8 54, i8 54, i8 54>
  store <8 x i8> %34, ptr %33, align 8, !tbaa !17
  %35 = getelementptr inbounds [128 x i8], ptr %7, i64 0, i64 %index49
  %wide.load51 = load <8 x i8>, ptr %35, align 8, !tbaa !17
  %36 = xor <8 x i8> %wide.load51, <i8 92, i8 92, i8 92, i8 92, i8 92, i8 92, i8 92, i8 92>
  store <8 x i8> %36, ptr %35, align 8, !tbaa !17
  %index.next52 = add nuw i64 %index49, 8
  %37 = icmp eq i64 %index.next52, %n.vec48
  br i1 %37, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !22

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

.lr.ph.preheader:                                 ; preds = %vec.epilog.middle.block, %iter.check, %vec.epilog.iter.check
  %.040.ph = phi i64 [ 0, %iter.check ], [ %n.vec, %vec.epilog.iter.check ], [ %n.vec48, %vec.epilog.middle.block ]
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %.040 = phi i64 [ %44, %.lr.ph ], [ %.040.ph, %.lr.ph.preheader ]
  %38 = getelementptr inbounds [128 x i8], ptr %6, i64 0, i64 %.040
  %39 = load i8, ptr %38, align 1, !tbaa !17
  %40 = xor i8 %39, 54
  store i8 %40, ptr %38, align 1, !tbaa !17
  %41 = getelementptr inbounds [128 x i8], ptr %7, i64 0, i64 %.040
  %42 = load i8, ptr %41, align 1, !tbaa !17
  %43 = xor i8 %42, 92
  store i8 %43, ptr %41, align 1, !tbaa !17
  %44 = add nuw i64 %.040, 1
  %exitcond.not = icmp eq i64 %44, %17
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !23

._crit_edge:                                      ; preds = %.lr.ph, %middle.block, %vec.epilog.middle.block, %18
  %45 = getelementptr inbounds i8, ptr %0, i64 128
  %46 = call i32 @digest_init(ptr noundef nonnull %45, ptr noundef nonnull %1) #6
  %47 = call i32 @digest_update(ptr noundef nonnull %45, ptr noundef nonnull %6, i64 noundef %17) #6
  %48 = getelementptr inbounds i8, ptr %0, i64 248
  %49 = call i32 @digest_init(ptr noundef nonnull %48, ptr noundef nonnull %1) #6
  %50 = call i32 @digest_update(ptr noundef nonnull %48, ptr noundef nonnull %7, i64 noundef %17) #6
  %51 = getelementptr inbounds i8, ptr %0, i64 8
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(120) %51, ptr noundef nonnull align 8 dereferenceable(120) %45, i64 120, i1 false)
  br label %52

52:                                               ; preds = %._crit_edge, %12
  %.034 = phi i32 [ 1, %._crit_edge ], [ -1, %12 ]
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %6) #6
  ret i32 %.034
}

; 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: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

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

; 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) #4

declare i32 @digest_init(ptr noundef, ptr noundef) local_unnamed_addr #5

declare i32 @digest_update(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #5

declare i32 @digest_finish(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #5

; 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { "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 #6 = { nounwind }
attributes #7 = { cold 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 = !{!"long", !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, !10, i64 0}
!12 = !{!"hmac_ctx_st", !10, i64 0, !13, i64 8, !13, i64 128, !13, i64 248}
!13 = !{!"DIGEST_CTX", !7, i64 0, !10, i64 112}
!14 = !{!15, !6, i64 16}
!15 = !{!"DIGEST", !16, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !10, i64 32, !10, i64 40, !10, i64 48}
!16 = !{!"int", !7, i64 0}
!17 = !{!7, !7, i64 0}
!18 = distinct !{!18, !19, !20, !21}
!19 = !{!"llvm.loop.mustprogress"}
!20 = !{!"llvm.loop.isvectorized", i32 1}
!21 = !{!"llvm.loop.unroll.runtime.disable"}
!22 = distinct !{!22, !19, !20, !21}
!23 = distinct !{!23, !19, !21, !20}


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