; LLVM IR from DanEngelbrecht/longtail :: lib/blake3/ext (blake3)

; 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.output_t = type { [8 x i32], i64, [64 x i8], i8, i8 }
%struct.blake3_chunk_state = type { [8 x i32], i64, [64 x i8], i8, i8, i8 }
%struct.blake3_hasher = type { [8 x i32], %struct.blake3_chunk_state, i8, [1760 x 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
define dso_local void @blake3_hasher_update(ptr noundef %0, ptr noundef %1, i64 noundef %2) #1 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i64, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i64, align 8
  %9 = alloca %struct.output_t, align 8
  %10 = alloca [32 x i8], align 16
  %11 = alloca i32, align 4
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca %struct.blake3_chunk_state, align 8
  %16 = alloca %struct.output_t, align 8
  %17 = alloca [32 x i8], align 16
  %18 = alloca [64 x i8], align 16
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store i64 %2, ptr %6, align 8, !tbaa !9
  %19 = load i64, ptr %6, align 8, !tbaa !9
  %20 = icmp eq i64 %19, 0
  br i1 %20, label %21, label %22

21:                                               ; preds = %3
  br label %181

22:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  %23 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %23, ptr %7, align 8, !tbaa !5
  %24 = load ptr, ptr %4, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.blake3_hasher, ptr %24, i32 0, i32 1
  %26 = call i64 @chunk_state_len(ptr noundef %25)
  %27 = icmp ugt i64 %26, 0
  br i1 %27, label %28, label %76

28:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  %29 = load ptr, ptr %4, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.blake3_hasher, ptr %29, i32 0, i32 1
  %31 = call i64 @chunk_state_len(ptr noundef %30)
  %32 = sub i64 1024, %31
  store i64 %32, ptr %8, align 8, !tbaa !9
  %33 = load i64, ptr %8, align 8, !tbaa !9
  %34 = load i64, ptr %6, align 8, !tbaa !9
  %35 = icmp ugt i64 %33, %34
  br i1 %35, label %36, label %38

36:                                               ; preds = %28
  %37 = load i64, ptr %6, align 8, !tbaa !9
  store i64 %37, ptr %8, align 8, !tbaa !9
  br label %38

38:                                               ; preds = %36, %28
  %39 = load ptr, ptr %4, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.blake3_hasher, ptr %39, i32 0, i32 1
  %41 = load ptr, ptr %7, align 8, !tbaa !5
  %42 = load i64, ptr %8, align 8, !tbaa !9
  call void @chunk_state_update(ptr noundef %40, ptr noundef %41, i64 noundef %42)
  %43 = load i64, ptr %8, align 8, !tbaa !9
  %44 = load ptr, ptr %7, align 8, !tbaa !5
  %45 = getelementptr inbounds i8, ptr %44, i64 %43
  store ptr %45, ptr %7, align 8, !tbaa !5
  %46 = load i64, ptr %8, align 8, !tbaa !9
  %47 = load i64, ptr %6, align 8, !tbaa !9
  %48 = sub i64 %47, %46
  store i64 %48, ptr %6, align 8, !tbaa !9
  %49 = load i64, ptr %6, align 8, !tbaa !9
  %50 = icmp ugt i64 %49, 0
  br i1 %50, label %51, label %71

51:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 112, ptr %9) #3
  %52 = load ptr, ptr %4, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.blake3_hasher, ptr %52, i32 0, i32 1
  call void @chunk_state_output(ptr dead_on_unwind writable sret(%struct.output_t) align 8 %9, ptr noundef %53)
  call void @llvm.lifetime.start.p0(i64 32, ptr %10) #3
  %54 = getelementptr inbounds [32 x i8], ptr %10, i64 0, i64 0
  call void @output_chaining_value(ptr noundef %9, ptr noundef %54)
  %55 = load ptr, ptr %4, align 8, !tbaa !5
  %56 = getelementptr inbounds [32 x i8], ptr %10, i64 0, i64 0
  %57 = load ptr, ptr %4, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.blake3_hasher, ptr %57, i32 0, i32 1
  %59 = getelementptr inbounds %struct.blake3_chunk_state, ptr %58, i32 0, i32 1
  %60 = load i64, ptr %59, align 8, !tbaa !11
  call void @hasher_push_cv(ptr noundef %55, ptr noundef %56, i64 noundef %60)
  %61 = load ptr, ptr %4, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.blake3_hasher, ptr %61, i32 0, i32 1
  %63 = load ptr, ptr %4, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.blake3_hasher, ptr %63, i32 0, i32 0
  %65 = getelementptr inbounds [8 x i32], ptr %64, i64 0, i64 0
  %66 = load ptr, ptr %4, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.blake3_hasher, ptr %66, i32 0, i32 1
  %68 = getelementptr inbounds %struct.blake3_chunk_state, ptr %67, i32 0, i32 1
  %69 = load i64, ptr %68, align 8, !tbaa !11
  %70 = add i64 %69, 1
  call void @chunk_state_reset(ptr noundef %62, ptr noundef %65, i64 noundef %70)
  call void @llvm.lifetime.end.p0(i64 32, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 112, ptr %9) #3
  br label %72

71:                                               ; preds = %38
  store i32 1, ptr %11, align 4
  br label %73

72:                                               ; preds = %51
  store i32 0, ptr %11, align 4
  br label %73

73:                                               ; preds = %72, %71
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  %74 = load i32, ptr %11, align 4
  switch i32 %74, label %179 [
    i32 0, label %75
  ]

75:                                               ; preds = %73
  br label %76

76:                                               ; preds = %75, %22
  br label %77

77:                                               ; preds = %152, %76
  %78 = load i64, ptr %6, align 8, !tbaa !9
  %79 = icmp ugt i64 %78, 1024
  br i1 %79, label %80, label %165

80:                                               ; preds = %77
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  %81 = load i64, ptr %6, align 8, !tbaa !9
  %82 = call i64 @round_down_to_power_of_2(i64 noundef %81)
  store i64 %82, ptr %12, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  %83 = load ptr, ptr %4, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.blake3_hasher, ptr %83, i32 0, i32 1
  %85 = getelementptr inbounds %struct.blake3_chunk_state, ptr %84, i32 0, i32 1
  %86 = load i64, ptr %85, align 8, !tbaa !11
  %87 = mul i64 %86, 1024
  store i64 %87, ptr %13, align 8, !tbaa !9
  br label %88

88:                                               ; preds = %94, %80
  %89 = load i64, ptr %12, align 8, !tbaa !9
  %90 = sub i64 %89, 1
  %91 = load i64, ptr %13, align 8, !tbaa !9
  %92 = and i64 %90, %91
  %93 = icmp ne i64 %92, 0
  br i1 %93, label %94, label %97

94:                                               ; preds = %88
  %95 = load i64, ptr %12, align 8, !tbaa !9
  %96 = udiv i64 %95, 2
  store i64 %96, ptr %12, align 8, !tbaa !9
  br label %88, !llvm.loop !14

97:                                               ; preds = %88
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #3
  %98 = load i64, ptr %12, align 8, !tbaa !9
  %99 = udiv i64 %98, 1024
  store i64 %99, ptr %14, align 8, !tbaa !9
  %100 = load i64, ptr %12, align 8, !tbaa !9
  %101 = icmp ule i64 %100, 1024
  br i1 %101, label %102, label %122

102:                                              ; preds = %97
  call void @llvm.lifetime.start.p0(i64 112, ptr %15) #3
  %103 = load ptr, ptr %4, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.blake3_hasher, ptr %103, i32 0, i32 0
  %105 = getelementptr inbounds [8 x i32], ptr %104, i64 0, i64 0
  %106 = load ptr, ptr %4, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.blake3_hasher, ptr %106, i32 0, i32 1
  %108 = getelementptr inbounds %struct.blake3_chunk_state, ptr %107, i32 0, i32 5
  %109 = load i8, ptr %108, align 2, !tbaa !16
  call void @chunk_state_init(ptr noundef %15, ptr noundef %105, i8 noundef zeroext %109)
  %110 = load ptr, ptr %4, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.blake3_hasher, ptr %110, i32 0, i32 1
  %112 = getelementptr inbounds %struct.blake3_chunk_state, ptr %111, i32 0, i32 1
  %113 = load i64, ptr %112, align 8, !tbaa !11
  %114 = getelementptr inbounds %struct.blake3_chunk_state, ptr %15, i32 0, i32 1
  store i64 %113, ptr %114, align 8, !tbaa !17
  %115 = load ptr, ptr %7, align 8, !tbaa !5
  %116 = load i64, ptr %12, align 8, !tbaa !9
  call void @chunk_state_update(ptr noundef %15, ptr noundef %115, i64 noundef %116)
  call void @llvm.lifetime.start.p0(i64 112, ptr %16) #3
  call void @chunk_state_output(ptr dead_on_unwind writable sret(%struct.output_t) align 8 %16, ptr noundef %15)
  call void @llvm.lifetime.start.p0(i64 32, ptr %17) #3
  %117 = getelementptr inbounds [32 x i8], ptr %17, i64 0, i64 0
  call void @output_chaining_value(ptr noundef %16, ptr noundef %117)
  %118 = load ptr, ptr %4, align 8, !tbaa !5
  %119 = getelementptr inbounds [32 x i8], ptr %17, i64 0, i64 0
  %120 = getelementptr inbounds %struct.blake3_chunk_state, ptr %15, i32 0, i32 1
  %121 = load i64, ptr %120, align 8, !tbaa !17
  call void @hasher_push_cv(ptr noundef %118, ptr noundef %119, i64 noundef %121)
  call void @llvm.lifetime.end.p0(i64 32, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 112, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 112, ptr %15) #3
  br label %152

122:                                              ; preds = %97
  call void @llvm.lifetime.start.p0(i64 64, ptr %18) #3
  %123 = load ptr, ptr %7, align 8, !tbaa !5
  %124 = load i64, ptr %12, align 8, !tbaa !9
  %125 = load ptr, ptr %4, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.blake3_hasher, ptr %125, i32 0, i32 0
  %127 = getelementptr inbounds [8 x i32], ptr %126, i64 0, i64 0
  %128 = load ptr, ptr %4, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.blake3_hasher, ptr %128, i32 0, i32 1
  %130 = getelementptr inbounds %struct.blake3_chunk_state, ptr %129, i32 0, i32 1
  %131 = load i64, ptr %130, align 8, !tbaa !11
  %132 = load ptr, ptr %4, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.blake3_hasher, ptr %132, i32 0, i32 1
  %134 = getelementptr inbounds %struct.blake3_chunk_state, ptr %133, i32 0, i32 5
  %135 = load i8, ptr %134, align 2, !tbaa !16
  %136 = getelementptr inbounds [64 x i8], ptr %18, i64 0, i64 0
  call void @compress_subtree_to_parent_node(ptr noundef %123, i64 noundef %124, ptr noundef %127, i64 noundef %131, i8 noundef zeroext %135, ptr noundef %136)
  %137 = load ptr, ptr %4, align 8, !tbaa !5
  %138 = getelementptr inbounds [64 x i8], ptr %18, i64 0, i64 0
  %139 = load ptr, ptr %4, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.blake3_hasher, ptr %139, i32 0, i32 1
  %141 = getelementptr inbounds %struct.blake3_chunk_state, ptr %140, i32 0, i32 1
  %142 = load i64, ptr %141, align 8, !tbaa !11
  call void @hasher_push_cv(ptr noundef %137, ptr noundef %138, i64 noundef %142)
  %143 = load ptr, ptr %4, align 8, !tbaa !5
  %144 = getelementptr inbounds [64 x i8], ptr %18, i64 0, i64 32
  %145 = load ptr, ptr %4, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct.blake3_hasher, ptr %145, i32 0, i32 1
  %147 = getelementptr inbounds %struct.blake3_chunk_state, ptr %146, i32 0, i32 1
  %148 = load i64, ptr %147, align 8, !tbaa !11
  %149 = load i64, ptr %14, align 8, !tbaa !9
  %150 = udiv i64 %149, 2
  %151 = add i64 %148, %150
  call void @hasher_push_cv(ptr noundef %143, ptr noundef %144, i64 noundef %151)
  call void @llvm.lifetime.end.p0(i64 64, ptr %18) #3
  br label %152

152:                                              ; preds = %122, %102
  %153 = load i64, ptr %14, align 8, !tbaa !9
  %154 = load ptr, ptr %4, align 8, !tbaa !5
  %155 = getelementptr inbounds %struct.blake3_hasher, ptr %154, i32 0, i32 1
  %156 = getelementptr inbounds %struct.blake3_chunk_state, ptr %155, i32 0, i32 1
  %157 = load i64, ptr %156, align 8, !tbaa !11
  %158 = add i64 %157, %153
  store i64 %158, ptr %156, align 8, !tbaa !11
  %159 = load i64, ptr %12, align 8, !tbaa !9
  %160 = load ptr, ptr %7, align 8, !tbaa !5
  %161 = getelementptr inbounds i8, ptr %160, i64 %159
  store ptr %161, ptr %7, align 8, !tbaa !5
  %162 = load i64, ptr %12, align 8, !tbaa !9
  %163 = load i64, ptr %6, align 8, !tbaa !9
  %164 = sub i64 %163, %162
  store i64 %164, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  br label %77, !llvm.loop !18

165:                                              ; preds = %77
  %166 = load i64, ptr %6, align 8, !tbaa !9
  %167 = icmp ugt i64 %166, 0
  br i1 %167, label %168, label %178

168:                                              ; preds = %165
  %169 = load ptr, ptr %4, align 8, !tbaa !5
  %170 = getelementptr inbounds %struct.blake3_hasher, ptr %169, i32 0, i32 1
  %171 = load ptr, ptr %7, align 8, !tbaa !5
  %172 = load i64, ptr %6, align 8, !tbaa !9
  call void @chunk_state_update(ptr noundef %170, ptr noundef %171, i64 noundef %172)
  %173 = load ptr, ptr %4, align 8, !tbaa !5
  %174 = load ptr, ptr %4, align 8, !tbaa !5
  %175 = getelementptr inbounds %struct.blake3_hasher, ptr %174, i32 0, i32 1
  %176 = getelementptr inbounds %struct.blake3_chunk_state, ptr %175, i32 0, i32 1
  %177 = load i64, ptr %176, align 8, !tbaa !11
  call void @hasher_merge_cv_stack(ptr noundef %173, i64 noundef %177)
  br label %178

178:                                              ; preds = %168, %165
  store i32 0, ptr %11, align 4
  br label %179

179:                                              ; preds = %178, %73
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  %180 = load i32, ptr %11, align 4
  switch i32 %180, label %182 [
    i32 0, label %181
    i32 1, label %181
  ]

181:                                              ; preds = %179, %179, %21
  ret void

182:                                              ; preds = %179
  unreachable
}

; Function Attrs: alwaysinline nounwind uwtable
declare hidden i64 @chunk_state_len(ptr noundef) #2

; Function Attrs: alwaysinline nounwind uwtable
declare hidden void @chunk_state_update(ptr noundef, ptr noundef, i64 noundef) #2

; Function Attrs: alwaysinline nounwind uwtable
declare hidden void @chunk_state_output(ptr dead_on_unwind noalias writable sret(%struct.output_t) align 8, ptr noundef) #2

; Function Attrs: alwaysinline nounwind uwtable
declare hidden void @output_chaining_value(ptr noundef, ptr noundef) #2

; Function Attrs: alwaysinline nounwind uwtable
declare hidden void @hasher_push_cv(ptr noundef, ptr noundef, i64 noundef) #2

; Function Attrs: alwaysinline nounwind uwtable
declare hidden void @chunk_state_reset(ptr noundef, ptr noundef, i64 noundef) #2

; Function Attrs: alwaysinline nounwind uwtable
declare hidden i64 @round_down_to_power_of_2(i64 noundef) #2

; Function Attrs: alwaysinline nounwind uwtable
declare hidden void @chunk_state_init(ptr noundef, ptr noundef, i8 noundef zeroext) #2

; Function Attrs: alwaysinline nounwind uwtable
declare hidden void @compress_subtree_to_parent_node(ptr noundef, i64 noundef, ptr noundef, i64 noundef, i8 noundef zeroext, ptr noundef) #2

; Function Attrs: alwaysinline nounwind uwtable
declare hidden void @hasher_merge_cv_stack(ptr noundef, i64 noundef) #2

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 = { alwaysinline 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 #3 = { 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, !10, i64 64}
!12 = !{!"", !7, i64 0, !13, i64 32, !7, i64 144, !7, i64 145}
!13 = !{!"", !7, i64 0, !10, i64 32, !7, i64 40, !7, i64 104, !7, i64 105, !7, i64 106}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = !{!12, !7, i64 138}
!17 = !{!13, !10, i64 32}
!18 = distinct !{!18, !15}


; 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.output_t = type { [8 x i32], i64, [64 x i8], i8, i8 }
%struct.blake3_chunk_state = type { [8 x i32], i64, [64 x i8], i8, i8, 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
define dso_local void @blake3_hasher_update(ptr noundef %0, ptr noundef %1, i64 noundef %2) local_unnamed_addr #1 {
  %4 = alloca %struct.output_t, align 8
  %5 = alloca [32 x i8], align 16
  %6 = alloca %struct.blake3_chunk_state, align 8
  %7 = alloca %struct.output_t, align 8
  %8 = alloca [32 x i8], align 16
  %9 = alloca [64 x i8], align 16
  %10 = icmp eq i64 %2, 0
  br i1 %10, label %.critedge, label %11

11:                                               ; preds = %3
  %12 = getelementptr inbounds i8, ptr %0, i64 32
  %13 = tail call i64 @chunk_state_len(ptr noundef nonnull %12)
  %.not = icmp eq i64 %13, 0
  br i1 %.not, label %24, label %14

14:                                               ; preds = %11
  %15 = tail call i64 @chunk_state_len(ptr noundef nonnull %12)
  %16 = sub i64 1024, %15
  %spec.select = tail call i64 @llvm.umin.i64(i64 %16, i64 %2)
  tail call void @chunk_state_update(ptr noundef nonnull %12, ptr noundef %1, i64 noundef %spec.select)
  %17 = sub i64 %2, %spec.select
  %.not64.not = icmp eq i64 %17, 0
  br i1 %.not64.not, label %.critedge, label %18

18:                                               ; preds = %14
  %19 = getelementptr inbounds i8, ptr %1, i64 %spec.select
  call void @llvm.lifetime.start.p0(i64 112, ptr nonnull %4) #4
  call void @chunk_state_output(ptr dead_on_unwind nonnull writable sret(%struct.output_t) align 8 %4, ptr noundef nonnull %12)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #4
  call void @output_chaining_value(ptr noundef nonnull %4, ptr noundef nonnull %5)
  %20 = getelementptr inbounds i8, ptr %0, i64 64
  %21 = load i64, ptr %20, align 8, !tbaa !5
  call void @hasher_push_cv(ptr noundef %0, ptr noundef nonnull %5, i64 noundef %21)
  %22 = load i64, ptr %20, align 8, !tbaa !5
  %23 = add i64 %22, 1
  call void @chunk_state_reset(ptr noundef nonnull %12, ptr noundef %0, i64 noundef %23)
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #4
  call void @llvm.lifetime.end.p0(i64 112, ptr nonnull %4) #4
  br label %24

24:                                               ; preds = %18, %11
  %.057 = phi ptr [ %19, %18 ], [ %1, %11 ]
  %.0 = phi i64 [ %17, %18 ], [ %2, %11 ]
  %25 = icmp ugt i64 %.0, 1024
  br i1 %25, label %.lr.ph, label %._crit_edge.thread

.lr.ph:                                           ; preds = %24
  %26 = getelementptr inbounds i8, ptr %0, i64 64
  %27 = getelementptr inbounds i8, ptr %0, i64 138
  %28 = getelementptr inbounds i8, ptr %9, i64 32
  %29 = getelementptr inbounds i8, ptr %6, i64 32
  br label %30

30:                                               ; preds = %.lr.ph, %51
  %.168 = phi i64 [ %.0, %.lr.ph ], [ %55, %51 ]
  %.15867 = phi ptr [ %.057, %.lr.ph ], [ %54, %51 ]
  %31 = call i64 @round_down_to_power_of_2(i64 noundef %.168)
  %32 = load i64, ptr %26, align 8, !tbaa !5
  %33 = shl i64 %32, 10
  br label %34

34:                                               ; preds = %34, %30
  %.059 = phi i64 [ %31, %30 ], [ %37, %34 ]
  %35 = add i64 %.059, -1
  %36 = and i64 %35, %33
  %.not66 = icmp eq i64 %36, 0
  %37 = lshr i64 %.059, 1
  br i1 %.not66, label %38, label %34, !llvm.loop !11

38:                                               ; preds = %34
  %39 = lshr i64 %.059, 10
  %40 = icmp ult i64 %.059, 1025
  br i1 %40, label %41, label %45

41:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 112, ptr nonnull %6) #4
  %42 = load i8, ptr %27, align 2, !tbaa !13
  call void @chunk_state_init(ptr noundef nonnull %6, ptr noundef %0, i8 noundef zeroext %42)
  %43 = load i64, ptr %26, align 8, !tbaa !5
  store i64 %43, ptr %29, align 8, !tbaa !14
  call void @chunk_state_update(ptr noundef nonnull %6, ptr noundef %.15867, i64 noundef %.059)
  call void @llvm.lifetime.start.p0(i64 112, ptr nonnull %7) #4
  call void @chunk_state_output(ptr dead_on_unwind nonnull writable sret(%struct.output_t) align 8 %7, ptr noundef nonnull %6)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %8) #4
  call void @output_chaining_value(ptr noundef nonnull %7, ptr noundef nonnull %8)
  %44 = load i64, ptr %29, align 8, !tbaa !14
  call void @hasher_push_cv(ptr noundef %0, ptr noundef nonnull %8, i64 noundef %44)
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #4
  call void @llvm.lifetime.end.p0(i64 112, ptr nonnull %7) #4
  call void @llvm.lifetime.end.p0(i64 112, ptr nonnull %6) #4
  br label %51

45:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %9) #4
  %46 = load i8, ptr %27, align 2, !tbaa !13
  call void @compress_subtree_to_parent_node(ptr noundef %.15867, i64 noundef %.059, ptr noundef %0, i64 noundef %32, i8 noundef zeroext %46, ptr noundef nonnull %9)
  %47 = load i64, ptr %26, align 8, !tbaa !5
  call void @hasher_push_cv(ptr noundef %0, ptr noundef nonnull %9, i64 noundef %47)
  %48 = load i64, ptr %26, align 8, !tbaa !5
  %49 = lshr i64 %.059, 11
  %50 = add i64 %48, %49
  call void @hasher_push_cv(ptr noundef %0, ptr noundef nonnull %28, i64 noundef %50)
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %9) #4
  br label %51

51:                                               ; preds = %45, %41
  %52 = load i64, ptr %26, align 8, !tbaa !5
  %53 = add i64 %52, %39
  store i64 %53, ptr %26, align 8, !tbaa !5
  %54 = getelementptr inbounds i8, ptr %.15867, i64 %.059
  %55 = sub i64 %.168, %.059
  %56 = icmp ugt i64 %55, 1024
  br i1 %56, label %30, label %._crit_edge, !llvm.loop !15

._crit_edge:                                      ; preds = %51
  %.not65 = icmp eq i64 %55, 0
  br i1 %.not65, label %.critedge, label %._crit_edge.thread

._crit_edge.thread:                               ; preds = %24, %._crit_edge
  %.1.lcssa75 = phi i64 [ %55, %._crit_edge ], [ %.0, %24 ]
  %.158.lcssa74 = phi ptr [ %54, %._crit_edge ], [ %.057, %24 ]
  call void @chunk_state_update(ptr noundef nonnull %12, ptr noundef %.158.lcssa74, i64 noundef %.1.lcssa75)
  %57 = getelementptr inbounds i8, ptr %0, i64 64
  %58 = load i64, ptr %57, align 8, !tbaa !5
  call void @hasher_merge_cv_stack(ptr noundef %0, i64 noundef %58)
  br label %.critedge

.critedge:                                        ; preds = %._crit_edge.thread, %._crit_edge, %14, %3
  ret void
}

; Function Attrs: alwaysinline nounwind uwtable
declare hidden i64 @chunk_state_len(ptr noundef) local_unnamed_addr #2

; Function Attrs: alwaysinline nounwind uwtable
declare hidden void @chunk_state_update(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #2

; Function Attrs: alwaysinline nounwind uwtable
declare hidden void @chunk_state_output(ptr dead_on_unwind noalias writable sret(%struct.output_t) align 8, ptr noundef) local_unnamed_addr #2

; Function Attrs: alwaysinline nounwind uwtable
declare hidden void @output_chaining_value(ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: alwaysinline nounwind uwtable
declare hidden void @hasher_push_cv(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #2

; Function Attrs: alwaysinline nounwind uwtable
declare hidden void @chunk_state_reset(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #2

; Function Attrs: alwaysinline nounwind uwtable
declare hidden i64 @round_down_to_power_of_2(i64 noundef) local_unnamed_addr #2

; Function Attrs: alwaysinline nounwind uwtable
declare hidden void @chunk_state_init(ptr noundef, ptr noundef, i8 noundef zeroext) local_unnamed_addr #2

; Function Attrs: alwaysinline nounwind uwtable
declare hidden void @compress_subtree_to_parent_node(ptr noundef, i64 noundef, ptr noundef, i64 noundef, i8 noundef zeroext, ptr noundef) local_unnamed_addr #2

; Function Attrs: alwaysinline nounwind uwtable
declare hidden void @hasher_merge_cv_stack(ptr noundef, i64 noundef) local_unnamed_addr #2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.umin.i64(i64, i64) #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 = { alwaysinline 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 #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !10, i64 64}
!6 = !{!"", !7, i64 0, !9, i64 32, !7, i64 144, !7, i64 145}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!"", !7, i64 0, !10, i64 32, !7, i64 40, !7, i64 104, !7, i64 105, !7, i64 106}
!10 = !{!"long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!6, !7, i64 138}
!14 = !{!9, !10, i64 32}
!15 = distinct !{!15, !12}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass