; LLVM IR from DanEngelbrecht/longtail :: lib/zstd/ext/compress (zstdmt_compress)

; 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.ZSTD_frameProgression = type { i64, i64, i64, i64, i32, i32 }
%struct.ZSTDMT_CCtx_s = type { ptr, ptr, ptr, ptr, ptr, %struct.ZSTD_CCtx_params_s, i64, i64, i32, %struct.inBuff_t, %struct.roundBuff_t, %struct.serialState_t, %struct.rsyncState_t, i32, i32, i32, i32, i32, i64, i64, i64, %struct.ZSTD_customMem, ptr, ptr, i8 }
%struct.ZSTD_CCtx_params_s = type { i32, %struct.ZSTD_compressionParameters, %struct.ZSTD_frameParameters, i32, i32, i64, i32, i32, i32, i32, i64, i32, i32, %struct.ldmParams_t, i32, i32, i32, i32, i32, i32, i32, i32, %struct.ZSTD_customMem, i32, i32, ptr, ptr, i64, i32 }
%struct.ZSTD_compressionParameters = type { i32, i32, i32, i32, i32, i32, i32 }
%struct.ZSTD_frameParameters = type { i32, i32, i32 }
%struct.ldmParams_t = type { i32, i32, i32, i32, i32, i32 }
%struct.inBuff_t = type { %struct.range_t, %struct.buffer_s, i64 }
%struct.range_t = type { ptr, i64 }
%struct.buffer_s = type { ptr, i64 }
%struct.roundBuff_t = type { ptr, i64, i64 }
%struct.serialState_t = type { i32, i32, %struct.ZSTD_CCtx_params_s, %struct.ldmState_t, %struct.XXH64_state_s, i32, i32, i32, %struct.ZSTD_window_t }
%struct.ldmState_t = type { %struct.ZSTD_window_t, ptr, i32, ptr, [64 x i64], [64 x %struct.ldmMatchCandidate_t] }
%struct.ldmMatchCandidate_t = type { ptr, i32, i32, ptr }
%struct.XXH64_state_s = type { i64, [4 x i64], [4 x i64], i32, i32, i64 }
%struct.ZSTD_window_t = type { ptr, ptr, ptr, i32, i32, i32 }
%struct.rsyncState_t = type { i64, i64, i64 }
%struct.ZSTD_customMem = type { ptr, ptr, ptr }
%struct.ZSTDMT_jobDescription = type { i64, i64, i32, i32, ptr, ptr, ptr, ptr, %struct.buffer_s, %struct.range_t, %struct.range_t, i32, i32, i32, %struct.ZSTD_CCtx_params_s, ptr, i64, i64, 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 void @ZSTDMT_getFrameProgression(ptr dead_on_unwind noalias writable sret(%struct.ZSTD_frameProgression) align 8 %0, ptr noundef %1) #1 {
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  store ptr %1, ptr %3, align 8, !tbaa !5
  br label %11

11:                                               ; preds = %2
  br label %12

12:                                               ; preds = %11
  %13 = load ptr, ptr %3, align 8, !tbaa !5
  %14 = getelementptr inbounds %struct.ZSTDMT_CCtx_s, ptr %13, i32 0, i32 19
  %15 = load i64, ptr %14, align 8, !tbaa !9
  %16 = load ptr, ptr %3, align 8, !tbaa !5
  %17 = getelementptr inbounds %struct.ZSTDMT_CCtx_s, ptr %16, i32 0, i32 9
  %18 = getelementptr inbounds %struct.inBuff_t, ptr %17, i32 0, i32 2
  %19 = load i64, ptr %18, align 8, !tbaa !28
  %20 = add i64 %15, %19
  %21 = getelementptr inbounds %struct.ZSTD_frameProgression, ptr %0, i32 0, i32 0
  store i64 %20, ptr %21, align 8, !tbaa !29
  %22 = load ptr, ptr %3, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.ZSTDMT_CCtx_s, ptr %22, i32 0, i32 19
  %24 = load i64, ptr %23, align 8, !tbaa !9
  %25 = getelementptr inbounds %struct.ZSTD_frameProgression, ptr %0, i32 0, i32 1
  store i64 %24, ptr %25, align 8, !tbaa !31
  %26 = load ptr, ptr %3, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.ZSTDMT_CCtx_s, ptr %26, i32 0, i32 20
  %28 = load i64, ptr %27, align 8, !tbaa !32
  %29 = getelementptr inbounds %struct.ZSTD_frameProgression, ptr %0, i32 0, i32 3
  store i64 %28, ptr %29, align 8, !tbaa !33
  %30 = getelementptr inbounds %struct.ZSTD_frameProgression, ptr %0, i32 0, i32 2
  store i64 %28, ptr %30, align 8, !tbaa !34
  %31 = load ptr, ptr %3, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.ZSTDMT_CCtx_s, ptr %31, i32 0, i32 15
  %33 = load i32, ptr %32, align 8, !tbaa !35
  %34 = getelementptr inbounds %struct.ZSTD_frameProgression, ptr %0, i32 0, i32 4
  store i32 %33, ptr %34, align 8, !tbaa !36
  %35 = getelementptr inbounds %struct.ZSTD_frameProgression, ptr %0, i32 0, i32 5
  store i32 0, ptr %35, align 4, !tbaa !37
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #2
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #2
  %36 = load ptr, ptr %3, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.ZSTDMT_CCtx_s, ptr %36, i32 0, i32 15
  %38 = load i32, ptr %37, align 8, !tbaa !35
  %39 = load ptr, ptr %3, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.ZSTDMT_CCtx_s, ptr %39, i32 0, i32 8
  %41 = load i32, ptr %40, align 8, !tbaa !38
  %42 = add i32 %38, %41
  store i32 %42, ptr %5, align 4, !tbaa !39
  br label %43

43:                                               ; preds = %12
  br label %44

44:                                               ; preds = %43
  br label %45

45:                                               ; preds = %44
  %46 = load ptr, ptr %3, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.ZSTDMT_CCtx_s, ptr %46, i32 0, i32 14
  %48 = load i32, ptr %47, align 4, !tbaa !40
  store i32 %48, ptr %4, align 4, !tbaa !39
  br label %49

49:                                               ; preds = %128, %45
  %50 = load i32, ptr %4, align 4, !tbaa !39
  %51 = load i32, ptr %5, align 4, !tbaa !39
  %52 = icmp ult i32 %50, %51
  br i1 %52, label %53, label %131

53:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #2
  %54 = load i32, ptr %4, align 4, !tbaa !39
  %55 = load ptr, ptr %3, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.ZSTDMT_CCtx_s, ptr %55, i32 0, i32 13
  %57 = load i32, ptr %56, align 8, !tbaa !41
  %58 = and i32 %54, %57
  store i32 %58, ptr %6, align 4, !tbaa !39
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #2
  %59 = load ptr, ptr %3, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.ZSTDMT_CCtx_s, ptr %59, i32 0, i32 1
  %61 = load ptr, ptr %60, align 8, !tbaa !42
  %62 = load i32, ptr %6, align 4, !tbaa !39
  %63 = zext i32 %62 to i64
  %64 = getelementptr inbounds %struct.ZSTDMT_jobDescription, ptr %61, i64 %63
  store ptr %64, ptr %7, align 8, !tbaa !5
  %65 = load ptr, ptr %7, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.ZSTDMT_jobDescription, ptr %65, i32 0, i32 2
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #2
  %67 = load ptr, ptr %7, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.ZSTDMT_jobDescription, ptr %67, i32 0, i32 1
  %69 = load i64, ptr %68, align 8, !tbaa !43
  store i64 %69, ptr %8, align 8, !tbaa !45
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #2
  %70 = load i64, ptr %8, align 8, !tbaa !45
  %71 = call i32 @ERR_isError(i64 noundef %70)
  %72 = icmp ne i32 %71, 0
  br i1 %72, label %73, label %74

73:                                               ; preds = %53
  br label %76

74:                                               ; preds = %53
  %75 = load i64, ptr %8, align 8, !tbaa !45
  br label %76

76:                                               ; preds = %74, %73
  %77 = phi i64 [ 0, %73 ], [ %75, %74 ]
  store i64 %77, ptr %9, align 8, !tbaa !45
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #2
  %78 = load i64, ptr %8, align 8, !tbaa !45
  %79 = call i32 @ERR_isError(i64 noundef %78)
  %80 = icmp ne i32 %79, 0
  br i1 %80, label %81, label %82

81:                                               ; preds = %76
  br label %86

82:                                               ; preds = %76
  %83 = load ptr, ptr %7, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.ZSTDMT_jobDescription, ptr %83, i32 0, i32 17
  %85 = load i64, ptr %84, align 8, !tbaa !46
  br label %86

86:                                               ; preds = %82, %81
  %87 = phi i64 [ 0, %81 ], [ %85, %82 ]
  store i64 %87, ptr %10, align 8, !tbaa !45
  %88 = load ptr, ptr %7, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.ZSTDMT_jobDescription, ptr %88, i32 0, i32 10
  %90 = getelementptr inbounds %struct.range_t, ptr %89, i32 0, i32 1
  %91 = load i64, ptr %90, align 8, !tbaa !47
  %92 = getelementptr inbounds %struct.ZSTD_frameProgression, ptr %0, i32 0, i32 0
  %93 = load i64, ptr %92, align 8, !tbaa !29
  %94 = add i64 %93, %91
  store i64 %94, ptr %92, align 8, !tbaa !29
  %95 = load ptr, ptr %7, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.ZSTDMT_jobDescription, ptr %95, i32 0, i32 0
  %97 = load i64, ptr %96, align 8, !tbaa !48
  %98 = getelementptr inbounds %struct.ZSTD_frameProgression, ptr %0, i32 0, i32 1
  %99 = load i64, ptr %98, align 8, !tbaa !31
  %100 = add i64 %99, %97
  store i64 %100, ptr %98, align 8, !tbaa !31
  %101 = load i64, ptr %9, align 8, !tbaa !45
  %102 = getelementptr inbounds %struct.ZSTD_frameProgression, ptr %0, i32 0, i32 2
  %103 = load i64, ptr %102, align 8, !tbaa !34
  %104 = add i64 %103, %101
  store i64 %104, ptr %102, align 8, !tbaa !34
  %105 = load i64, ptr %10, align 8, !tbaa !45
  %106 = getelementptr inbounds %struct.ZSTD_frameProgression, ptr %0, i32 0, i32 3
  %107 = load i64, ptr %106, align 8, !tbaa !33
  %108 = add i64 %107, %105
  store i64 %108, ptr %106, align 8, !tbaa !33
  %109 = load ptr, ptr %7, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.ZSTDMT_jobDescription, ptr %109, i32 0, i32 0
  %111 = load i64, ptr %110, align 8, !tbaa !48
  %112 = load ptr, ptr %7, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.ZSTDMT_jobDescription, ptr %112, i32 0, i32 10
  %114 = getelementptr inbounds %struct.range_t, ptr %113, i32 0, i32 1
  %115 = load i64, ptr %114, align 8, !tbaa !47
  %116 = icmp ult i64 %111, %115
  %117 = zext i1 %116 to i32
  %118 = getelementptr inbounds %struct.ZSTD_frameProgression, ptr %0, i32 0, i32 5
  %119 = load i32, ptr %118, align 4, !tbaa !37
  %120 = add i32 %119, %117
  store i32 %120, ptr %118, align 4, !tbaa !37
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #2
  %121 = load ptr, ptr %3, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.ZSTDMT_CCtx_s, ptr %121, i32 0, i32 1
  %123 = load ptr, ptr %122, align 8, !tbaa !42
  %124 = load i32, ptr %6, align 4, !tbaa !39
  %125 = zext i32 %124 to i64
  %126 = getelementptr inbounds %struct.ZSTDMT_jobDescription, ptr %123, i64 %125
  %127 = getelementptr inbounds %struct.ZSTDMT_jobDescription, ptr %126, i32 0, i32 2
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #2
  br label %128

128:                                              ; preds = %86
  %129 = load i32, ptr %4, align 4, !tbaa !39
  %130 = add i32 %129, 1
  store i32 %130, ptr %4, align 4, !tbaa !39
  br label %49, !llvm.loop !49

131:                                              ; preds = %49
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #2
  ret void
}

; Function Attrs: nounwind uwtable
declare hidden i32 @ERR_isError(i64 noundef) #1

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 = { 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, !27, i64 2880}
!10 = !{!"ZSTDMT_CCtx_s", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !11, i64 40, !15, i64 256, !15, i64 264, !12, i64 272, !18, i64 280, !21, i64 320, !22, i64 344, !26, i64 2824, !12, i64 2848, !12, i64 2852, !12, i64 2856, !12, i64 2860, !12, i64 2864, !27, i64 2872, !27, i64 2880, !27, i64 2888, !17, i64 2896, !6, i64 2920, !6, i64 2928, !12, i64 2936}
!11 = !{!"ZSTD_CCtx_params_s", !12, i64 0, !13, i64 4, !14, i64 32, !12, i64 44, !12, i64 48, !15, i64 56, !12, i64 64, !12, i64 68, !12, i64 72, !12, i64 76, !15, i64 80, !12, i64 88, !12, i64 92, !16, i64 96, !12, i64 120, !12, i64 124, !12, i64 128, !12, i64 132, !12, i64 136, !12, i64 140, !12, i64 144, !12, i64 148, !17, i64 152, !12, i64 176, !12, i64 180, !6, i64 184, !6, i64 192, !15, i64 200, !12, i64 208}
!12 = !{!"int", !7, i64 0}
!13 = !{!"", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20, !12, i64 24}
!14 = !{!"", !12, i64 0, !12, i64 4, !12, i64 8}
!15 = !{!"long", !7, i64 0}
!16 = !{!"", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20}
!17 = !{!"", !6, i64 0, !6, i64 8, !6, i64 16}
!18 = !{!"", !19, i64 0, !20, i64 16, !15, i64 32}
!19 = !{!"", !6, i64 0, !15, i64 8}
!20 = !{!"buffer_s", !6, i64 0, !15, i64 8}
!21 = !{!"", !6, i64 0, !15, i64 8, !15, i64 16}
!22 = !{!"", !12, i64 0, !12, i64 4, !11, i64 8, !23, i64 224, !25, i64 2336, !12, i64 2424, !12, i64 2428, !12, i64 2432, !24, i64 2440}
!23 = !{!"", !24, i64 0, !6, i64 40, !12, i64 48, !6, i64 56, !7, i64 64, !7, i64 576}
!24 = !{!"", !6, i64 0, !6, i64 8, !6, i64 16, !12, i64 24, !12, i64 28, !12, i64 32}
!25 = !{!"XXH64_state_s", !15, i64 0, !7, i64 8, !7, i64 40, !12, i64 72, !12, i64 76, !15, i64 80}
!26 = !{!"", !15, i64 0, !15, i64 8, !15, i64 16}
!27 = !{!"long long", !7, i64 0}
!28 = !{!10, !15, i64 312}
!29 = !{!30, !27, i64 0}
!30 = !{!"", !27, i64 0, !27, i64 8, !27, i64 16, !27, i64 24, !12, i64 32, !12, i64 36}
!31 = !{!30, !27, i64 8}
!32 = !{!10, !27, i64 2888}
!33 = !{!30, !27, i64 24}
!34 = !{!30, !27, i64 16}
!35 = !{!10, !12, i64 2856}
!36 = !{!30, !12, i64 32}
!37 = !{!30, !12, i64 36}
!38 = !{!10, !12, i64 272}
!39 = !{!12, !12, i64 0}
!40 = !{!10, !12, i64 2852}
!41 = !{!10, !12, i64 2848}
!42 = !{!10, !6, i64 8}
!43 = !{!44, !15, i64 8}
!44 = !{!"", !15, i64 0, !15, i64 8, !12, i64 16, !12, i64 20, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !20, i64 56, !19, i64 72, !19, i64 88, !12, i64 104, !12, i64 108, !12, i64 112, !11, i64 120, !6, i64 336, !27, i64 344, !15, i64 352, !12, i64 360}
!45 = !{!15, !15, i64 0}
!46 = !{!44, !15, i64 352}
!47 = !{!44, !15, i64 96}
!48 = !{!44, !15, i64 0}
!49 = distinct !{!49, !50}
!50 = !{!"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.ZSTD_frameProgression = type { i64, i64, i64, i64, i32, i32 }
%struct.ZSTDMT_jobDescription = type { i64, i64, i32, i32, ptr, ptr, ptr, ptr, %struct.buffer_s, %struct.range_t, %struct.range_t, i32, i32, i32, %struct.ZSTD_CCtx_params_s, ptr, i64, i64, i32 }
%struct.buffer_s = type { ptr, i64 }
%struct.range_t = type { ptr, i64 }
%struct.ZSTD_CCtx_params_s = type { i32, %struct.ZSTD_compressionParameters, %struct.ZSTD_frameParameters, i32, i32, i64, i32, i32, i32, i32, i64, i32, i32, %struct.ldmParams_t, i32, i32, i32, i32, i32, i32, i32, i32, %struct.ZSTD_customMem, i32, i32, ptr, ptr, i64, i32 }
%struct.ZSTD_compressionParameters = type { i32, i32, i32, i32, i32, i32, i32 }
%struct.ZSTD_frameParameters = type { i32, i32, i32 }
%struct.ldmParams_t = type { i32, i32, i32, i32, i32, i32 }
%struct.ZSTD_customMem = type { ptr, ptr, ptr }

; Function Attrs: nounwind uwtable
define dso_local void @ZSTDMT_getFrameProgression(ptr dead_on_unwind noalias nocapture writable writeonly sret(%struct.ZSTD_frameProgression) align 8 %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 {
  %3 = getelementptr inbounds i8, ptr %1, i64 2880
  %4 = load i64, ptr %3, align 8, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %1, i64 312
  %6 = load i64, ptr %5, align 8, !tbaa !27
  %7 = add i64 %6, %4
  %8 = getelementptr inbounds i8, ptr %1, i64 2888
  %9 = load i64, ptr %8, align 8, !tbaa !28
  %10 = getelementptr inbounds i8, ptr %1, i64 2856
  %11 = load i32, ptr %10, align 8, !tbaa !29
  %12 = getelementptr inbounds i8, ptr %0, i64 32
  store i32 %11, ptr %12, align 8, !tbaa !30
  %13 = getelementptr inbounds i8, ptr %1, i64 272
  %14 = load i32, ptr %13, align 8, !tbaa !32
  %15 = add i32 %14, %11
  %16 = getelementptr inbounds i8, ptr %1, i64 2852
  %17 = load i32, ptr %16, align 4, !tbaa !33
  %18 = icmp ult i32 %17, %15
  br i1 %18, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %2
  %19 = getelementptr inbounds i8, ptr %1, i64 2848
  %20 = getelementptr inbounds i8, ptr %1, i64 8
  br label %21

21:                                               ; preds = %.lr.ph, %40
  %.037 = phi i32 [ %17, %.lr.ph ], [ %52, %40 ]
  %22 = phi i64 [ %7, %.lr.ph ], [ %44, %40 ]
  %23 = phi i64 [ %4, %.lr.ph ], [ %46, %40 ]
  %24 = phi i64 [ %9, %.lr.ph ], [ %47, %40 ]
  %25 = phi i64 [ %9, %.lr.ph ], [ %48, %40 ]
  %26 = phi i32 [ 0, %.lr.ph ], [ %51, %40 ]
  %27 = load i32, ptr %19, align 8, !tbaa !34
  %28 = and i32 %27, %.037
  %29 = load ptr, ptr %20, align 8, !tbaa !35
  %30 = zext i32 %28 to i64
  %31 = getelementptr inbounds %struct.ZSTDMT_jobDescription, ptr %29, i64 %30
  %32 = getelementptr inbounds i8, ptr %31, i64 8
  %33 = load i64, ptr %32, align 8, !tbaa !36
  %34 = tail call i32 @ERR_isError(i64 noundef %33)
  %.not = icmp eq i32 %34, 0
  %35 = select i1 %.not, i64 %33, i64 0
  %36 = tail call i32 @ERR_isError(i64 noundef %33)
  %.not28 = icmp eq i32 %36, 0
  br i1 %.not28, label %37, label %40

37:                                               ; preds = %21
  %38 = getelementptr inbounds i8, ptr %31, i64 352
  %39 = load i64, ptr %38, align 8, !tbaa !38
  br label %40

40:                                               ; preds = %21, %37
  %41 = phi i64 [ %39, %37 ], [ 0, %21 ]
  %42 = getelementptr inbounds i8, ptr %31, i64 96
  %43 = load i64, ptr %42, align 8, !tbaa !39
  %44 = add i64 %22, %43
  %45 = load i64, ptr %31, align 8, !tbaa !40
  %46 = add i64 %23, %45
  %47 = add i64 %24, %35
  %48 = add i64 %25, %41
  %49 = icmp ult i64 %45, %43
  %50 = zext i1 %49 to i32
  %51 = add i32 %26, %50
  %52 = add i32 %.037, 1
  %exitcond.not = icmp eq i32 %52, %15
  br i1 %exitcond.not, label %._crit_edge, label %21, !llvm.loop !41

._crit_edge:                                      ; preds = %40, %2
  %.lcssa36 = phi i32 [ 0, %2 ], [ %51, %40 ]
  %.lcssa34 = phi i64 [ %9, %2 ], [ %48, %40 ]
  %.lcssa32 = phi i64 [ %9, %2 ], [ %47, %40 ]
  %.lcssa30 = phi i64 [ %4, %2 ], [ %46, %40 ]
  %.lcssa = phi i64 [ %7, %2 ], [ %44, %40 ]
  %53 = getelementptr inbounds i8, ptr %0, i64 36
  %54 = getelementptr inbounds i8, ptr %0, i64 16
  %55 = getelementptr inbounds i8, ptr %0, i64 24
  %56 = getelementptr inbounds i8, ptr %0, i64 8
  store i64 %.lcssa, ptr %0, align 8, !tbaa !43
  store i64 %.lcssa30, ptr %56, align 8, !tbaa !44
  store i64 %.lcssa32, ptr %54, align 8, !tbaa !45
  store i64 %.lcssa34, ptr %55, align 8, !tbaa !46
  store i32 %.lcssa36, ptr %53, align 4, !tbaa !47
  ret void
}

; Function Attrs: nounwind uwtable
declare hidden i32 @ERR_isError(i64 noundef) local_unnamed_addr #0

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

!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, !26, i64 2880}
!6 = !{!"ZSTDMT_CCtx_s", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !10, i64 40, !14, i64 256, !14, i64 264, !11, i64 272, !17, i64 280, !20, i64 320, !21, i64 344, !25, i64 2824, !11, i64 2848, !11, i64 2852, !11, i64 2856, !11, i64 2860, !11, i64 2864, !26, i64 2872, !26, i64 2880, !26, i64 2888, !16, i64 2896, !7, i64 2920, !7, i64 2928, !11, i64 2936}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"ZSTD_CCtx_params_s", !11, i64 0, !12, i64 4, !13, i64 32, !11, i64 44, !11, i64 48, !14, i64 56, !11, i64 64, !11, i64 68, !11, i64 72, !11, i64 76, !14, i64 80, !11, i64 88, !11, i64 92, !15, i64 96, !11, i64 120, !11, i64 124, !11, i64 128, !11, i64 132, !11, i64 136, !11, i64 140, !11, i64 144, !11, i64 148, !16, i64 152, !11, i64 176, !11, i64 180, !7, i64 184, !7, i64 192, !14, i64 200, !11, i64 208}
!11 = !{!"int", !8, i64 0}
!12 = !{!"", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24}
!13 = !{!"", !11, i64 0, !11, i64 4, !11, i64 8}
!14 = !{!"long", !8, i64 0}
!15 = !{!"", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20}
!16 = !{!"", !7, i64 0, !7, i64 8, !7, i64 16}
!17 = !{!"", !18, i64 0, !19, i64 16, !14, i64 32}
!18 = !{!"", !7, i64 0, !14, i64 8}
!19 = !{!"buffer_s", !7, i64 0, !14, i64 8}
!20 = !{!"", !7, i64 0, !14, i64 8, !14, i64 16}
!21 = !{!"", !11, i64 0, !11, i64 4, !10, i64 8, !22, i64 224, !24, i64 2336, !11, i64 2424, !11, i64 2428, !11, i64 2432, !23, i64 2440}
!22 = !{!"", !23, i64 0, !7, i64 40, !11, i64 48, !7, i64 56, !8, i64 64, !8, i64 576}
!23 = !{!"", !7, i64 0, !7, i64 8, !7, i64 16, !11, i64 24, !11, i64 28, !11, i64 32}
!24 = !{!"XXH64_state_s", !14, i64 0, !8, i64 8, !8, i64 40, !11, i64 72, !11, i64 76, !14, i64 80}
!25 = !{!"", !14, i64 0, !14, i64 8, !14, i64 16}
!26 = !{!"long long", !8, i64 0}
!27 = !{!6, !14, i64 312}
!28 = !{!6, !26, i64 2888}
!29 = !{!6, !11, i64 2856}
!30 = !{!31, !11, i64 32}
!31 = !{!"", !26, i64 0, !26, i64 8, !26, i64 16, !26, i64 24, !11, i64 32, !11, i64 36}
!32 = !{!6, !11, i64 272}
!33 = !{!6, !11, i64 2852}
!34 = !{!6, !11, i64 2848}
!35 = !{!6, !7, i64 8}
!36 = !{!37, !14, i64 8}
!37 = !{!"", !14, i64 0, !14, i64 8, !11, i64 16, !11, i64 20, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !19, i64 56, !18, i64 72, !18, i64 88, !11, i64 104, !11, i64 108, !11, i64 112, !10, i64 120, !7, i64 336, !26, i64 344, !14, i64 352, !11, i64 360}
!38 = !{!37, !14, i64 352}
!39 = !{!37, !14, i64 96}
!40 = !{!37, !14, i64 0}
!41 = distinct !{!41, !42}
!42 = !{!"llvm.loop.mustprogress"}
!43 = !{!31, !26, i64 0}
!44 = !{!31, !26, i64 8}
!45 = !{!31, !26, i64 16}
!46 = !{!31, !26, i64 24}
!47 = !{!31, !11, i64 36}


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