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

; 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.SM3_HMAC_CTX = type { %struct.SM3_CTX, [64 x i8] }
%struct.SM3_CTX = type { [8 x i32], i64, [64 x i8], i64 }

@stderr = external global ptr, align 8
@.str = external hidden unnamed_addr constant [13 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [57 x i8], align 1
@__FUNCTION__.tls_prf = external hidden unnamed_addr constant [8 x i8], align 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) #0

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

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

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

declare void @sm3_hmac_update(ptr noundef, ptr noundef, i64 noundef) #3

declare void @sm3_hmac_finish(ptr noundef, ptr noundef) #3

; Function Attrs: nounwind uwtable
define dso_local i32 @tls_prf(ptr noundef %0, i64 noundef %1, ptr noundef %2, ptr noundef %3, i64 noundef %4, ptr noundef %5, i64 noundef %6, i64 noundef %7, ptr noundef %8) #4 {
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca i64, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca i64, align 8
  %16 = alloca ptr, align 8
  %17 = alloca i64, align 8
  %18 = alloca i64, align 8
  %19 = alloca ptr, align 8
  %20 = alloca %struct.SM3_HMAC_CTX, align 8
  %21 = alloca %struct.SM3_HMAC_CTX, align 8
  %22 = alloca [32 x i8], align 16
  %23 = alloca [32 x i8], align 16
  %24 = alloca i64, align 8
  %25 = alloca i32, align 4
  store ptr %0, ptr %11, align 8, !tbaa !5
  store i64 %1, ptr %12, align 8, !tbaa !9
  store ptr %2, ptr %13, align 8, !tbaa !5
  store ptr %3, ptr %14, align 8, !tbaa !5
  store i64 %4, ptr %15, align 8, !tbaa !9
  store ptr %5, ptr %16, align 8, !tbaa !5
  store i64 %6, ptr %17, align 8, !tbaa !9
  store i64 %7, ptr %18, align 8, !tbaa !9
  store ptr %8, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 176, ptr %20) #6
  call void @llvm.lifetime.start.p0(i64 176, ptr %21) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr %22) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr %23) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #6
  %26 = load ptr, ptr %11, align 8, !tbaa !5
  %27 = icmp ne ptr %26, null
  br i1 %27, label %28, label %52

28:                                               ; preds = %9
  %29 = load i64, ptr %12, align 8, !tbaa !9
  %30 = icmp ne i64 %29, 0
  br i1 %30, label %31, label %52

31:                                               ; preds = %28
  %32 = load ptr, ptr %13, align 8, !tbaa !5
  %33 = icmp ne ptr %32, null
  br i1 %33, label %34, label %52

34:                                               ; preds = %31
  %35 = load ptr, ptr %14, align 8, !tbaa !5
  %36 = icmp ne ptr %35, null
  br i1 %36, label %37, label %52

37:                                               ; preds = %34
  %38 = load i64, ptr %15, align 8, !tbaa !9
  %39 = icmp ne i64 %38, 0
  br i1 %39, label %40, label %52

40:                                               ; preds = %37
  %41 = load ptr, ptr %16, align 8, !tbaa !5
  %42 = icmp ne ptr %41, null
  br i1 %42, label %46, label %43

43:                                               ; preds = %40
  %44 = load i64, ptr %17, align 8, !tbaa !9
  %45 = icmp ne i64 %44, 0
  br i1 %45, label %52, label %46

46:                                               ; preds = %43, %40
  %47 = load i64, ptr %18, align 8, !tbaa !9
  %48 = icmp ne i64 %47, 0
  br i1 %48, label %49, label %52

49:                                               ; preds = %46
  %50 = load ptr, ptr %19, align 8, !tbaa !5
  %51 = icmp ne ptr %50, null
  br i1 %51, label %58, label %52

52:                                               ; preds = %49, %46, %43, %37, %34, %31, %28, %9
  br label %53

53:                                               ; preds = %52
  %54 = load ptr, ptr @stderr, align 8, !tbaa !5
  %55 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %54, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 455, ptr noundef @__FUNCTION__.tls_prf) #6
  br label %56

56:                                               ; preds = %53
  br label %57

57:                                               ; preds = %56
  store i32 -1, ptr %10, align 4
  store i32 1, ptr %25, align 4
  br label %126

58:                                               ; preds = %49
  %59 = load ptr, ptr %11, align 8, !tbaa !5
  %60 = load i64, ptr %12, align 8, !tbaa !9
  call void @sm3_hmac_init(ptr noundef %20, ptr noundef %59, i64 noundef %60)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %21, ptr align 8 %20, i64 176, i1 false)
  %61 = load ptr, ptr %13, align 8, !tbaa !5
  %62 = load ptr, ptr %13, align 8, !tbaa !5
  %63 = call i64 @strlen(ptr noundef %62) #7
  call void @sm3_hmac_update(ptr noundef %21, ptr noundef %61, i64 noundef %63)
  %64 = load ptr, ptr %14, align 8, !tbaa !5
  %65 = load i64, ptr %15, align 8, !tbaa !9
  call void @sm3_hmac_update(ptr noundef %21, ptr noundef %64, i64 noundef %65)
  %66 = load ptr, ptr %16, align 8, !tbaa !5
  %67 = load i64, ptr %17, align 8, !tbaa !9
  call void @sm3_hmac_update(ptr noundef %21, ptr noundef %66, i64 noundef %67)
  %68 = getelementptr inbounds [32 x i8], ptr %22, i64 0, i64 0
  call void @sm3_hmac_finish(ptr noundef %21, ptr noundef %68)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %21, ptr align 8 %20, i64 176, i1 false)
  %69 = getelementptr inbounds [32 x i8], ptr %22, i64 0, i64 0
  call void @sm3_hmac_update(ptr noundef %21, ptr noundef %69, i64 noundef 32)
  %70 = load ptr, ptr %13, align 8, !tbaa !5
  %71 = load ptr, ptr %13, align 8, !tbaa !5
  %72 = call i64 @strlen(ptr noundef %71) #7
  call void @sm3_hmac_update(ptr noundef %21, ptr noundef %70, i64 noundef %72)
  %73 = load ptr, ptr %14, align 8, !tbaa !5
  %74 = load i64, ptr %15, align 8, !tbaa !9
  call void @sm3_hmac_update(ptr noundef %21, ptr noundef %73, i64 noundef %74)
  %75 = load ptr, ptr %16, align 8, !tbaa !5
  %76 = load i64, ptr %17, align 8, !tbaa !9
  call void @sm3_hmac_update(ptr noundef %21, ptr noundef %75, i64 noundef %76)
  %77 = getelementptr inbounds [32 x i8], ptr %23, i64 0, i64 0
  call void @sm3_hmac_finish(ptr noundef %21, ptr noundef %77)
  %78 = load i64, ptr %18, align 8, !tbaa !9
  %79 = icmp ult i64 %78, 32
  br i1 %79, label %80, label %82

80:                                               ; preds = %58
  %81 = load i64, ptr %18, align 8, !tbaa !9
  br label %83

82:                                               ; preds = %58
  br label %83

83:                                               ; preds = %82, %80
  %84 = phi i64 [ %81, %80 ], [ 32, %82 ]
  store i64 %84, ptr %24, align 8, !tbaa !9
  %85 = load ptr, ptr %19, align 8, !tbaa !5
  %86 = getelementptr inbounds [32 x i8], ptr %23, i64 0, i64 0
  %87 = load i64, ptr %24, align 8, !tbaa !9
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %85, ptr align 16 %86, i64 %87, i1 false)
  %88 = load i64, ptr %24, align 8, !tbaa !9
  %89 = load ptr, ptr %19, align 8, !tbaa !5
  %90 = getelementptr inbounds i8, ptr %89, i64 %88
  store ptr %90, ptr %19, align 8, !tbaa !5
  %91 = load i64, ptr %24, align 8, !tbaa !9
  %92 = load i64, ptr %18, align 8, !tbaa !9
  %93 = sub i64 %92, %91
  store i64 %93, ptr %18, align 8, !tbaa !9
  br label %94

94:                                               ; preds = %114, %83
  %95 = load i64, ptr %18, align 8, !tbaa !9
  %96 = icmp ne i64 %95, 0
  br i1 %96, label %97, label %125

97:                                               ; preds = %94
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %21, ptr align 8 %20, i64 176, i1 false)
  %98 = getelementptr inbounds [32 x i8], ptr %22, i64 0, i64 0
  call void @sm3_hmac_update(ptr noundef %21, ptr noundef %98, i64 noundef 32)
  %99 = getelementptr inbounds [32 x i8], ptr %22, i64 0, i64 0
  call void @sm3_hmac_finish(ptr noundef %21, ptr noundef %99)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %21, ptr align 8 %20, i64 176, i1 false)
  %100 = getelementptr inbounds [32 x i8], ptr %22, i64 0, i64 0
  call void @sm3_hmac_update(ptr noundef %21, ptr noundef %100, i64 noundef 32)
  %101 = load ptr, ptr %13, align 8, !tbaa !5
  %102 = load ptr, ptr %13, align 8, !tbaa !5
  %103 = call i64 @strlen(ptr noundef %102) #7
  call void @sm3_hmac_update(ptr noundef %21, ptr noundef %101, i64 noundef %103)
  %104 = load ptr, ptr %14, align 8, !tbaa !5
  %105 = load i64, ptr %15, align 8, !tbaa !9
  call void @sm3_hmac_update(ptr noundef %21, ptr noundef %104, i64 noundef %105)
  %106 = load ptr, ptr %16, align 8, !tbaa !5
  %107 = load i64, ptr %17, align 8, !tbaa !9
  call void @sm3_hmac_update(ptr noundef %21, ptr noundef %106, i64 noundef %107)
  %108 = getelementptr inbounds [32 x i8], ptr %23, i64 0, i64 0
  call void @sm3_hmac_finish(ptr noundef %21, ptr noundef %108)
  %109 = load i64, ptr %18, align 8, !tbaa !9
  %110 = icmp ult i64 %109, 32
  br i1 %110, label %111, label %113

111:                                              ; preds = %97
  %112 = load i64, ptr %18, align 8, !tbaa !9
  br label %114

113:                                              ; preds = %97
  br label %114

114:                                              ; preds = %113, %111
  %115 = phi i64 [ %112, %111 ], [ 32, %113 ]
  store i64 %115, ptr %24, align 8, !tbaa !9
  %116 = load ptr, ptr %19, align 8, !tbaa !5
  %117 = getelementptr inbounds [32 x i8], ptr %23, i64 0, i64 0
  %118 = load i64, ptr %24, align 8, !tbaa !9
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %116, ptr align 16 %117, i64 %118, i1 false)
  %119 = load i64, ptr %24, align 8, !tbaa !9
  %120 = load ptr, ptr %19, align 8, !tbaa !5
  %121 = getelementptr inbounds i8, ptr %120, i64 %119
  store ptr %121, ptr %19, align 8, !tbaa !5
  %122 = load i64, ptr %24, align 8, !tbaa !9
  %123 = load i64, ptr %18, align 8, !tbaa !9
  %124 = sub i64 %123, %122
  store i64 %124, ptr %18, align 8, !tbaa !9
  br label %94, !llvm.loop !11

125:                                              ; preds = %94
  store i32 1, ptr %10, align 4
  store i32 1, ptr %25, align 4
  br label %126

126:                                              ; preds = %125, %57
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 176, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 176, ptr %20) #6
  %127 = load i32, ptr %10, align 4
  ret i32 %127
}

declare void @sm3_hmac_init(ptr noundef, ptr noundef, i64 noundef) #3

; Function Attrs: nounwind willreturn memory(read)
declare i64 @strlen(ptr noundef) #5

attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind 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 #5 = { nounwind willreturn memory(read) "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 = { nounwind willreturn memory(read) }

!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 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}


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

%struct.SM3_HMAC_CTX = type { %struct.SM3_CTX, [64 x i8] }
%struct.SM3_CTX = type { [8 x i32], i64, [64 x i8], i64 }

@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 [57 x i8], align 1
@__FUNCTION__.tls_prf = external hidden unnamed_addr constant [8 x i8], align 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) #0

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

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

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

declare void @sm3_hmac_update(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #3

declare void @sm3_hmac_finish(ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
define dso_local range(i32 -1, 2) i32 @tls_prf(ptr noundef %0, i64 noundef %1, ptr noundef %2, ptr noundef %3, i64 noundef %4, ptr noundef %5, i64 noundef %6, i64 noundef %7, ptr noundef writeonly %8) local_unnamed_addr #4 {
  %10 = alloca %struct.SM3_HMAC_CTX, align 8
  %11 = alloca %struct.SM3_HMAC_CTX, align 8
  %12 = alloca [32 x i8], align 16
  %13 = alloca [32 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 176, ptr nonnull %10) #7
  call void @llvm.lifetime.start.p0(i64 176, ptr nonnull %11) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %12) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %13) #7
  %14 = icmp ne ptr %0, null
  %15 = icmp ne i64 %1, 0
  %or.cond = and i1 %14, %15
  %16 = icmp ne ptr %2, null
  %or.cond3 = and i1 %or.cond, %16
  %17 = icmp ne ptr %3, null
  %or.cond5 = and i1 %or.cond3, %17
  %18 = icmp ne i64 %4, 0
  %or.cond7 = and i1 %or.cond5, %18
  br i1 %or.cond7, label %19, label %24

19:                                               ; preds = %9
  %20 = icmp ne ptr %5, null
  %21 = icmp eq i64 %6, 0
  %or.cond9.not68 = or i1 %20, %21
  %22 = icmp ne i64 %7, 0
  %or.cond11 = and i1 %or.cond9.not68, %22
  %23 = icmp ne ptr %8, null
  %or.cond13 = and i1 %or.cond11, %23
  br i1 %or.cond13, label %27, label %24

24:                                               ; preds = %9, %19
  %25 = load ptr, ptr @stderr, align 8, !tbaa !5
  %26 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %25, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 455, ptr noundef nonnull @__FUNCTION__.tls_prf) #8
  br label %.loopexit

27:                                               ; preds = %19
  call void @sm3_hmac_init(ptr noundef nonnull %10, ptr noundef nonnull %0, i64 noundef %1) #7
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(176) %11, ptr noundef nonnull align 8 dereferenceable(176) %10, i64 176, i1 false)
  %28 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %2) #9
  call void @sm3_hmac_update(ptr noundef nonnull %11, ptr noundef nonnull %2, i64 noundef %28) #7
  call void @sm3_hmac_update(ptr noundef nonnull %11, ptr noundef nonnull %3, i64 noundef %4) #7
  call void @sm3_hmac_update(ptr noundef nonnull %11, ptr noundef %5, i64 noundef %6) #7
  call void @sm3_hmac_finish(ptr noundef nonnull %11, ptr noundef nonnull %12) #7
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(176) %11, ptr noundef nonnull align 8 dereferenceable(176) %10, i64 176, i1 false)
  call void @sm3_hmac_update(ptr noundef nonnull %11, ptr noundef nonnull %12, i64 noundef 32) #7
  %29 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %2) #9
  call void @sm3_hmac_update(ptr noundef nonnull %11, ptr noundef nonnull %2, i64 noundef %29) #7
  call void @sm3_hmac_update(ptr noundef nonnull %11, ptr noundef nonnull %3, i64 noundef %4) #7
  call void @sm3_hmac_update(ptr noundef nonnull %11, ptr noundef %5, i64 noundef %6) #7
  call void @sm3_hmac_finish(ptr noundef nonnull %11, ptr noundef nonnull %13) #7
  %30 = call i64 @llvm.umin.i64(i64 %7, i64 32)
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 1 %8, ptr nonnull align 16 %13, i64 %30, i1 false)
  %31 = sub i64 %7, %30
  %.not69 = icmp eq i64 %31, 0
  br i1 %.not69, label %.loopexit, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %27
  %32 = getelementptr inbounds i8, ptr %8, i64 %30
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %.071 = phi ptr [ %35, %.lr.ph ], [ %32, %.lr.ph.preheader ]
  %.05970 = phi i64 [ %36, %.lr.ph ], [ %31, %.lr.ph.preheader ]
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(176) %11, ptr noundef nonnull align 8 dereferenceable(176) %10, i64 176, i1 false)
  call void @sm3_hmac_update(ptr noundef nonnull %11, ptr noundef nonnull %12, i64 noundef 32) #7
  call void @sm3_hmac_finish(ptr noundef nonnull %11, ptr noundef nonnull %12) #7
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(176) %11, ptr noundef nonnull align 8 dereferenceable(176) %10, i64 176, i1 false)
  call void @sm3_hmac_update(ptr noundef nonnull %11, ptr noundef nonnull %12, i64 noundef 32) #7
  %33 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %2) #9
  call void @sm3_hmac_update(ptr noundef nonnull %11, ptr noundef nonnull %2, i64 noundef %33) #7
  call void @sm3_hmac_update(ptr noundef nonnull %11, ptr noundef nonnull %3, i64 noundef %4) #7
  call void @sm3_hmac_update(ptr noundef nonnull %11, ptr noundef %5, i64 noundef %6) #7
  call void @sm3_hmac_finish(ptr noundef nonnull %11, ptr noundef nonnull %13) #7
  %34 = call i64 @llvm.umin.i64(i64 %.05970, i64 32)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(1) %.071, ptr noundef nonnull align 16 dereferenceable(1) %13, i64 %34, i1 false)
  %35 = getelementptr inbounds i8, ptr %.071, i64 %34
  %36 = sub i64 %.05970, %34
  %.not = icmp eq i64 %36, 0
  br i1 %.not, label %.loopexit, label %.lr.ph, !llvm.loop !9

.loopexit:                                        ; preds = %.lr.ph, %27, %24
  %.060 = phi i32 [ -1, %24 ], [ 1, %27 ], [ 1, %.lr.ph ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %13) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %12) #7
  call void @llvm.lifetime.end.p0(i64 176, ptr nonnull %11) #7
  call void @llvm.lifetime.end.p0(i64 176, ptr nonnull %10) #7
  ret i32 %.060
}

declare void @sm3_hmac_init(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #5

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

attributes #0 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind 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 #5 = { mustprogress nofree nounwind willreturn memory(argmem: read) "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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { nounwind }
attributes #8 = { cold nounwind }
attributes #9 = { nounwind willreturn memory(read) }

!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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}


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