; LLVM IR from lzfse/lzfse :: src (lzfse_encode)

; 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.lzvn_compressed_block_header = type { i32, i32, i32 }
%struct.uncompressed_block_header = type { i32, i32 }
%struct.lzfse_encoder_state = type { ptr, i64, i64, i64, i64, ptr, ptr, ptr, %struct.lzfse_match, i32, i32, [10000 x i32], [10000 x i32], [10000 x i32], [40000 x i8], [16384 x %struct.lzfse_history_set] }
%struct.lzfse_match = type { i64, i64, i32 }
%struct.lzfse_history_set = type { [4 x i32], [4 x i32] }

; 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 i64 @lzfse_encode_buffer_with_scratch(ptr noalias noundef %0, i64 noundef %1, ptr noalias noundef %2, i64 noundef %3, ptr noalias noundef %4) #1 {
  %6 = alloca i64, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i64, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i64, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca %struct.lzvn_compressed_block_header, align 4
  %16 = alloca i32, align 4
  %17 = alloca ptr, align 8
  %18 = alloca i64, align 8
  %19 = alloca %struct.uncompressed_block_header, align 4
  %20 = alloca ptr, align 8
  store ptr %0, ptr %7, align 8, !tbaa !5
  store i64 %1, ptr %8, align 8, !tbaa !9
  store ptr %2, ptr %9, align 8, !tbaa !5
  store i64 %3, ptr %10, align 8, !tbaa !9
  store ptr %4, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %21 = load i64, ptr %10, align 8, !tbaa !9
  store i64 %21, ptr %12, align 8, !tbaa !9
  %22 = load i64, ptr %10, align 8, !tbaa !9
  %23 = icmp ult i64 %22, 8
  br i1 %23, label %24, label %25

24:                                               ; preds = %5
  br label %152

25:                                               ; preds = %5
  %26 = load i64, ptr %10, align 8, !tbaa !9
  %27 = icmp ult i64 %26, 4096
  br i1 %27, label %28, label %69

28:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  store i64 16, ptr %13, align 8, !tbaa !9
  %29 = load i64, ptr %8, align 8, !tbaa !9
  %30 = load i64, ptr %13, align 8, !tbaa !9
  %31 = icmp ule i64 %29, %30
  br i1 %31, label %32, label %33

32:                                               ; preds = %28
  store i32 2, ptr %16, align 4
  br label %67

33:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %34 = load ptr, ptr %7, align 8, !tbaa !5
  %35 = getelementptr inbounds i8, ptr %34, i64 12
  %36 = load i64, ptr %8, align 8, !tbaa !9
  %37 = load i64, ptr %13, align 8, !tbaa !9
  %38 = sub i64 %36, %37
  %39 = load ptr, ptr %9, align 8, !tbaa !5
  %40 = load i64, ptr %10, align 8, !tbaa !9
  %41 = load ptr, ptr %11, align 8, !tbaa !5
  %42 = call i64 @lzvn_encode_buffer(ptr noundef %35, i64 noundef %38, ptr noundef %39, i64 noundef %40, ptr noundef %41)
  store i64 %42, ptr %14, align 8, !tbaa !9
  %43 = load i64, ptr %14, align 8, !tbaa !9
  %44 = icmp eq i64 %43, 0
  br i1 %44, label %49, label %45

45:                                               ; preds = %33
  %46 = load i64, ptr %14, align 8, !tbaa !9
  %47 = load i64, ptr %10, align 8, !tbaa !9
  %48 = icmp uge i64 %46, %47
  br i1 %48, label %49, label %50

49:                                               ; preds = %45, %33
  store i32 2, ptr %16, align 4
  br label %66

50:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 12, ptr %15) #6
  %51 = getelementptr inbounds %struct.lzvn_compressed_block_header, ptr %15, i32 0, i32 0
  store i32 1853388386, ptr %51, align 4, !tbaa !11
  %52 = load i64, ptr %10, align 8, !tbaa !9
  %53 = trunc i64 %52 to i32
  %54 = getelementptr inbounds %struct.lzvn_compressed_block_header, ptr %15, i32 0, i32 1
  store i32 %53, ptr %54, align 4, !tbaa !14
  %55 = load i64, ptr %14, align 8, !tbaa !9
  %56 = trunc i64 %55 to i32
  %57 = getelementptr inbounds %struct.lzvn_compressed_block_header, ptr %15, i32 0, i32 2
  store i32 %56, ptr %57, align 4, !tbaa !15
  %58 = load ptr, ptr %7, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %58, ptr align 4 %15, i64 12, i1 false)
  %59 = load ptr, ptr %7, align 8, !tbaa !5
  %60 = getelementptr inbounds i8, ptr %59, i64 12
  %61 = load i64, ptr %14, align 8, !tbaa !9
  %62 = getelementptr inbounds i8, ptr %60, i64 %61
  call void @store4(ptr noundef %62, i32 noundef 611874402)
  %63 = load i64, ptr %14, align 8, !tbaa !9
  %64 = load i64, ptr %13, align 8, !tbaa !9
  %65 = add i64 %63, %64
  store i64 %65, ptr %6, align 8
  store i32 1, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 12, ptr %15) #6
  br label %66

66:                                               ; preds = %50, %49
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  br label %67

67:                                               ; preds = %66, %32
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  %68 = load i32, ptr %16, align 4
  switch i32 %68, label %184 [
    i32 2, label %152
  ]

69:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  %70 = load ptr, ptr %11, align 8, !tbaa !5
  store ptr %70, ptr %17, align 8, !tbaa !5
  %71 = load ptr, ptr %17, align 8, !tbaa !5
  call void @llvm.memset.p0.i64(ptr align 8 %71, i8 0, i64 684384, i1 false)
  %72 = load ptr, ptr %17, align 8, !tbaa !5
  %73 = call i32 @lzfse_encode_init(ptr noundef %72)
  %74 = icmp ne i32 %73, 0
  br i1 %74, label %75, label %76

75:                                               ; preds = %69
  store i32 2, ptr %16, align 4
  br label %150

76:                                               ; preds = %69
  %77 = load ptr, ptr %7, align 8, !tbaa !5
  %78 = load ptr, ptr %17, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.lzfse_encoder_state, ptr %78, i32 0, i32 5
  store ptr %77, ptr %79, align 8, !tbaa !16
  %80 = load ptr, ptr %7, align 8, !tbaa !5
  %81 = load ptr, ptr %17, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.lzfse_encoder_state, ptr %81, i32 0, i32 6
  store ptr %80, ptr %82, align 8, !tbaa !19
  %83 = load ptr, ptr %7, align 8, !tbaa !5
  %84 = load i64, ptr %8, align 8, !tbaa !9
  %85 = getelementptr inbounds i8, ptr %83, i64 %84
  %86 = load ptr, ptr %17, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.lzfse_encoder_state, ptr %86, i32 0, i32 7
  store ptr %85, ptr %87, align 8, !tbaa !20
  %88 = load ptr, ptr %9, align 8, !tbaa !5
  %89 = load ptr, ptr %17, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.lzfse_encoder_state, ptr %89, i32 0, i32 0
  store ptr %88, ptr %90, align 8, !tbaa !21
  %91 = load ptr, ptr %17, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.lzfse_encoder_state, ptr %91, i32 0, i32 3
  store i64 0, ptr %92, align 8, !tbaa !22
  %93 = load i64, ptr %10, align 8, !tbaa !9
  %94 = icmp uge i64 %93, 4294967295
  br i1 %94, label %95, label %128

95:                                               ; preds = %76
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  store i64 262144, ptr %18, align 8, !tbaa !9
  %96 = load ptr, ptr %17, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.lzfse_encoder_state, ptr %96, i32 0, i32 1
  store i64 262144, ptr %97, align 8, !tbaa !23
  %98 = load ptr, ptr %17, align 8, !tbaa !5
  %99 = call i32 @lzfse_encode_base(ptr noundef %98)
  %100 = icmp ne i32 %99, 0
  br i1 %100, label %101, label %102

101:                                              ; preds = %95
  store i32 2, ptr %16, align 4
  br label %125

102:                                              ; preds = %95
  %103 = load i64, ptr %10, align 8, !tbaa !9
  %104 = sub i64 %103, 262144
  store i64 %104, ptr %10, align 8, !tbaa !9
  br label %105

105:                                              ; preds = %115, %102
  %106 = load i64, ptr %10, align 8, !tbaa !9
  %107 = icmp uge i64 %106, 262144
  br i1 %107, label %108, label %120

108:                                              ; preds = %105
  %109 = load ptr, ptr %17, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.lzfse_encoder_state, ptr %109, i32 0, i32 1
  store i64 524288, ptr %110, align 8, !tbaa !23
  %111 = load ptr, ptr %17, align 8, !tbaa !5
  %112 = call i32 @lzfse_encode_base(ptr noundef %111)
  %113 = icmp ne i32 %112, 0
  br i1 %113, label %114, label %115

114:                                              ; preds = %108
  store i32 2, ptr %16, align 4
  br label %125

115:                                              ; preds = %108
  %116 = load ptr, ptr %17, align 8, !tbaa !5
  %117 = call i32 @lzfse_encode_translate(ptr noundef %116, i64 noundef 262144)
  %118 = load i64, ptr %10, align 8, !tbaa !9
  %119 = sub i64 %118, 262144
  store i64 %119, ptr %10, align 8, !tbaa !9
  br label %105, !llvm.loop !24

120:                                              ; preds = %105
  %121 = load i64, ptr %10, align 8, !tbaa !9
  %122 = add nsw i64 262144, %121
  %123 = load ptr, ptr %17, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.lzfse_encoder_state, ptr %123, i32 0, i32 1
  store i64 %122, ptr %124, align 8, !tbaa !23
  store i32 0, ptr %16, align 4
  br label %125

125:                                              ; preds = %120, %114, %101
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  %126 = load i32, ptr %16, align 4
  switch i32 %126, label %150 [
    i32 0, label %127
  ]

127:                                              ; preds = %125
  br label %132

128:                                              ; preds = %76
  %129 = load i64, ptr %10, align 8, !tbaa !9
  %130 = load ptr, ptr %17, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.lzfse_encoder_state, ptr %130, i32 0, i32 1
  store i64 %129, ptr %131, align 8, !tbaa !23
  br label %132

132:                                              ; preds = %128, %127
  %133 = load ptr, ptr %17, align 8, !tbaa !5
  %134 = call i32 @lzfse_encode_base(ptr noundef %133)
  %135 = icmp ne i32 %134, 0
  br i1 %135, label %136, label %137

136:                                              ; preds = %132
  store i32 2, ptr %16, align 4
  br label %150

137:                                              ; preds = %132
  %138 = load ptr, ptr %17, align 8, !tbaa !5
  %139 = call i32 @lzfse_encode_finish(ptr noundef %138)
  %140 = icmp ne i32 %139, 0
  br i1 %140, label %141, label %142

141:                                              ; preds = %137
  store i32 2, ptr %16, align 4
  br label %150

142:                                              ; preds = %137
  %143 = load ptr, ptr %17, align 8, !tbaa !5
  %144 = getelementptr inbounds %struct.lzfse_encoder_state, ptr %143, i32 0, i32 5
  %145 = load ptr, ptr %144, align 8, !tbaa !16
  %146 = load ptr, ptr %7, align 8, !tbaa !5
  %147 = ptrtoint ptr %145 to i64
  %148 = ptrtoint ptr %146 to i64
  %149 = sub i64 %147, %148
  store i64 %149, ptr %6, align 8
  store i32 1, ptr %16, align 4
  br label %150

150:                                              ; preds = %142, %141, %136, %125, %75
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  %151 = load i32, ptr %16, align 4
  switch i32 %151, label %184 [
    i32 2, label %152
  ]

152:                                              ; preds = %150, %67, %24
  %153 = load i64, ptr %12, align 8, !tbaa !9
  %154 = add i64 %153, 12
  %155 = load i64, ptr %8, align 8, !tbaa !9
  %156 = icmp ule i64 %154, %155
  br i1 %156, label %157, label %183

157:                                              ; preds = %152
  %158 = load i64, ptr %12, align 8, !tbaa !9
  %159 = icmp ult i64 %158, 2147483647
  br i1 %159, label %160, label %183

160:                                              ; preds = %157
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  %161 = getelementptr inbounds %struct.uncompressed_block_header, ptr %19, i32 0, i32 0
  store i32 762869346, ptr %161, align 4, !tbaa !26
  %162 = getelementptr inbounds %struct.uncompressed_block_header, ptr %19, i32 0, i32 1
  %163 = load i64, ptr %10, align 8, !tbaa !9
  %164 = trunc i64 %163 to i32
  store i32 %164, ptr %162, align 4, !tbaa !28
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #6
  %165 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %165, ptr %20, align 8, !tbaa !5
  %166 = load ptr, ptr %20, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %166, ptr align 4 %19, i64 8, i1 false)
  %167 = load ptr, ptr %20, align 8, !tbaa !5
  %168 = getelementptr inbounds i8, ptr %167, i64 8
  store ptr %168, ptr %20, align 8, !tbaa !5
  %169 = load ptr, ptr %20, align 8, !tbaa !5
  %170 = load ptr, ptr %9, align 8, !tbaa !5
  %171 = load i64, ptr %12, align 8, !tbaa !9
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %169, ptr align 1 %170, i64 %171, i1 false)
  %172 = load i64, ptr %12, align 8, !tbaa !9
  %173 = load ptr, ptr %20, align 8, !tbaa !5
  %174 = getelementptr inbounds i8, ptr %173, i64 %172
  store ptr %174, ptr %20, align 8, !tbaa !5
  %175 = load ptr, ptr %20, align 8, !tbaa !5
  call void @store4(ptr noundef %175, i32 noundef 611874402)
  %176 = load ptr, ptr %20, align 8, !tbaa !5
  %177 = getelementptr inbounds i8, ptr %176, i64 4
  store ptr %177, ptr %20, align 8, !tbaa !5
  %178 = load ptr, ptr %20, align 8, !tbaa !5
  %179 = load ptr, ptr %7, align 8, !tbaa !5
  %180 = ptrtoint ptr %178 to i64
  %181 = ptrtoint ptr %179 to i64
  %182 = sub i64 %180, %181
  store i64 %182, ptr %6, align 8
  store i32 1, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  br label %184

183:                                              ; preds = %157, %152
  store i64 0, ptr %6, align 8
  store i32 1, ptr %16, align 4
  br label %184

184:                                              ; preds = %183, %160, %150, %67
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  %185 = load i64, ptr %6, align 8
  ret i64 %185
}

declare i64 @lzvn_encode_buffer(ptr noundef, i64 noundef, ptr noundef, i64 noundef, ptr noundef) #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: alwaysinline nounwind uwtable
declare hidden void @store4(ptr noundef, i32 noundef) #4

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

declare i32 @lzfse_encode_init(ptr noundef) #2

declare i32 @lzfse_encode_base(ptr noundef) #2

declare i32 @lzfse_encode_translate(ptr noundef, i64 noundef) #2

declare i32 @lzfse_encode_finish(ptr 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 = { "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 nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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, !13, i64 0}
!12 = !{!"", !13, i64 0, !13, i64 4, !13, i64 8}
!13 = !{!"int", !7, i64 0}
!14 = !{!12, !13, i64 4}
!15 = !{!12, !13, i64 8}
!16 = !{!17, !6, i64 40}
!17 = !{!"", !6, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !18, i64 64, !13, i64 88, !13, i64 92, !7, i64 96, !7, i64 40096, !7, i64 80096, !7, i64 120096, !7, i64 160096}
!18 = !{!"", !10, i64 0, !10, i64 8, !13, i64 16}
!19 = !{!17, !6, i64 48}
!20 = !{!17, !6, i64 56}
!21 = !{!17, !6, i64 0}
!22 = !{!17, !10, i64 24}
!23 = !{!17, !10, i64 8}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}
!26 = !{!27, !13, i64 0}
!27 = !{!"", !13, i64 0, !13, i64 4}
!28 = !{!27, !13, i64 4}


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

; Function Attrs: nounwind uwtable
define dso_local i64 @lzfse_encode_buffer_with_scratch(ptr noalias noundef %0, i64 noundef %1, ptr noalias noundef %2, i64 noundef %3, ptr noalias noundef %4) local_unnamed_addr #0 {
  %6 = icmp ult i64 %3, 8
  br i1 %6, label %.thread, label %7

7:                                                ; preds = %5
  %8 = icmp ult i64 %3, 4096
  br i1 %8, label %9, label %21

9:                                                ; preds = %7
  %10 = icmp ult i64 %1, 17
  br i1 %10, label %.thread, label %11

11:                                               ; preds = %9
  %12 = getelementptr inbounds i8, ptr %0, i64 12
  %13 = add i64 %1, -16
  %14 = tail call i64 @lzvn_encode_buffer(ptr noundef nonnull %12, i64 noundef %13, ptr noundef %2, i64 noundef %3, ptr noundef %4) #5
  %15 = icmp ne i64 %14, 0
  %.not92 = icmp ult i64 %14, %3
  %or.cond93 = and i1 %15, %.not92
  br i1 %or.cond93, label %16, label %.thread

16:                                               ; preds = %11
  %17 = trunc nuw nsw i64 %3 to i32
  %18 = trunc nuw nsw i64 %14 to i32
  store i32 1853388386, ptr %0, align 1
  %.sroa.430.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 4
  store i32 %17, ptr %.sroa.430.0..sroa_idx, align 1
  %.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 8
  store i32 %18, ptr %.sroa.5.0..sroa_idx, align 1
  %19 = getelementptr inbounds i8, ptr %12, i64 %14
  tail call void @store4(ptr noundef nonnull %19, i32 noundef 611874402)
  %20 = add nuw nsw i64 %14, 16
  br label %.thread.thread

21:                                               ; preds = %7
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(684384) %4, i8 0, i64 684384, i1 false)
  %22 = tail call i32 @lzfse_encode_init(ptr noundef %4) #5
  %.not = icmp eq i32 %22, 0
  br i1 %.not, label %23, label %.thread

23:                                               ; preds = %21
  %24 = getelementptr inbounds i8, ptr %4, i64 40
  store ptr %0, ptr %24, align 8, !tbaa !5
  %25 = getelementptr inbounds i8, ptr %4, i64 48
  store ptr %0, ptr %25, align 8, !tbaa !13
  %26 = getelementptr inbounds i8, ptr %0, i64 %1
  %27 = getelementptr inbounds i8, ptr %4, i64 56
  store ptr %26, ptr %27, align 8, !tbaa !14
  store ptr %2, ptr %4, align 8, !tbaa !15
  %28 = getelementptr inbounds i8, ptr %4, i64 24
  store i64 0, ptr %28, align 8, !tbaa !16
  %29 = icmp ugt i64 %3, 4294967294
  %30 = getelementptr inbounds i8, ptr %4, i64 8
  br i1 %29, label %31, label %38

31:                                               ; preds = %23
  store i64 262144, ptr %30, align 8, !tbaa !17
  %32 = tail call i32 @lzfse_encode_base(ptr noundef nonnull %4) #5
  %.not88 = icmp eq i32 %32, 0
  br i1 %.not88, label %.lr.ph.preheader, label %.thread.thread

.lr.ph.preheader:                                 ; preds = %31
  %.075110 = add i64 %3, -262144
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %34
  %.075111 = phi i64 [ %.075, %34 ], [ %.075110, %.lr.ph.preheader ]
  store i64 524288, ptr %30, align 8, !tbaa !17
  %33 = tail call i32 @lzfse_encode_base(ptr noundef nonnull %4) #5
  %.not89 = icmp eq i32 %33, 0
  br i1 %.not89, label %34, label %.thread

34:                                               ; preds = %.lr.ph
  %35 = tail call i32 @lzfse_encode_translate(ptr noundef nonnull %4, i64 noundef 262144) #5
  %.075 = add i64 %.075111, -262144
  %36 = icmp ugt i64 %.075, 262143
  br i1 %36, label %.lr.ph, label %._crit_edge, !llvm.loop !18

._crit_edge:                                      ; preds = %34
  %37 = or disjoint i64 %.075, 262144
  br label %38

38:                                               ; preds = %23, %._crit_edge
  %.sink = phi i64 [ %37, %._crit_edge ], [ %3, %23 ]
  %.277 = phi i64 [ %.075, %._crit_edge ], [ %3, %23 ]
  store i64 %.sink, ptr %30, align 8, !tbaa !17
  %39 = tail call i32 @lzfse_encode_base(ptr noundef nonnull %4) #5
  %.not90 = icmp eq i32 %39, 0
  br i1 %.not90, label %40, label %.thread

40:                                               ; preds = %38
  %41 = tail call i32 @lzfse_encode_finish(ptr noundef nonnull %4) #5
  %.not91 = icmp eq i32 %41, 0
  br i1 %.not91, label %42, label %.thread

42:                                               ; preds = %40
  %43 = load ptr, ptr %24, align 8, !tbaa !5
  %44 = ptrtoint ptr %43 to i64
  %45 = ptrtoint ptr %0 to i64
  %46 = sub i64 %44, %45
  br label %.thread.thread

.thread:                                          ; preds = %.lr.ph, %40, %38, %21, %11, %9, %5
  %.4 = phi i64 [ %3, %5 ], [ %3, %9 ], [ %3, %11 ], [ %.277, %40 ], [ %.277, %38 ], [ %3, %21 ], [ %.075111, %.lr.ph ]
  %47 = add i64 %3, 12
  %48 = icmp ule i64 %47, %1
  %49 = icmp ult i64 %3, 2147483647
  %or.cond = and i1 %49, %48
  br i1 %or.cond, label %50, label %.thread.thread

50:                                               ; preds = %.thread
  %51 = trunc i64 %.4 to i32
  store i32 762869346, ptr %0, align 1
  %.sroa.4.0..0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 4
  store i32 %51, ptr %.sroa.4.0..0..sroa_idx, align 1
  %52 = getelementptr inbounds i8, ptr %0, i64 8
  tail call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 1 %52, ptr align 1 %2, i64 %3, i1 false)
  %53 = getelementptr inbounds i8, ptr %52, i64 %3
  tail call void @store4(ptr noundef nonnull %53, i32 noundef 611874402)
  %54 = getelementptr inbounds i8, ptr %53, i64 4
  %55 = ptrtoint ptr %54 to i64
  %56 = ptrtoint ptr %0 to i64
  %57 = sub i64 %55, %56
  br label %.thread.thread

.thread.thread:                                   ; preds = %31, %42, %16, %.thread, %50
  %.3 = phi i64 [ %57, %50 ], [ %20, %16 ], [ %46, %42 ], [ 0, %.thread ], [ 0, %31 ]
  ret i64 %.3
}

declare i64 @lzvn_encode_buffer(ptr noundef, i64 noundef, ptr noundef, i64 noundef, ptr 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: alwaysinline nounwind uwtable
declare hidden void @store4(ptr noundef, i32 noundef) local_unnamed_addr #3

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

declare i32 @lzfse_encode_init(ptr noundef) local_unnamed_addr #1

declare i32 @lzfse_encode_base(ptr noundef) local_unnamed_addr #1

declare i32 @lzfse_encode_translate(ptr noundef, i64 noundef) local_unnamed_addr #1

declare i32 @lzfse_encode_finish(ptr noundef) local_unnamed_addr #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 = { "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 = { 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 #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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, !7, i64 40}
!6 = !{!"", !7, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !7, i64 40, !7, i64 48, !7, i64 56, !11, i64 64, !12, i64 88, !12, i64 92, !8, i64 96, !8, i64 40096, !8, i64 80096, !8, i64 120096, !8, i64 160096}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"long", !8, i64 0}
!11 = !{!"", !10, i64 0, !10, i64 8, !12, i64 16}
!12 = !{!"int", !8, i64 0}
!13 = !{!6, !7, i64 48}
!14 = !{!6, !7, i64 56}
!15 = !{!6, !7, i64 0}
!16 = !{!6, !10, i64 24}
!17 = !{!6, !10, i64 8}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}


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