; LLVM IR from tevador/RandomX :: src/blake2 (blake2b)

; 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.__blake2b_state = type { [8 x i64], [2 x i64], [2 x i64], [128 x i8], i32, i32, i8 }

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

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @randomx_blake2b_init(ptr noundef, i64 noundef) #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: 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) #3

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

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

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

; Function Attrs: nounwind uwtable
define dso_local i32 @randomx_blake2b_long(ptr noundef %0, i64 noundef %1, ptr noundef %2, i64 noundef %3) #1 {
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i64, align 8
  %10 = alloca ptr, align 8
  %11 = alloca %struct.__blake2b_state, align 8
  %12 = alloca [4 x i8], align 1
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca [64 x i8], align 16
  %16 = alloca [64 x i8], align 16
  %17 = alloca i32, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store i64 %1, ptr %7, align 8, !tbaa !9
  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 8, ptr %10) #5
  %18 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %18, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 240, ptr %11) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  call void @llvm.memset.p0.i64(ptr align 1 %12, i8 0, i64 4, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store i32 -1, ptr %13, align 4, !tbaa !11
  %19 = load i64, ptr %7, align 8, !tbaa !9
  %20 = icmp ugt i64 %19, 4294967295
  br i1 %20, label %21, label %22

21:                                               ; preds = %4
  br label %156

22:                                               ; preds = %4
  %23 = getelementptr inbounds [4 x i8], ptr %12, i64 0, i64 0
  %24 = load i64, ptr %7, align 8, !tbaa !9
  %25 = trunc i64 %24 to i32
  call void @store32(ptr noundef %23, i32 noundef %25)
  %26 = load i64, ptr %7, align 8, !tbaa !9
  %27 = icmp ule i64 %26, 64
  br i1 %27, label %28, label %67

28:                                               ; preds = %22
  br label %29

29:                                               ; preds = %28
  %30 = load i64, ptr %7, align 8, !tbaa !9
  %31 = call i32 @randomx_blake2b_init(ptr noundef %11, i64 noundef %30)
  store i32 %31, ptr %13, align 4, !tbaa !11
  %32 = load i32, ptr %13, align 4, !tbaa !11
  %33 = icmp slt i32 %32, 0
  br i1 %33, label %34, label %35

34:                                               ; preds = %29
  br label %156

35:                                               ; preds = %29
  br label %36

36:                                               ; preds = %35
  br label %37

37:                                               ; preds = %36
  br label %38

38:                                               ; preds = %37
  %39 = getelementptr inbounds [4 x i8], ptr %12, i64 0, i64 0
  %40 = call i32 @randomx_blake2b_update(ptr noundef %11, ptr noundef %39, i64 noundef 4)
  store i32 %40, ptr %13, align 4, !tbaa !11
  %41 = load i32, ptr %13, align 4, !tbaa !11
  %42 = icmp slt i32 %41, 0
  br i1 %42, label %43, label %44

43:                                               ; preds = %38
  br label %156

44:                                               ; preds = %38
  br label %45

45:                                               ; preds = %44
  br label %46

46:                                               ; preds = %45
  br label %47

47:                                               ; preds = %46
  %48 = load ptr, ptr %8, align 8, !tbaa !5
  %49 = load i64, ptr %9, align 8, !tbaa !9
  %50 = call i32 @randomx_blake2b_update(ptr noundef %11, ptr noundef %48, i64 noundef %49)
  store i32 %50, ptr %13, align 4, !tbaa !11
  %51 = load i32, ptr %13, align 4, !tbaa !11
  %52 = icmp slt i32 %51, 0
  br i1 %52, label %53, label %54

53:                                               ; preds = %47
  br label %156

54:                                               ; preds = %47
  br label %55

55:                                               ; preds = %54
  br label %56

56:                                               ; preds = %55
  br label %57

57:                                               ; preds = %56
  %58 = load ptr, ptr %10, align 8, !tbaa !5
  %59 = load i64, ptr %7, align 8, !tbaa !9
  %60 = call i32 @randomx_blake2b_final(ptr noundef %11, ptr noundef %58, i64 noundef %59)
  store i32 %60, ptr %13, align 4, !tbaa !11
  %61 = load i32, ptr %13, align 4, !tbaa !11
  %62 = icmp slt i32 %61, 0
  br i1 %62, label %63, label %64

63:                                               ; preds = %57
  br label %156

64:                                               ; preds = %57
  br label %65

65:                                               ; preds = %64
  br label %66

66:                                               ; preds = %65
  br label %155

67:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.start.p0(i64 64, ptr %15) #5
  call void @llvm.lifetime.start.p0(i64 64, ptr %16) #5
  br label %68

68:                                               ; preds = %67
  %69 = call i32 @randomx_blake2b_init(ptr noundef %11, i64 noundef 64)
  store i32 %69, ptr %13, align 4, !tbaa !11
  %70 = load i32, ptr %13, align 4, !tbaa !11
  %71 = icmp slt i32 %70, 0
  br i1 %71, label %72, label %73

72:                                               ; preds = %68
  store i32 2, ptr %17, align 4
  br label %152

73:                                               ; preds = %68
  br label %74

74:                                               ; preds = %73
  br label %75

75:                                               ; preds = %74
  br label %76

76:                                               ; preds = %75
  %77 = getelementptr inbounds [4 x i8], ptr %12, i64 0, i64 0
  %78 = call i32 @randomx_blake2b_update(ptr noundef %11, ptr noundef %77, i64 noundef 4)
  store i32 %78, ptr %13, align 4, !tbaa !11
  %79 = load i32, ptr %13, align 4, !tbaa !11
  %80 = icmp slt i32 %79, 0
  br i1 %80, label %81, label %82

81:                                               ; preds = %76
  store i32 2, ptr %17, align 4
  br label %152

82:                                               ; preds = %76
  br label %83

83:                                               ; preds = %82
  br label %84

84:                                               ; preds = %83
  br label %85

85:                                               ; preds = %84
  %86 = load ptr, ptr %8, align 8, !tbaa !5
  %87 = load i64, ptr %9, align 8, !tbaa !9
  %88 = call i32 @randomx_blake2b_update(ptr noundef %11, ptr noundef %86, i64 noundef %87)
  store i32 %88, ptr %13, align 4, !tbaa !11
  %89 = load i32, ptr %13, align 4, !tbaa !11
  %90 = icmp slt i32 %89, 0
  br i1 %90, label %91, label %92

91:                                               ; preds = %85
  store i32 2, ptr %17, align 4
  br label %152

92:                                               ; preds = %85
  br label %93

93:                                               ; preds = %92
  br label %94

94:                                               ; preds = %93
  br label %95

95:                                               ; preds = %94
  %96 = getelementptr inbounds [64 x i8], ptr %15, i64 0, i64 0
  %97 = call i32 @randomx_blake2b_final(ptr noundef %11, ptr noundef %96, i64 noundef 64)
  store i32 %97, ptr %13, align 4, !tbaa !11
  %98 = load i32, ptr %13, align 4, !tbaa !11
  %99 = icmp slt i32 %98, 0
  br i1 %99, label %100, label %101

100:                                              ; preds = %95
  store i32 2, ptr %17, align 4
  br label %152

101:                                              ; preds = %95
  br label %102

102:                                              ; preds = %101
  br label %103

103:                                              ; preds = %102
  %104 = load ptr, ptr %10, align 8, !tbaa !5
  %105 = getelementptr inbounds [64 x i8], ptr %15, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %104, ptr align 16 %105, i64 32, i1 false)
  %106 = load ptr, ptr %10, align 8, !tbaa !5
  %107 = getelementptr inbounds i8, ptr %106, i64 32
  store ptr %107, ptr %10, align 8, !tbaa !5
  %108 = load i64, ptr %7, align 8, !tbaa !9
  %109 = trunc i64 %108 to i32
  %110 = sub i32 %109, 32
  store i32 %110, ptr %14, align 4, !tbaa !11
  br label %111

111:                                              ; preds = %126, %103
  %112 = load i32, ptr %14, align 4, !tbaa !11
  %113 = icmp ugt i32 %112, 64
  br i1 %113, label %114, label %133

114:                                              ; preds = %111
  %115 = getelementptr inbounds [64 x i8], ptr %16, i64 0, i64 0
  %116 = getelementptr inbounds [64 x i8], ptr %15, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %115, ptr align 16 %116, i64 64, i1 false)
  br label %117

117:                                              ; preds = %114
  %118 = getelementptr inbounds [64 x i8], ptr %15, i64 0, i64 0
  %119 = getelementptr inbounds [64 x i8], ptr %16, i64 0, i64 0
  %120 = call i32 @randomx_blake2b(ptr noundef %118, i64 noundef 64, ptr noundef %119, i64 noundef 64, ptr noundef null, i64 noundef 0)
  store i32 %120, ptr %13, align 4, !tbaa !11
  %121 = load i32, ptr %13, align 4, !tbaa !11
  %122 = icmp slt i32 %121, 0
  br i1 %122, label %123, label %124

123:                                              ; preds = %117
  store i32 2, ptr %17, align 4
  br label %152

124:                                              ; preds = %117
  br label %125

125:                                              ; preds = %124
  br label %126

126:                                              ; preds = %125
  %127 = load ptr, ptr %10, align 8, !tbaa !5
  %128 = getelementptr inbounds [64 x i8], ptr %15, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %127, ptr align 16 %128, i64 32, i1 false)
  %129 = load ptr, ptr %10, align 8, !tbaa !5
  %130 = getelementptr inbounds i8, ptr %129, i64 32
  store ptr %130, ptr %10, align 8, !tbaa !5
  %131 = load i32, ptr %14, align 4, !tbaa !11
  %132 = sub i32 %131, 32
  store i32 %132, ptr %14, align 4, !tbaa !11
  br label %111, !llvm.loop !13

133:                                              ; preds = %111
  %134 = getelementptr inbounds [64 x i8], ptr %16, i64 0, i64 0
  %135 = getelementptr inbounds [64 x i8], ptr %15, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %134, ptr align 16 %135, i64 64, i1 false)
  br label %136

136:                                              ; preds = %133
  %137 = getelementptr inbounds [64 x i8], ptr %15, i64 0, i64 0
  %138 = load i32, ptr %14, align 4, !tbaa !11
  %139 = zext i32 %138 to i64
  %140 = getelementptr inbounds [64 x i8], ptr %16, i64 0, i64 0
  %141 = call i32 @randomx_blake2b(ptr noundef %137, i64 noundef %139, ptr noundef %140, i64 noundef 64, ptr noundef null, i64 noundef 0)
  store i32 %141, ptr %13, align 4, !tbaa !11
  %142 = load i32, ptr %13, align 4, !tbaa !11
  %143 = icmp slt i32 %142, 0
  br i1 %143, label %144, label %145

144:                                              ; preds = %136
  store i32 2, ptr %17, align 4
  br label %152

145:                                              ; preds = %136
  br label %146

146:                                              ; preds = %145
  br label %147

147:                                              ; preds = %146
  %148 = load ptr, ptr %10, align 8, !tbaa !5
  %149 = getelementptr inbounds [64 x i8], ptr %15, i64 0, i64 0
  %150 = load i32, ptr %14, align 4, !tbaa !11
  %151 = zext i32 %150 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %148, ptr align 16 %149, i64 %151, i1 false)
  store i32 0, ptr %17, align 4
  br label %152

152:                                              ; preds = %147, %144, %123, %100, %91, %81, %72
  call void @llvm.lifetime.end.p0(i64 64, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 64, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  %153 = load i32, ptr %17, align 4
  switch i32 %153, label %158 [
    i32 0, label %154
    i32 2, label %156
  ]

154:                                              ; preds = %152
  br label %155

155:                                              ; preds = %154, %66
  br label %156

156:                                              ; preds = %155, %152, %63, %53, %43, %34, %21
  %157 = load i32, ptr %13, align 4, !tbaa !11
  store i32 %157, ptr %5, align 4
  store i32 1, ptr %17, align 4
  br label %158

158:                                              ; preds = %156, %152
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 240, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  %159 = load i32, ptr %5, align 4
  ret i32 %159
}

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @store32(ptr noundef, i32 noundef) #4

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { inlinehint 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 }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"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.__blake2b_state = type { [8 x i64], [2 x i64], [2 x i64], [128 x i8], i32, i32, i8 }

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

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @randomx_blake2b_init(ptr noundef, i64 noundef) local_unnamed_addr #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: nounwind uwtable
declare dso_local i32 @randomx_blake2b_update(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #1

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

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

; Function Attrs: nounwind uwtable
define dso_local i32 @randomx_blake2b_long(ptr noundef %0, i64 noundef %1, ptr noundef %2, i64 noundef %3) local_unnamed_addr #1 {
  %5 = alloca %struct.__blake2b_state, align 8
  %6 = alloca [4 x i8], align 4
  %7 = alloca [64 x i8], align 16
  %8 = alloca [64 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 240, ptr nonnull %5) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #4
  store i32 0, ptr %6, align 4
  %9 = icmp ugt i64 %1, 4294967295
  br i1 %9, label %46, label %10

10:                                               ; preds = %4
  %11 = trunc nuw i64 %1 to i32
  call void @store32(ptr noundef nonnull %6, i32 noundef %11)
  %12 = icmp ult i64 %1, 65
  br i1 %12, label %13, label %24

13:                                               ; preds = %10
  %14 = call i32 @randomx_blake2b_init(ptr noundef nonnull %5, i64 noundef %1)
  %15 = icmp slt i32 %14, 0
  br i1 %15, label %46, label %16

16:                                               ; preds = %13
  %17 = call i32 @randomx_blake2b_update(ptr noundef nonnull %5, ptr noundef nonnull %6, i64 noundef 4)
  %18 = icmp slt i32 %17, 0
  br i1 %18, label %46, label %19

19:                                               ; preds = %16
  %20 = call i32 @randomx_blake2b_update(ptr noundef nonnull %5, ptr noundef %2, i64 noundef %3)
  %21 = icmp slt i32 %20, 0
  br i1 %21, label %46, label %22

22:                                               ; preds = %19
  %23 = call i32 @randomx_blake2b_final(ptr noundef nonnull %5, ptr noundef %0, i64 noundef %1)
  br label %46

24:                                               ; preds = %10
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %7) #4
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %8) #4
  %25 = call i32 @randomx_blake2b_init(ptr noundef nonnull %5, i64 noundef 64)
  %26 = icmp slt i32 %25, 0
  br i1 %26, label %.loopexit, label %27

27:                                               ; preds = %24
  %28 = call i32 @randomx_blake2b_update(ptr noundef nonnull %5, ptr noundef nonnull %6, i64 noundef 4)
  %29 = icmp slt i32 %28, 0
  br i1 %29, label %.loopexit, label %30

30:                                               ; preds = %27
  %31 = call i32 @randomx_blake2b_update(ptr noundef nonnull %5, ptr noundef %2, i64 noundef %3)
  %32 = icmp slt i32 %31, 0
  br i1 %32, label %.loopexit, label %33

33:                                               ; preds = %30
  %34 = call i32 @randomx_blake2b_final(ptr noundef nonnull %5, ptr noundef nonnull %7, i64 noundef 64)
  %35 = icmp slt i32 %34, 0
  br i1 %35, label %.loopexit, label %36

36:                                               ; preds = %33
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(32) %0, ptr noundef nonnull align 16 dereferenceable(32) %7, i64 32, i1 false)
  %.03249 = add i32 %11, -32
  %.03450 = getelementptr inbounds i8, ptr %0, i64 32
  %37 = icmp ugt i32 %.03249, 64
  br i1 %37, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %36, %40
  %.03452 = phi ptr [ %.034, %40 ], [ %.03450, %36 ]
  %.03251 = phi i32 [ %.032, %40 ], [ %.03249, %36 ]
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(64) %8, ptr noundef nonnull align 16 dereferenceable(64) %7, i64 64, i1 false)
  %38 = call i32 @randomx_blake2b(ptr noundef nonnull %7, i64 noundef 64, ptr noundef nonnull %8, i64 noundef 64, ptr noundef null, i64 noundef 0)
  %39 = icmp slt i32 %38, 0
  br i1 %39, label %.loopexit, label %40

40:                                               ; preds = %.lr.ph
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(32) %.03452, ptr noundef nonnull align 16 dereferenceable(32) %7, i64 32, i1 false)
  %.032 = add i32 %.03251, -32
  %.034 = getelementptr inbounds i8, ptr %.03452, i64 32
  %41 = icmp ugt i32 %.032, 64
  br i1 %41, label %.lr.ph, label %._crit_edge, !llvm.loop !5

._crit_edge:                                      ; preds = %40, %36
  %.032.lcssa = phi i32 [ %.03249, %36 ], [ %.032, %40 ]
  %.034.lcssa = phi ptr [ %.03450, %36 ], [ %.034, %40 ]
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(64) %8, ptr noundef nonnull align 16 dereferenceable(64) %7, i64 64, i1 false)
  %42 = zext nneg i32 %.032.lcssa to i64
  %43 = call i32 @randomx_blake2b(ptr noundef nonnull %7, i64 noundef %42, ptr noundef nonnull %8, i64 noundef 64, ptr noundef null, i64 noundef 0)
  %44 = icmp slt i32 %43, 0
  br i1 %44, label %.loopexit, label %45

45:                                               ; preds = %._crit_edge
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 1 %.034.lcssa, ptr nonnull align 16 %7, i64 %42, i1 false)
  br label %.loopexit

.loopexit:                                        ; preds = %.lr.ph, %._crit_edge, %33, %30, %27, %24, %45
  %.033 = phi i32 [ %43, %45 ], [ %25, %24 ], [ %28, %27 ], [ %31, %30 ], [ %34, %33 ], [ %43, %._crit_edge ], [ %38, %.lr.ph ]
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %8) #4
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %7) #4
  br label %46

46:                                               ; preds = %4, %13, %16, %19, %22, %.loopexit
  %.1 = phi i32 [ -1, %4 ], [ %14, %13 ], [ %17, %16 ], [ %20, %19 ], [ %23, %22 ], [ %.033, %.loopexit ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #4
  call void @llvm.lifetime.end.p0(i64 240, ptr nonnull %5) #4
  ret i32 %.1
}

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @store32(ptr noundef, i32 noundef) local_unnamed_addr #3

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { inlinehint 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 = { 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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}


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