; LLVM IR from indygreg/python-zstandard :: zstd (zstd)

; 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_CCtx_s = type { i32, i32, i32, %struct.ZSTD_CCtx_params_s, %struct.ZSTD_CCtx_params_s, %struct.ZSTD_CCtx_params_s, i32, i64, %struct.ZSTD_cwksp, i64, i64, i64, i64, %struct.XXH_NAMESPACEXXH64_state_s, %struct.ZSTD_customMem, ptr, i64, %struct.SeqCollector, i32, i32, %struct.seqStore_t, %struct.ldmState_t, ptr, i64, %struct.rawSeqStore_t, %struct.ZSTD_blockState_t, ptr, i32, ptr, i64, i64, i64, i64, ptr, i64, i64, i64, i32, i32, %struct.ZSTD_inBuffer_s, i64, i64, %struct.ZSTD_localDict, ptr, %struct.ZSTD_prefixDict_s, ptr, %struct.ZSTD_blockSplitCtx, 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_cwksp = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, i8, i32, i32, i32 }
%struct.XXH_NAMESPACEXXH64_state_s = type { i64, [4 x i64], [4 x i64], i32, i32, i64 }
%struct.ZSTD_customMem = type { ptr, ptr, ptr }
%struct.SeqCollector = type { i32, ptr, i64, i64 }
%struct.seqStore_t = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, i64, i64, i32, i32 }
%struct.ldmState_t = type { %struct.ZSTD_window_t, ptr, i32, ptr, [64 x i64], [64 x %struct.ldmMatchCandidate_t] }
%struct.ZSTD_window_t = type { ptr, ptr, ptr, i32, i32, i32 }
%struct.ldmMatchCandidate_t = type { ptr, i32, i32, ptr }
%struct.rawSeqStore_t = type { ptr, i64, i64, i64, i64 }
%struct.ZSTD_blockState_t = type { ptr, ptr, %struct.ZSTD_matchState_t }
%struct.ZSTD_matchState_t = type { %struct.ZSTD_window_t, i32, i32, i32, i32, ptr, [8 x i32], i64, i32, ptr, ptr, ptr, i32, i32, %struct.optState_t, ptr, %struct.ZSTD_compressionParameters, ptr, i32, i32 }
%struct.optState_t = type { ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i32, i32, i32, i32, i32, i32, i32, ptr, i32 }
%struct.ZSTD_inBuffer_s = type { ptr, i64, i64 }
%struct.ZSTD_localDict = type { ptr, ptr, i64, i32, ptr }
%struct.ZSTD_prefixDict_s = type { ptr, i64, i32 }
%struct.ZSTD_blockSplitCtx = type { %struct.seqStore_t, %struct.seqStore_t, %struct.seqStore_t, %struct.seqStore_t, %struct.seqStore_t, [196 x i32], %struct.ZSTD_entropyCTablesMetadata_t }
%struct.ZSTD_entropyCTablesMetadata_t = type { %struct.ZSTD_hufCTablesMetadata_t, %struct.ZSTD_fseCTablesMetadata_t }
%struct.ZSTD_hufCTablesMetadata_t = type { i32, [128 x i8], i64 }
%struct.ZSTD_fseCTablesMetadata_t = type { i32, i32, i32, [133 x i8], i64, i64 }

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

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

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

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

; Function Attrs: nounwind uwtable
declare hidden i64 @ZSTD_CCtx_init_compressStream2(ptr noundef, i32 noundef, i64 noundef) #0

; Function Attrs: nounwind uwtable
define dso_local i64 @ZSTD_compressSequences(ptr noundef %0, ptr noundef %1, i64 noundef %2, ptr noundef %3, i64 noundef %4, ptr noundef %5, i64 noundef %6) #0 {
  %8 = alloca i64, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i64, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i64, align 8
  %14 = alloca ptr, align 8
  %15 = alloca i64, align 8
  %16 = alloca ptr, align 8
  %17 = alloca i64, align 8
  %18 = alloca i64, align 8
  %19 = alloca i64, align 8
  %20 = alloca i64, align 8
  %21 = alloca i32, align 4
  %22 = alloca i64, align 8
  %23 = alloca i32, align 4
  store ptr %0, ptr %9, align 8, !tbaa !5
  store ptr %1, ptr %10, align 8, !tbaa !5
  store i64 %2, ptr %11, align 8, !tbaa !9
  store ptr %3, ptr %12, align 8, !tbaa !5
  store i64 %4, ptr %13, align 8, !tbaa !9
  store ptr %5, ptr %14, align 8, !tbaa !5
  store i64 %6, ptr %15, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  %24 = load ptr, ptr %10, align 8, !tbaa !5
  store ptr %24, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  store i64 0, ptr %17, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #4
  store i64 0, ptr %18, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #4
  store i64 0, ptr %19, align 8, !tbaa !9
  br label %25

25:                                               ; preds = %7
  br label %26

26:                                               ; preds = %25
  br label %27

27:                                               ; preds = %26
  br label %28

28:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #4
  %29 = load ptr, ptr %9, align 8, !tbaa !5
  %30 = load i64, ptr %15, align 8, !tbaa !9
  %31 = call i64 @ZSTD_CCtx_init_compressStream2(ptr noundef %29, i32 noundef 2, i64 noundef %30)
  store i64 %31, ptr %20, align 8, !tbaa !9
  %32 = load i64, ptr %20, align 8, !tbaa !9
  %33 = call i32 @ERR_isError(i64 noundef %32)
  %34 = icmp ne i32 %33, 0
  br i1 %34, label %35, label %49

35:                                               ; preds = %28
  br label %36

36:                                               ; preds = %35
  br label %37

37:                                               ; preds = %36
  br label %38

38:                                               ; preds = %37
  br label %39

39:                                               ; preds = %38
  br label %40

40:                                               ; preds = %39
  br label %41

41:                                               ; preds = %40
  br label %42

42:                                               ; preds = %41
  br label %43

43:                                               ; preds = %42
  br label %44

44:                                               ; preds = %43
  br label %45

45:                                               ; preds = %44
  br label %46

46:                                               ; preds = %45
  br label %47

47:                                               ; preds = %46
  %48 = load i64, ptr %20, align 8, !tbaa !9
  store i64 %48, ptr %8, align 8
  store i32 1, ptr %21, align 4
  br label %50

49:                                               ; preds = %28
  store i32 0, ptr %21, align 4
  br label %50

50:                                               ; preds = %49, %47
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #4
  %51 = load i32, ptr %21, align 4
  switch i32 %51, label %175 [
    i32 0, label %52
  ]

52:                                               ; preds = %50
  br label %53

53:                                               ; preds = %52
  br label %54

54:                                               ; preds = %53
  %55 = load ptr, ptr %16, align 8, !tbaa !5
  %56 = load i64, ptr %11, align 8, !tbaa !9
  %57 = load ptr, ptr %9, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.ZSTD_CCtx_s, ptr %57, i32 0, i32 4
  %59 = load i64, ptr %15, align 8, !tbaa !9
  %60 = load ptr, ptr %9, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.ZSTD_CCtx_s, ptr %60, i32 0, i32 6
  %62 = load i32, ptr %61, align 8, !tbaa !11
  %63 = call i64 @ZSTD_writeFrameHeader(ptr noundef %55, i64 noundef %56, ptr noundef %58, i64 noundef %59, i32 noundef %62)
  store i64 %63, ptr %19, align 8, !tbaa !9
  %64 = load i64, ptr %19, align 8, !tbaa !9
  %65 = load ptr, ptr %16, align 8, !tbaa !5
  %66 = getelementptr inbounds i8, ptr %65, i64 %64
  store ptr %66, ptr %16, align 8, !tbaa !5
  %67 = load i64, ptr %19, align 8, !tbaa !9
  %68 = load i64, ptr %11, align 8, !tbaa !9
  %69 = sub i64 %68, %67
  store i64 %69, ptr %11, align 8, !tbaa !9
  %70 = load i64, ptr %19, align 8, !tbaa !9
  %71 = load i64, ptr %17, align 8, !tbaa !9
  %72 = add i64 %71, %70
  store i64 %72, ptr %17, align 8, !tbaa !9
  %73 = load ptr, ptr %9, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.ZSTD_CCtx_s, ptr %73, i32 0, i32 4
  %75 = getelementptr inbounds %struct.ZSTD_CCtx_params_s, ptr %74, i32 0, i32 2
  %76 = getelementptr inbounds %struct.ZSTD_frameParameters, ptr %75, i32 0, i32 1
  %77 = load i32, ptr %76, align 4, !tbaa !37
  %78 = icmp ne i32 %77, 0
  br i1 %78, label %79, label %88

79:                                               ; preds = %54
  %80 = load i64, ptr %15, align 8, !tbaa !9
  %81 = icmp ne i64 %80, 0
  br i1 %81, label %82, label %88

82:                                               ; preds = %79
  %83 = load ptr, ptr %9, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.ZSTD_CCtx_s, ptr %83, i32 0, i32 13
  %85 = load ptr, ptr %14, align 8, !tbaa !5
  %86 = load i64, ptr %15, align 8, !tbaa !9
  %87 = call i32 @XXH_INLINE_XXH64_update(ptr nocapture noundef %84, ptr nocapture noundef %85, i64 noundef %86)
  br label %88

88:                                               ; preds = %82, %79, %54
  %89 = load ptr, ptr %9, align 8, !tbaa !5
  %90 = load ptr, ptr %16, align 8, !tbaa !5
  %91 = load i64, ptr %11, align 8, !tbaa !9
  %92 = load ptr, ptr %12, align 8, !tbaa !5
  %93 = load i64, ptr %13, align 8, !tbaa !9
  %94 = load ptr, ptr %14, align 8, !tbaa !5
  %95 = load i64, ptr %15, align 8, !tbaa !9
  %96 = call i64 @ZSTD_compressSequences_internal(ptr noundef %89, ptr noundef %90, i64 noundef %91, ptr noundef %92, i64 noundef %93, ptr noundef %94, i64 noundef %95)
  store i64 %96, ptr %18, align 8, !tbaa !9
  br label %97

97:                                               ; preds = %88
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #4
  %98 = load i64, ptr %18, align 8, !tbaa !9
  store i64 %98, ptr %22, align 8, !tbaa !9
  %99 = load i64, ptr %22, align 8, !tbaa !9
  %100 = call i32 @ERR_isError(i64 noundef %99)
  %101 = icmp ne i32 %100, 0
  br i1 %101, label %102, label %116

102:                                              ; preds = %97
  br label %103

103:                                              ; preds = %102
  br label %104

104:                                              ; preds = %103
  br label %105

105:                                              ; preds = %104
  br label %106

106:                                              ; preds = %105
  br label %107

107:                                              ; preds = %106
  br label %108

108:                                              ; preds = %107
  br label %109

109:                                              ; preds = %108
  br label %110

110:                                              ; preds = %109
  br label %111

111:                                              ; preds = %110
  br label %112

112:                                              ; preds = %111
  br label %113

113:                                              ; preds = %112
  br label %114

114:                                              ; preds = %113
  %115 = load i64, ptr %22, align 8, !tbaa !9
  store i64 %115, ptr %8, align 8
  store i32 1, ptr %21, align 4
  br label %117

116:                                              ; preds = %97
  store i32 0, ptr %21, align 4
  br label %117

117:                                              ; preds = %116, %114
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #4
  %118 = load i32, ptr %21, align 4
  switch i32 %118, label %175 [
    i32 0, label %119
  ]

119:                                              ; preds = %117
  br label %120

120:                                              ; preds = %119
  br label %121

121:                                              ; preds = %120
  %122 = load i64, ptr %18, align 8, !tbaa !9
  %123 = load i64, ptr %17, align 8, !tbaa !9
  %124 = add i64 %123, %122
  store i64 %124, ptr %17, align 8, !tbaa !9
  %125 = load i64, ptr %18, align 8, !tbaa !9
  %126 = load i64, ptr %11, align 8, !tbaa !9
  %127 = sub i64 %126, %125
  store i64 %127, ptr %11, align 8, !tbaa !9
  %128 = load ptr, ptr %9, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.ZSTD_CCtx_s, ptr %128, i32 0, i32 4
  %130 = getelementptr inbounds %struct.ZSTD_CCtx_params_s, ptr %129, i32 0, i32 2
  %131 = getelementptr inbounds %struct.ZSTD_frameParameters, ptr %130, i32 0, i32 1
  %132 = load i32, ptr %131, align 4, !tbaa !37
  %133 = icmp ne i32 %132, 0
  br i1 %133, label %134, label %170

134:                                              ; preds = %121
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #4
  %135 = load ptr, ptr %9, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.ZSTD_CCtx_s, ptr %135, i32 0, i32 13
  %137 = call i64 @XXH_INLINE_XXH64_digest(ptr nocapture noundef %136) #5
  %138 = trunc i64 %137 to i32
  store i32 %138, ptr %23, align 4, !tbaa !38
  br label %139

139:                                              ; preds = %134
  %140 = load i64, ptr %11, align 8, !tbaa !9
  %141 = icmp ult i64 %140, 4
  br i1 %141, label %142, label %155

142:                                              ; preds = %139
  br label %143

143:                                              ; preds = %142
  br label %144

144:                                              ; preds = %143
  br label %145

145:                                              ; preds = %144
  br label %146

146:                                              ; preds = %145
  br label %147

147:                                              ; preds = %146
  br label %148

148:                                              ; preds = %147
  br label %149

149:                                              ; preds = %148
  br label %150

150:                                              ; preds = %149
  br label %151

151:                                              ; preds = %150
  br label %152

152:                                              ; preds = %151
  br label %153

153:                                              ; preds = %152
  br label %154

154:                                              ; preds = %153
  store i64 -70, ptr %8, align 8
  store i32 1, ptr %21, align 4
  br label %167

155:                                              ; preds = %139
  br label %156

156:                                              ; preds = %155
  br label %157

157:                                              ; preds = %156
  br label %158

158:                                              ; preds = %157
  br label %159

159:                                              ; preds = %158
  br label %160

160:                                              ; preds = %159
  %161 = load ptr, ptr %10, align 8, !tbaa !5
  %162 = load i64, ptr %17, align 8, !tbaa !9
  %163 = getelementptr inbounds i8, ptr %161, i64 %162
  %164 = load i32, ptr %23, align 4, !tbaa !38
  call void @MEM_writeLE32(ptr noundef %163, i32 noundef %164)
  %165 = load i64, ptr %17, align 8, !tbaa !9
  %166 = add i64 %165, 4
  store i64 %166, ptr %17, align 8, !tbaa !9
  store i32 0, ptr %21, align 4
  br label %167

167:                                              ; preds = %160, %154
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #4
  %168 = load i32, ptr %21, align 4
  switch i32 %168, label %175 [
    i32 0, label %169
  ]

169:                                              ; preds = %167
  br label %170

170:                                              ; preds = %169, %121
  br label %171

171:                                              ; preds = %170
  br label %172

172:                                              ; preds = %171
  br label %173

173:                                              ; preds = %172
  %174 = load i64, ptr %17, align 8, !tbaa !9
  store i64 %174, ptr %8, align 8
  store i32 1, ptr %21, align 4
  br label %175

175:                                              ; preds = %173, %167, %117, %50
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  %176 = load i64, ptr %8, align 8
  ret i64 %176
}

; Function Attrs: nounwind uwtable
declare hidden i64 @ZSTD_writeFrameHeader(ptr noundef, i64 noundef, ptr noundef, i64 noundef, i32 noundef) #0

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @XXH_INLINE_XXH64_update(ptr nocapture noundef, ptr nocapture noundef, i64 noundef) #2

; Function Attrs: nounwind uwtable
declare hidden i64 @ZSTD_compressSequences_internal(ptr noundef, ptr noundef, i64 noundef, ptr noundef, i64 noundef, ptr noundef, i64 noundef) #0

; Function Attrs: inlinehint nounwind willreturn memory(read) uwtable
declare hidden i64 @XXH_INLINE_XXH64_digest(ptr nocapture noundef) #3

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !13, i64 664}
!12 = !{!"ZSTD_CCtx_s", !13, i64 0, !13, i64 4, !13, i64 8, !14, i64 16, !14, i64 232, !14, i64 448, !13, i64 664, !10, i64 672, !19, i64 680, !10, i64 752, !20, i64 760, !20, i64 768, !20, i64 776, !21, i64 784, !18, i64 872, !6, i64 896, !10, i64 904, !22, i64 912, !13, i64 944, !13, i64 948, !23, i64 952, !24, i64 1032, !6, i64 3144, !10, i64 3152, !26, i64 3160, !27, i64 3200, !6, i64 3520, !13, i64 3528, !6, i64 3536, !10, i64 3544, !10, i64 3552, !10, i64 3560, !10, i64 3568, !6, i64 3576, !10, i64 3584, !10, i64 3592, !10, i64 3600, !13, i64 3608, !13, i64 3612, !30, i64 3616, !10, i64 3640, !10, i64 3648, !31, i64 3656, !6, i64 3696, !32, i64 3704, !6, i64 3728, !33, i64 3736, !6, i64 5232, !10, i64 5240}
!13 = !{!"int", !7, i64 0}
!14 = !{!"ZSTD_CCtx_params_s", !13, i64 0, !15, i64 4, !16, i64 32, !13, i64 44, !13, i64 48, !10, i64 56, !13, i64 64, !13, i64 68, !13, i64 72, !13, i64 76, !10, i64 80, !13, i64 88, !13, i64 92, !17, i64 96, !13, i64 120, !13, i64 124, !13, i64 128, !13, i64 132, !13, i64 136, !13, i64 140, !13, i64 144, !13, i64 148, !18, i64 152, !13, i64 176, !13, i64 180, !6, i64 184, !6, i64 192, !10, i64 200, !13, i64 208}
!15 = !{!"", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !13, i64 16, !13, i64 20, !13, i64 24}
!16 = !{!"", !13, i64 0, !13, i64 4, !13, i64 8}
!17 = !{!"", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !13, i64 16, !13, i64 20}
!18 = !{!"", !6, i64 0, !6, i64 8, !6, i64 16}
!19 = !{!"", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !7, i64 56, !13, i64 60, !13, i64 64, !13, i64 68}
!20 = !{!"long long", !7, i64 0}
!21 = !{!"XXH_NAMESPACEXXH64_state_s", !10, i64 0, !7, i64 8, !7, i64 40, !13, i64 72, !13, i64 76, !10, i64 80}
!22 = !{!"", !13, i64 0, !6, i64 8, !10, i64 16, !10, i64 24}
!23 = !{!"", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !10, i64 56, !10, i64 64, !13, i64 72, !13, i64 76}
!24 = !{!"", !25, i64 0, !6, i64 40, !13, i64 48, !6, i64 56, !7, i64 64, !7, i64 576}
!25 = !{!"", !6, i64 0, !6, i64 8, !6, i64 16, !13, i64 24, !13, i64 28, !13, i64 32}
!26 = !{!"", !6, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32}
!27 = !{!"", !6, i64 0, !6, i64 8, !28, i64 16}
!28 = !{!"ZSTD_matchState_t", !25, i64 0, !13, i64 40, !13, i64 44, !13, i64 48, !13, i64 52, !6, i64 56, !7, i64 64, !10, i64 96, !13, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !13, i64 136, !13, i64 140, !29, i64 144, !6, i64 248, !15, i64 256, !6, i64 288, !13, i64 296, !13, i64 300}
!29 = !{!"", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !13, i64 48, !13, i64 52, !13, i64 56, !13, i64 60, !13, i64 64, !13, i64 68, !13, i64 72, !13, i64 76, !13, i64 80, !6, i64 88, !13, i64 96}
!30 = !{!"ZSTD_inBuffer_s", !6, i64 0, !10, i64 8, !10, i64 16}
!31 = !{!"", !6, i64 0, !6, i64 8, !10, i64 16, !13, i64 24, !6, i64 32}
!32 = !{!"ZSTD_prefixDict_s", !6, i64 0, !10, i64 8, !13, i64 16}
!33 = !{!"", !23, i64 0, !23, i64 80, !23, i64 160, !23, i64 240, !23, i64 320, !7, i64 400, !34, i64 1184}
!34 = !{!"", !35, i64 0, !36, i64 144}
!35 = !{!"", !13, i64 0, !7, i64 4, !10, i64 136}
!36 = !{!"", !13, i64 0, !13, i64 4, !13, i64 8, !7, i64 12, !10, i64 152, !10, i64 160}
!37 = !{!12, !13, i64 268}
!38 = !{!13, !13, i64 0}


; 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
declare hidden i32 @ERR_isError(i64 noundef) local_unnamed_addr #0

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

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

; Function Attrs: nounwind uwtable
define dso_local i64 @ZSTD_compressSequences(ptr noundef %0, ptr noundef %1, i64 noundef %2, ptr noundef %3, i64 noundef %4, ptr noundef %5, i64 noundef %6) local_unnamed_addr #0 {
  %8 = tail call i64 @ZSTD_CCtx_init_compressStream2(ptr noundef %0, i32 noundef 2, i64 noundef %6)
  %9 = tail call i32 @ERR_isError(i64 noundef %8)
  %.not = icmp eq i32 %9, 0
  br i1 %.not, label %10, label %39

10:                                               ; preds = %7
  %11 = getelementptr inbounds i8, ptr %0, i64 232
  %12 = getelementptr inbounds i8, ptr %0, i64 664
  %13 = load i32, ptr %12, align 8, !tbaa !5
  %14 = tail call i64 @ZSTD_writeFrameHeader(ptr noundef %1, i64 noundef %2, ptr noundef nonnull %11, i64 noundef %6, i32 noundef %13)
  %15 = getelementptr inbounds i8, ptr %1, i64 %14
  %16 = sub i64 %2, %14
  %17 = getelementptr inbounds i8, ptr %0, i64 268
  %18 = load i32, ptr %17, align 4, !tbaa !35
  %19 = icmp ne i32 %18, 0
  %20 = icmp ne i64 %6, 0
  %or.cond = and i1 %20, %19
  br i1 %or.cond, label %21, label %24

21:                                               ; preds = %10
  %22 = getelementptr inbounds i8, ptr %0, i64 784
  %23 = tail call i32 @XXH_INLINE_XXH64_update(ptr nocapture noundef nonnull %22, ptr nocapture noundef %5, i64 noundef %6)
  br label %24

24:                                               ; preds = %21, %10
  %25 = tail call i64 @ZSTD_compressSequences_internal(ptr noundef nonnull %0, ptr noundef %15, i64 noundef %16, ptr noundef %3, i64 noundef %4, ptr noundef %5, i64 noundef %6)
  %26 = tail call i32 @ERR_isError(i64 noundef %25)
  %.not54 = icmp eq i32 %26, 0
  br i1 %.not54, label %27, label %39

27:                                               ; preds = %24
  %28 = add i64 %25, %14
  %29 = load i32, ptr %17, align 4, !tbaa !35
  %.not55 = icmp eq i32 %29, 0
  br i1 %.not55, label %39, label %30

30:                                               ; preds = %27
  %31 = sub i64 %16, %25
  %32 = icmp ugt i64 %31, 3
  br i1 %32, label %33, label %39

33:                                               ; preds = %30
  %34 = getelementptr inbounds i8, ptr %0, i64 784
  %35 = tail call i64 @XXH_INLINE_XXH64_digest(ptr nocapture noundef nonnull %34) #3
  %36 = trunc i64 %35 to i32
  %37 = getelementptr inbounds i8, ptr %1, i64 %28
  tail call void @MEM_writeLE32(ptr noundef %37, i32 noundef %36)
  %38 = add i64 %28, 4
  br label %39

39:                                               ; preds = %33, %30, %27, %24, %7
  %.3 = phi i64 [ %25, %24 ], [ %8, %7 ], [ %28, %27 ], [ %38, %33 ], [ -70, %30 ]
  ret i64 %.3
}

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @XXH_INLINE_XXH64_update(ptr nocapture noundef, ptr nocapture noundef, i64 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden i64 @ZSTD_compressSequences_internal(ptr noundef, ptr noundef, i64 noundef, ptr noundef, i64 noundef, ptr noundef, i64 noundef) local_unnamed_addr #0

; Function Attrs: inlinehint mustprogress nofree nounwind willreturn memory(read) uwtable
declare hidden i64 @XXH_INLINE_XXH64_digest(ptr nocapture noundef) local_unnamed_addr #2

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 = { 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 #2 = { inlinehint mustprogress nofree nounwind willreturn memory(read) 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 willreturn memory(read) }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 664}
!6 = !{!"ZSTD_CCtx_s", !7, i64 0, !7, i64 4, !7, i64 8, !10, i64 16, !10, i64 232, !10, i64 448, !7, i64 664, !13, i64 672, !17, i64 680, !13, i64 752, !18, i64 760, !18, i64 768, !18, i64 776, !19, i64 784, !15, i64 872, !16, i64 896, !13, i64 904, !20, i64 912, !7, i64 944, !7, i64 948, !21, i64 952, !22, i64 1032, !16, i64 3144, !13, i64 3152, !24, i64 3160, !25, i64 3200, !16, i64 3520, !7, i64 3528, !16, i64 3536, !13, i64 3544, !13, i64 3552, !13, i64 3560, !13, i64 3568, !16, i64 3576, !13, i64 3584, !13, i64 3592, !13, i64 3600, !7, i64 3608, !7, i64 3612, !28, i64 3616, !13, i64 3640, !13, i64 3648, !29, i64 3656, !16, i64 3696, !30, i64 3704, !16, i64 3728, !31, i64 3736, !16, i64 5232, !13, i64 5240}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"ZSTD_CCtx_params_s", !7, i64 0, !11, i64 4, !12, i64 32, !7, i64 44, !7, i64 48, !13, i64 56, !7, i64 64, !7, i64 68, !7, i64 72, !7, i64 76, !13, i64 80, !7, i64 88, !7, i64 92, !14, i64 96, !7, i64 120, !7, i64 124, !7, i64 128, !7, i64 132, !7, i64 136, !7, i64 140, !7, i64 144, !7, i64 148, !15, i64 152, !7, i64 176, !7, i64 180, !16, i64 184, !16, i64 192, !13, i64 200, !7, i64 208}
!11 = !{!"", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20, !7, i64 24}
!12 = !{!"", !7, i64 0, !7, i64 4, !7, i64 8}
!13 = !{!"long", !8, i64 0}
!14 = !{!"", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20}
!15 = !{!"", !16, i64 0, !16, i64 8, !16, i64 16}
!16 = !{!"any pointer", !8, i64 0}
!17 = !{!"", !16, i64 0, !16, i64 8, !16, i64 16, !16, i64 24, !16, i64 32, !16, i64 40, !16, i64 48, !8, i64 56, !7, i64 60, !7, i64 64, !7, i64 68}
!18 = !{!"long long", !8, i64 0}
!19 = !{!"XXH_NAMESPACEXXH64_state_s", !13, i64 0, !8, i64 8, !8, i64 40, !7, i64 72, !7, i64 76, !13, i64 80}
!20 = !{!"", !7, i64 0, !16, i64 8, !13, i64 16, !13, i64 24}
!21 = !{!"", !16, i64 0, !16, i64 8, !16, i64 16, !16, i64 24, !16, i64 32, !16, i64 40, !16, i64 48, !13, i64 56, !13, i64 64, !7, i64 72, !7, i64 76}
!22 = !{!"", !23, i64 0, !16, i64 40, !7, i64 48, !16, i64 56, !8, i64 64, !8, i64 576}
!23 = !{!"", !16, i64 0, !16, i64 8, !16, i64 16, !7, i64 24, !7, i64 28, !7, i64 32}
!24 = !{!"", !16, i64 0, !13, i64 8, !13, i64 16, !13, i64 24, !13, i64 32}
!25 = !{!"", !16, i64 0, !16, i64 8, !26, i64 16}
!26 = !{!"ZSTD_matchState_t", !23, i64 0, !7, i64 40, !7, i64 44, !7, i64 48, !7, i64 52, !16, i64 56, !8, i64 64, !13, i64 96, !7, i64 104, !16, i64 112, !16, i64 120, !16, i64 128, !7, i64 136, !7, i64 140, !27, i64 144, !16, i64 248, !11, i64 256, !16, i64 288, !7, i64 296, !7, i64 300}
!27 = !{!"", !16, i64 0, !16, i64 8, !16, i64 16, !16, i64 24, !16, i64 32, !16, i64 40, !7, i64 48, !7, i64 52, !7, i64 56, !7, i64 60, !7, i64 64, !7, i64 68, !7, i64 72, !7, i64 76, !7, i64 80, !16, i64 88, !7, i64 96}
!28 = !{!"ZSTD_inBuffer_s", !16, i64 0, !13, i64 8, !13, i64 16}
!29 = !{!"", !16, i64 0, !16, i64 8, !13, i64 16, !7, i64 24, !16, i64 32}
!30 = !{!"ZSTD_prefixDict_s", !16, i64 0, !13, i64 8, !7, i64 16}
!31 = !{!"", !21, i64 0, !21, i64 80, !21, i64 160, !21, i64 240, !21, i64 320, !8, i64 400, !32, i64 1184}
!32 = !{!"", !33, i64 0, !34, i64 144}
!33 = !{!"", !7, i64 0, !8, i64 4, !13, i64 136}
!34 = !{!"", !7, i64 0, !7, i64 4, !7, i64 8, !8, i64 12, !13, i64 152, !13, i64 160}
!35 = !{!6, !7, i64 268}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass