; LLVM IR from Iotic-Labs/py-lz4framed :: lz4 (lz4frame)

; 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.LZ4F_preferences_t = type { %struct.LZ4F_frameInfo_t, i32, i32, i32, [3 x i32] }
%struct.LZ4F_frameInfo_t = type { i32, i32, i32, i32, i64, i32, i32 }
%struct.LZ4F_cctx_s = type { %struct.LZ4F_preferences_t, i32, i32, ptr, i64, i64, ptr, ptr, i64, i64, %struct.XXH32_state_s, ptr, i16, i16 }
%struct.XXH32_state_s = type { i32, i32, i32, i32, i32, i32, [4 x i32], i32, i32 }

; Function Attrs: nounwind uwtable
declare dso_local i64 @LZ4F_getBlockSize(i32 noundef) #0

; Function Attrs: nounwind uwtable
declare hidden i64 @err0r(i32 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 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: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

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

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

23:                                               ; preds = %5
  %24 = call i64 @err0r(i32 noundef 11)
  store i64 %24, ptr %6, align 8
  store i32 1, ptr %16, align 4
  br label %348

25:                                               ; preds = %5
  call void @llvm.memset.p0.i64(ptr align 8 %12, i8 0, i64 56, i1 false)
  %26 = load ptr, ptr %11, align 8, !tbaa !5
  %27 = icmp eq ptr %26, null
  br i1 %27, label %28, label %29

28:                                               ; preds = %25
  store ptr %12, ptr %11, align 8, !tbaa !5
  br label %29

29:                                               ; preds = %28, %25
  %30 = load ptr, ptr %7, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %30, i32 0, i32 0
  %32 = load ptr, ptr %11, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %31, ptr align 8 %32, i64 56, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.start.p0(i64 2, ptr %17) #7
  %33 = load ptr, ptr %7, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %33, i32 0, i32 0
  %35 = getelementptr inbounds %struct.LZ4F_preferences_t, ptr %34, i32 0, i32 1
  %36 = load i32, ptr %35, align 8, !tbaa !17
  %37 = icmp slt i32 %36, 3
  %38 = zext i1 %37 to i64
  %39 = select i1 %37, i32 1, i32 2
  %40 = trunc i32 %39 to i16
  store i16 %40, ptr %17, align 2, !tbaa !23
  %41 = load ptr, ptr %7, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %41, i32 0, i32 12
  %43 = load i16, ptr %42, align 8, !tbaa !24
  %44 = zext i16 %43 to i32
  %45 = load i16, ptr %17, align 2, !tbaa !23
  %46 = zext i16 %45 to i32
  %47 = icmp slt i32 %44, %46
  br i1 %47, label %48, label %79

48:                                               ; preds = %29
  %49 = load ptr, ptr %7, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %49, i32 0, i32 11
  %51 = load ptr, ptr %50, align 8, !tbaa !25
  call void @free(ptr noundef %51) #7
  %52 = load ptr, ptr %7, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %52, i32 0, i32 0
  %54 = getelementptr inbounds %struct.LZ4F_preferences_t, ptr %53, i32 0, i32 1
  %55 = load i32, ptr %54, align 8, !tbaa !17
  %56 = icmp slt i32 %55, 3
  br i1 %56, label %57, label %61

57:                                               ; preds = %48
  %58 = call ptr @LZ4_createStream()
  %59 = load ptr, ptr %7, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %59, i32 0, i32 11
  store ptr %58, ptr %60, align 8, !tbaa !25
  br label %65

61:                                               ; preds = %48
  %62 = call ptr @LZ4_createStreamHC()
  %63 = load ptr, ptr %7, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %63, i32 0, i32 11
  store ptr %62, ptr %64, align 8, !tbaa !25
  br label %65

65:                                               ; preds = %61, %57
  %66 = load ptr, ptr %7, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %66, i32 0, i32 11
  %68 = load ptr, ptr %67, align 8, !tbaa !25
  %69 = icmp eq ptr %68, null
  br i1 %69, label %70, label %72

70:                                               ; preds = %65
  %71 = call i64 @err0r(i32 noundef 9)
  store i64 %71, ptr %6, align 8
  store i32 1, ptr %16, align 4
  br label %116

72:                                               ; preds = %65
  %73 = load i16, ptr %17, align 2, !tbaa !23
  %74 = load ptr, ptr %7, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %74, i32 0, i32 12
  store i16 %73, ptr %75, align 8, !tbaa !24
  %76 = load i16, ptr %17, align 2, !tbaa !23
  %77 = load ptr, ptr %7, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %77, i32 0, i32 13
  store i16 %76, ptr %78, align 2, !tbaa !26
  br label %115

79:                                               ; preds = %29
  %80 = load ptr, ptr %7, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %80, i32 0, i32 13
  %82 = load i16, ptr %81, align 2, !tbaa !26
  %83 = zext i16 %82 to i32
  %84 = load i16, ptr %17, align 2, !tbaa !23
  %85 = zext i16 %84 to i32
  %86 = icmp ne i32 %83, %85
  br i1 %86, label %87, label %114

87:                                               ; preds = %79
  %88 = load ptr, ptr %7, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %88, i32 0, i32 0
  %90 = getelementptr inbounds %struct.LZ4F_preferences_t, ptr %89, i32 0, i32 1
  %91 = load i32, ptr %90, align 8, !tbaa !17
  %92 = icmp slt i32 %91, 3
  br i1 %92, label %93, label %98

93:                                               ; preds = %87
  %94 = load ptr, ptr %7, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %94, i32 0, i32 11
  %96 = load ptr, ptr %95, align 8, !tbaa !25
  %97 = call ptr @LZ4_initStream(ptr noundef %96, i64 noundef 16416)
  br label %110

98:                                               ; preds = %87
  %99 = load ptr, ptr %7, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %99, i32 0, i32 11
  %101 = load ptr, ptr %100, align 8, !tbaa !25
  %102 = call ptr @LZ4_initStreamHC(ptr noundef %101, i64 noundef 262200)
  %103 = load ptr, ptr %7, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %103, i32 0, i32 11
  %105 = load ptr, ptr %104, align 8, !tbaa !25
  %106 = load ptr, ptr %7, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %106, i32 0, i32 0
  %108 = getelementptr inbounds %struct.LZ4F_preferences_t, ptr %107, i32 0, i32 1
  %109 = load i32, ptr %108, align 8, !tbaa !17
  call void @LZ4_setCompressionLevel(ptr noundef %105, i32 noundef %109)
  br label %110

110:                                              ; preds = %98, %93
  %111 = load i16, ptr %17, align 2, !tbaa !23
  %112 = load ptr, ptr %7, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %112, i32 0, i32 13
  store i16 %111, ptr %113, align 2, !tbaa !26
  br label %114

114:                                              ; preds = %110, %79
  br label %115

115:                                              ; preds = %114, %72
  store i32 0, ptr %16, align 4
  br label %116

116:                                              ; preds = %115, %70
  call void @llvm.lifetime.end.p0(i64 2, ptr %17) #7
  %117 = load i32, ptr %16, align 4
  switch i32 %117, label %348 [
    i32 0, label %118
  ]

118:                                              ; preds = %116
  %119 = load ptr, ptr %7, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %119, i32 0, i32 0
  %121 = getelementptr inbounds %struct.LZ4F_preferences_t, ptr %120, i32 0, i32 0
  %122 = getelementptr inbounds %struct.LZ4F_frameInfo_t, ptr %121, i32 0, i32 0
  %123 = load i32, ptr %122, align 8, !tbaa !27
  %124 = icmp eq i32 %123, 0
  br i1 %124, label %125, label %130

125:                                              ; preds = %118
  %126 = load ptr, ptr %7, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %126, i32 0, i32 0
  %128 = getelementptr inbounds %struct.LZ4F_preferences_t, ptr %127, i32 0, i32 0
  %129 = getelementptr inbounds %struct.LZ4F_frameInfo_t, ptr %128, i32 0, i32 0
  store i32 4, ptr %129, align 8, !tbaa !27
  br label %130

130:                                              ; preds = %125, %118
  %131 = load ptr, ptr %7, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %131, i32 0, i32 0
  %133 = getelementptr inbounds %struct.LZ4F_preferences_t, ptr %132, i32 0, i32 0
  %134 = getelementptr inbounds %struct.LZ4F_frameInfo_t, ptr %133, i32 0, i32 0
  %135 = load i32, ptr %134, align 8, !tbaa !27
  %136 = call i64 @LZ4F_getBlockSize(i32 noundef %135)
  %137 = load ptr, ptr %7, align 8, !tbaa !5
  %138 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %137, i32 0, i32 4
  store i64 %136, ptr %138, align 8, !tbaa !28
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  %139 = load ptr, ptr %11, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.LZ4F_preferences_t, ptr %139, i32 0, i32 2
  %141 = load i32, ptr %140, align 4, !tbaa !29
  %142 = icmp ne i32 %141, 0
  br i1 %142, label %143, label %153

143:                                              ; preds = %130
  %144 = load ptr, ptr %7, align 8, !tbaa !5
  %145 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %144, i32 0, i32 0
  %146 = getelementptr inbounds %struct.LZ4F_preferences_t, ptr %145, i32 0, i32 0
  %147 = getelementptr inbounds %struct.LZ4F_frameInfo_t, ptr %146, i32 0, i32 1
  %148 = load i32, ptr %147, align 4, !tbaa !30
  %149 = icmp eq i32 %148, 0
  %150 = zext i1 %149 to i64
  %151 = select i1 %149, i32 65536, i32 0
  %152 = sext i32 %151 to i64
  br label %167

153:                                              ; preds = %130
  %154 = load ptr, ptr %7, align 8, !tbaa !5
  %155 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %154, i32 0, i32 4
  %156 = load i64, ptr %155, align 8, !tbaa !28
  %157 = load ptr, ptr %7, align 8, !tbaa !5
  %158 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %157, i32 0, i32 0
  %159 = getelementptr inbounds %struct.LZ4F_preferences_t, ptr %158, i32 0, i32 0
  %160 = getelementptr inbounds %struct.LZ4F_frameInfo_t, ptr %159, i32 0, i32 1
  %161 = load i32, ptr %160, align 4, !tbaa !30
  %162 = icmp eq i32 %161, 0
  %163 = zext i1 %162 to i64
  %164 = select i1 %162, i32 131072, i32 0
  %165 = sext i32 %164 to i64
  %166 = add i64 %156, %165
  br label %167

167:                                              ; preds = %153, %143
  %168 = phi i64 [ %152, %143 ], [ %166, %153 ]
  store i64 %168, ptr %18, align 8, !tbaa !9
  %169 = load ptr, ptr %7, align 8, !tbaa !5
  %170 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %169, i32 0, i32 5
  %171 = load i64, ptr %170, align 8, !tbaa !31
  %172 = load i64, ptr %18, align 8, !tbaa !9
  %173 = icmp ult i64 %171, %172
  br i1 %173, label %174, label %194

174:                                              ; preds = %167
  %175 = load ptr, ptr %7, align 8, !tbaa !5
  %176 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %175, i32 0, i32 5
  store i64 0, ptr %176, align 8, !tbaa !31
  %177 = load ptr, ptr %7, align 8, !tbaa !5
  %178 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %177, i32 0, i32 6
  %179 = load ptr, ptr %178, align 8, !tbaa !32
  call void @free(ptr noundef %179) #7
  %180 = load i64, ptr %18, align 8, !tbaa !9
  %181 = call noalias ptr @calloc(i64 noundef 1, i64 noundef %180) #8
  %182 = load ptr, ptr %7, align 8, !tbaa !5
  %183 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %182, i32 0, i32 6
  store ptr %181, ptr %183, align 8, !tbaa !32
  %184 = load ptr, ptr %7, align 8, !tbaa !5
  %185 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %184, i32 0, i32 6
  %186 = load ptr, ptr %185, align 8, !tbaa !32
  %187 = icmp eq ptr %186, null
  br i1 %187, label %188, label %190

188:                                              ; preds = %174
  %189 = call i64 @err0r(i32 noundef 9)
  store i64 %189, ptr %6, align 8
  store i32 1, ptr %16, align 4
  br label %195

190:                                              ; preds = %174
  %191 = load i64, ptr %18, align 8, !tbaa !9
  %192 = load ptr, ptr %7, align 8, !tbaa !5
  %193 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %192, i32 0, i32 5
  store i64 %191, ptr %193, align 8, !tbaa !31
  br label %194

194:                                              ; preds = %190, %167
  store i32 0, ptr %16, align 4
  br label %195

195:                                              ; preds = %194, %188
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  %196 = load i32, ptr %16, align 4
  switch i32 %196, label %348 [
    i32 0, label %197
  ]

197:                                              ; preds = %195
  %198 = load ptr, ptr %7, align 8, !tbaa !5
  %199 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %198, i32 0, i32 6
  %200 = load ptr, ptr %199, align 8, !tbaa !32
  %201 = load ptr, ptr %7, align 8, !tbaa !5
  %202 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %201, i32 0, i32 7
  store ptr %200, ptr %202, align 8, !tbaa !33
  %203 = load ptr, ptr %7, align 8, !tbaa !5
  %204 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %203, i32 0, i32 8
  store i64 0, ptr %204, align 8, !tbaa !34
  %205 = load ptr, ptr %7, align 8, !tbaa !5
  %206 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %205, i32 0, i32 10
  %207 = call i32 @XXH32_reset(ptr noundef %206, i32 noundef 0)
  %208 = load ptr, ptr %10, align 8, !tbaa !5
  %209 = load ptr, ptr %7, align 8, !tbaa !5
  %210 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %209, i32 0, i32 3
  store ptr %208, ptr %210, align 8, !tbaa !35
  %211 = load ptr, ptr %7, align 8, !tbaa !5
  %212 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %211, i32 0, i32 0
  %213 = getelementptr inbounds %struct.LZ4F_preferences_t, ptr %212, i32 0, i32 0
  %214 = getelementptr inbounds %struct.LZ4F_frameInfo_t, ptr %213, i32 0, i32 1
  %215 = load i32, ptr %214, align 4, !tbaa !30
  %216 = icmp eq i32 %215, 0
  br i1 %216, label %217, label %226

217:                                              ; preds = %197
  %218 = load ptr, ptr %7, align 8, !tbaa !5
  %219 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %218, i32 0, i32 11
  %220 = load ptr, ptr %219, align 8, !tbaa !25
  %221 = load ptr, ptr %10, align 8, !tbaa !5
  %222 = load ptr, ptr %7, align 8, !tbaa !5
  %223 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %222, i32 0, i32 0
  %224 = getelementptr inbounds %struct.LZ4F_preferences_t, ptr %223, i32 0, i32 1
  %225 = load i32, ptr %224, align 8, !tbaa !17
  call void @LZ4F_initStream(ptr noundef %220, ptr noundef %221, i32 noundef %225, i32 noundef 0)
  br label %226

226:                                              ; preds = %217, %197
  %227 = load ptr, ptr %11, align 8, !tbaa !5
  %228 = getelementptr inbounds %struct.LZ4F_preferences_t, ptr %227, i32 0, i32 1
  %229 = load i32, ptr %228, align 8, !tbaa !36
  %230 = icmp sge i32 %229, 3
  br i1 %230, label %231, label %238

231:                                              ; preds = %226
  %232 = load ptr, ptr %7, align 8, !tbaa !5
  %233 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %232, i32 0, i32 11
  %234 = load ptr, ptr %233, align 8, !tbaa !25
  %235 = load ptr, ptr %11, align 8, !tbaa !5
  %236 = getelementptr inbounds %struct.LZ4F_preferences_t, ptr %235, i32 0, i32 3
  %237 = load i32, ptr %236, align 8, !tbaa !37
  call void @LZ4_favorDecompressionSpeed(ptr noundef %234, i32 noundef %237)
  br label %238

238:                                              ; preds = %231, %226
  %239 = load ptr, ptr %14, align 8, !tbaa !5
  call void @LZ4F_writeLE32(ptr noundef %239, i32 noundef 407708164)
  %240 = load ptr, ptr %14, align 8, !tbaa !5
  %241 = getelementptr inbounds i8, ptr %240, i64 4
  store ptr %241, ptr %14, align 8, !tbaa !5
  %242 = load ptr, ptr %14, align 8, !tbaa !5
  store ptr %242, ptr %15, align 8, !tbaa !5
  %243 = load ptr, ptr %7, align 8, !tbaa !5
  %244 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %243, i32 0, i32 0
  %245 = getelementptr inbounds %struct.LZ4F_preferences_t, ptr %244, i32 0, i32 0
  %246 = getelementptr inbounds %struct.LZ4F_frameInfo_t, ptr %245, i32 0, i32 1
  %247 = load i32, ptr %246, align 4, !tbaa !30
  %248 = and i32 %247, 1
  %249 = shl i32 %248, 5
  %250 = add i32 64, %249
  %251 = load ptr, ptr %7, align 8, !tbaa !5
  %252 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %251, i32 0, i32 0
  %253 = getelementptr inbounds %struct.LZ4F_preferences_t, ptr %252, i32 0, i32 0
  %254 = getelementptr inbounds %struct.LZ4F_frameInfo_t, ptr %253, i32 0, i32 6
  %255 = load i32, ptr %254, align 4, !tbaa !38
  %256 = and i32 %255, 1
  %257 = shl i32 %256, 4
  %258 = add i32 %250, %257
  %259 = load ptr, ptr %7, align 8, !tbaa !5
  %260 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %259, i32 0, i32 0
  %261 = getelementptr inbounds %struct.LZ4F_preferences_t, ptr %260, i32 0, i32 0
  %262 = getelementptr inbounds %struct.LZ4F_frameInfo_t, ptr %261, i32 0, i32 4
  %263 = load i64, ptr %262, align 8, !tbaa !39
  %264 = icmp ugt i64 %263, 0
  %265 = zext i1 %264 to i32
  %266 = shl i32 %265, 3
  %267 = add i32 %258, %266
  %268 = load ptr, ptr %7, align 8, !tbaa !5
  %269 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %268, i32 0, i32 0
  %270 = getelementptr inbounds %struct.LZ4F_preferences_t, ptr %269, i32 0, i32 0
  %271 = getelementptr inbounds %struct.LZ4F_frameInfo_t, ptr %270, i32 0, i32 2
  %272 = load i32, ptr %271, align 8, !tbaa !40
  %273 = and i32 %272, 1
  %274 = shl i32 %273, 2
  %275 = add i32 %267, %274
  %276 = load ptr, ptr %7, align 8, !tbaa !5
  %277 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %276, i32 0, i32 0
  %278 = getelementptr inbounds %struct.LZ4F_preferences_t, ptr %277, i32 0, i32 0
  %279 = getelementptr inbounds %struct.LZ4F_frameInfo_t, ptr %278, i32 0, i32 5
  %280 = load i32, ptr %279, align 8, !tbaa !41
  %281 = icmp ugt i32 %280, 0
  %282 = zext i1 %281 to i32
  %283 = add i32 %275, %282
  %284 = trunc i32 %283 to i8
  %285 = load ptr, ptr %14, align 8, !tbaa !5
  %286 = getelementptr inbounds i8, ptr %285, i32 1
  store ptr %286, ptr %14, align 8, !tbaa !5
  store i8 %284, ptr %285, align 1, !tbaa !16
  %287 = load ptr, ptr %7, align 8, !tbaa !5
  %288 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %287, i32 0, i32 0
  %289 = getelementptr inbounds %struct.LZ4F_preferences_t, ptr %288, i32 0, i32 0
  %290 = getelementptr inbounds %struct.LZ4F_frameInfo_t, ptr %289, i32 0, i32 0
  %291 = load i32, ptr %290, align 8, !tbaa !27
  %292 = and i32 %291, 7
  %293 = shl i32 %292, 4
  %294 = trunc i32 %293 to i8
  %295 = load ptr, ptr %14, align 8, !tbaa !5
  %296 = getelementptr inbounds i8, ptr %295, i32 1
  store ptr %296, ptr %14, align 8, !tbaa !5
  store i8 %294, ptr %295, align 1, !tbaa !16
  %297 = load ptr, ptr %7, align 8, !tbaa !5
  %298 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %297, i32 0, i32 0
  %299 = getelementptr inbounds %struct.LZ4F_preferences_t, ptr %298, i32 0, i32 0
  %300 = getelementptr inbounds %struct.LZ4F_frameInfo_t, ptr %299, i32 0, i32 4
  %301 = load i64, ptr %300, align 8, !tbaa !39
  %302 = icmp ne i64 %301, 0
  br i1 %302, label %303, label %314

303:                                              ; preds = %238
  %304 = load ptr, ptr %14, align 8, !tbaa !5
  %305 = load ptr, ptr %7, align 8, !tbaa !5
  %306 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %305, i32 0, i32 0
  %307 = getelementptr inbounds %struct.LZ4F_preferences_t, ptr %306, i32 0, i32 0
  %308 = getelementptr inbounds %struct.LZ4F_frameInfo_t, ptr %307, i32 0, i32 4
  %309 = load i64, ptr %308, align 8, !tbaa !39
  call void @LZ4F_writeLE64(ptr noundef %304, i64 noundef %309)
  %310 = load ptr, ptr %14, align 8, !tbaa !5
  %311 = getelementptr inbounds i8, ptr %310, i64 8
  store ptr %311, ptr %14, align 8, !tbaa !5
  %312 = load ptr, ptr %7, align 8, !tbaa !5
  %313 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %312, i32 0, i32 9
  store i64 0, ptr %313, align 8, !tbaa !42
  br label %314

314:                                              ; preds = %303, %238
  %315 = load ptr, ptr %7, align 8, !tbaa !5
  %316 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %315, i32 0, i32 0
  %317 = getelementptr inbounds %struct.LZ4F_preferences_t, ptr %316, i32 0, i32 0
  %318 = getelementptr inbounds %struct.LZ4F_frameInfo_t, ptr %317, i32 0, i32 5
  %319 = load i32, ptr %318, align 8, !tbaa !41
  %320 = icmp ne i32 %319, 0
  br i1 %320, label %321, label %330

321:                                              ; preds = %314
  %322 = load ptr, ptr %14, align 8, !tbaa !5
  %323 = load ptr, ptr %7, align 8, !tbaa !5
  %324 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %323, i32 0, i32 0
  %325 = getelementptr inbounds %struct.LZ4F_preferences_t, ptr %324, i32 0, i32 0
  %326 = getelementptr inbounds %struct.LZ4F_frameInfo_t, ptr %325, i32 0, i32 5
  %327 = load i32, ptr %326, align 8, !tbaa !41
  call void @LZ4F_writeLE32(ptr noundef %322, i32 noundef %327)
  %328 = load ptr, ptr %14, align 8, !tbaa !5
  %329 = getelementptr inbounds i8, ptr %328, i64 4
  store ptr %329, ptr %14, align 8, !tbaa !5
  br label %330

330:                                              ; preds = %321, %314
  %331 = load ptr, ptr %15, align 8, !tbaa !5
  %332 = load ptr, ptr %14, align 8, !tbaa !5
  %333 = load ptr, ptr %15, align 8, !tbaa !5
  %334 = ptrtoint ptr %332 to i64
  %335 = ptrtoint ptr %333 to i64
  %336 = sub i64 %334, %335
  %337 = call zeroext i8 @LZ4F_headerChecksum(ptr noundef %331, i64 noundef %336)
  %338 = load ptr, ptr %14, align 8, !tbaa !5
  store i8 %337, ptr %338, align 1, !tbaa !16
  %339 = load ptr, ptr %14, align 8, !tbaa !5
  %340 = getelementptr inbounds i8, ptr %339, i32 1
  store ptr %340, ptr %14, align 8, !tbaa !5
  %341 = load ptr, ptr %7, align 8, !tbaa !5
  %342 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %341, i32 0, i32 2
  store i32 1, ptr %342, align 4, !tbaa !43
  %343 = load ptr, ptr %14, align 8, !tbaa !5
  %344 = load ptr, ptr %13, align 8, !tbaa !5
  %345 = ptrtoint ptr %343 to i64
  %346 = ptrtoint ptr %344 to i64
  %347 = sub i64 %345, %346
  store i64 %347, ptr %6, align 8
  store i32 1, ptr %16, align 4
  br label %348

348:                                              ; preds = %330, %195, %116, %23
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 56, ptr %12) #7
  %349 = load i64, ptr %6, align 8
  ret i64 %349
}

declare ptr @LZ4_initStream(ptr noundef, i64 noundef) #4

; Function Attrs: nounwind
declare void @free(ptr noundef) #5

declare ptr @LZ4_createStream() #4

declare ptr @LZ4_createStreamHC() #4

declare void @LZ4_setCompressionLevel(ptr noundef, i32 noundef) #4

; Function Attrs: nounwind allocsize(0,1)
declare noalias ptr @calloc(i64 noundef, i64 noundef) #6

declare ptr @LZ4_initStreamHC(ptr noundef, i64 noundef) #4

declare i32 @XXH32_reset(ptr noundef, i32 noundef) #4

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

declare void @LZ4_favorDecompressionSpeed(ptr noundef, i32 noundef) #4

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

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

; Function Attrs: nounwind uwtable
declare hidden zeroext i8 @LZ4F_headerChecksum(ptr noundef, i64 noundef) #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" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind "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 #6 = { nounwind allocsize(0,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 #7 = { nounwind }
attributes #8 = { nounwind allocsize(0,1) }

!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 = !{i64 0, i64 4, !12, i64 4, i64 4, !12, i64 8, i64 4, !12, i64 12, i64 4, !12, i64 16, i64 8, !14, i64 24, i64 4, !12, i64 28, i64 4, !12, i64 32, i64 4, !12, i64 36, i64 4, !12, i64 40, i64 4, !12, i64 44, i64 12, !16}
!12 = !{!13, !13, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = !{!15, !15, i64 0}
!15 = !{!"long long", !7, i64 0}
!16 = !{!7, !7, i64 0}
!17 = !{!18, !13, i64 32}
!18 = !{!"LZ4F_cctx_s", !19, i64 0, !13, i64 56, !13, i64 60, !6, i64 64, !10, i64 72, !10, i64 80, !6, i64 88, !6, i64 96, !10, i64 104, !10, i64 112, !21, i64 120, !6, i64 168, !22, i64 176, !22, i64 178}
!19 = !{!"", !20, i64 0, !13, i64 32, !13, i64 36, !13, i64 40, !7, i64 44}
!20 = !{!"", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !15, i64 16, !13, i64 24, !13, i64 28}
!21 = !{!"XXH32_state_s", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !13, i64 16, !13, i64 20, !7, i64 24, !13, i64 40, !13, i64 44}
!22 = !{!"short", !7, i64 0}
!23 = !{!22, !22, i64 0}
!24 = !{!18, !22, i64 176}
!25 = !{!18, !6, i64 168}
!26 = !{!18, !22, i64 178}
!27 = !{!18, !13, i64 0}
!28 = !{!18, !10, i64 72}
!29 = !{!19, !13, i64 36}
!30 = !{!18, !13, i64 4}
!31 = !{!18, !10, i64 80}
!32 = !{!18, !6, i64 88}
!33 = !{!18, !6, i64 96}
!34 = !{!18, !10, i64 104}
!35 = !{!18, !6, i64 64}
!36 = !{!19, !13, i64 32}
!37 = !{!19, !13, i64 40}
!38 = !{!18, !13, i64 28}
!39 = !{!18, !15, i64 16}
!40 = !{!18, !13, i64 8}
!41 = !{!18, !13, i64 24}
!42 = !{!18, !10, i64 112}
!43 = !{!18, !13, i64 60}


; 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.LZ4F_preferences_t = type { %struct.LZ4F_frameInfo_t, i32, i32, i32, [3 x i32] }
%struct.LZ4F_frameInfo_t = type { i32, i32, i32, i32, i64, i32, i32 }

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

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

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

; Function Attrs: nounwind uwtable
define dso_local i64 @LZ4F_compressBegin_usingCDict(ptr noundef %0, ptr noundef %1, i64 noundef %2, ptr noundef %3, ptr noundef readonly %4) local_unnamed_addr #0 {
  %6 = alloca %struct.LZ4F_preferences_t, align 8
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %6) #7
  %7 = icmp ult i64 %2, 19
  br i1 %7, label %8, label %10

8:                                                ; preds = %5
  %9 = tail call i64 @err0r(i32 noundef 11)
  br label %143

10:                                               ; preds = %5
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(56) %6, i8 0, i64 56, i1 false)
  %11 = icmp eq ptr %4, null
  %spec.store.select = select i1 %11, ptr %6, ptr %4
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(56) %0, ptr noundef nonnull align 8 dereferenceable(56) %spec.store.select, i64 56, i1 false), !tbaa.struct !5
  %12 = getelementptr inbounds i8, ptr %0, i64 32
  %13 = load i32, ptr %12, align 8, !tbaa !13
  %14 = icmp slt i32 %13, 3
  %15 = select i1 %14, i16 1, i16 2
  %16 = getelementptr inbounds i8, ptr %0, i64 176
  %17 = load i16, ptr %16, align 8, !tbaa !21
  %18 = icmp ult i16 %17, %15
  br i1 %18, label %19, label %32

19:                                               ; preds = %10
  %20 = getelementptr inbounds i8, ptr %0, i64 168
  %21 = load ptr, ptr %20, align 8, !tbaa !22
  tail call void @free(ptr noundef %21) #7
  %22 = load i32, ptr %12, align 8, !tbaa !13
  %23 = icmp slt i32 %22, 3
  br i1 %23, label %24, label %26

24:                                               ; preds = %19
  %25 = tail call ptr @LZ4_createStream() #7
  br label %28

26:                                               ; preds = %19
  %27 = tail call ptr @LZ4_createStreamHC() #7
  br label %28

28:                                               ; preds = %26, %24
  %storemerge = phi ptr [ %27, %26 ], [ %25, %24 ]
  store ptr %storemerge, ptr %20, align 8, !tbaa !22
  %29 = icmp eq ptr %storemerge, null
  br i1 %29, label %44, label %30

30:                                               ; preds = %28
  store i16 %15, ptr %16, align 8, !tbaa !21
  %31 = getelementptr inbounds i8, ptr %0, i64 178
  br label %.sink.split

32:                                               ; preds = %10
  %33 = getelementptr inbounds i8, ptr %0, i64 178
  %34 = load i16, ptr %33, align 2, !tbaa !23
  %.not = icmp eq i16 %34, %15
  br i1 %.not, label %46, label %35

35:                                               ; preds = %32
  %36 = getelementptr inbounds i8, ptr %0, i64 168
  %37 = load ptr, ptr %36, align 8, !tbaa !22
  br i1 %14, label %38, label %40

38:                                               ; preds = %35
  %39 = tail call ptr @LZ4_initStream(ptr noundef %37, i64 noundef 16416) #7
  br label %.sink.split

40:                                               ; preds = %35
  %41 = tail call ptr @LZ4_initStreamHC(ptr noundef %37, i64 noundef 262200) #7
  %42 = load ptr, ptr %36, align 8, !tbaa !22
  %43 = load i32, ptr %12, align 8, !tbaa !13
  tail call void @LZ4_setCompressionLevel(ptr noundef %42, i32 noundef %43) #7
  br label %.sink.split

44:                                               ; preds = %28
  %45 = tail call i64 @err0r(i32 noundef 9)
  br label %143

.sink.split:                                      ; preds = %38, %40, %30
  %.sink = phi ptr [ %31, %30 ], [ %33, %40 ], [ %33, %38 ]
  store i16 %15, ptr %.sink, align 2, !tbaa !23
  br label %46

46:                                               ; preds = %.sink.split, %32
  %47 = load i32, ptr %0, align 8, !tbaa !24
  %48 = icmp eq i32 %47, 0
  br i1 %48, label %49, label %50

49:                                               ; preds = %46
  store i32 4, ptr %0, align 8, !tbaa !24
  br label %50

50:                                               ; preds = %49, %46
  %51 = phi i32 [ 4, %49 ], [ %47, %46 ]
  %52 = tail call i64 @LZ4F_getBlockSize(i32 noundef %51)
  %53 = getelementptr inbounds i8, ptr %0, i64 72
  store i64 %52, ptr %53, align 8, !tbaa !25
  %spec.store.select.sroa.sel.v.sroa.sel.v.sroa.sel.v = select i1 %11, ptr %6, ptr %4
  %spec.store.select.sroa.sel.v.sroa.sel.v.sroa.sel = getelementptr inbounds i8, ptr %spec.store.select.sroa.sel.v.sroa.sel.v.sroa.sel.v, i64 36
  %54 = load i32, ptr %spec.store.select.sroa.sel.v.sroa.sel.v.sroa.sel, align 4, !tbaa !26
  %.not96 = icmp eq i32 %54, 0
  %55 = getelementptr inbounds i8, ptr %0, i64 4
  %56 = load i32, ptr %55, align 4, !tbaa !27
  %57 = icmp eq i32 %56, 0
  %58 = select i1 %57, i64 65536, i64 0
  %59 = select i1 %57, i64 131072, i64 0
  %60 = add i64 %59, %52
  %61 = select i1 %.not96, i64 %60, i64 %58
  %62 = getelementptr inbounds i8, ptr %0, i64 80
  %63 = load i64, ptr %62, align 8, !tbaa !28
  %64 = icmp ult i64 %63, %61
  br i1 %64, label %65, label %._crit_edge

._crit_edge:                                      ; preds = %50
  %.phi.trans.insert = getelementptr inbounds i8, ptr %0, i64 88
  %.pre = load ptr, ptr %.phi.trans.insert, align 8, !tbaa !29
  br label %73

65:                                               ; preds = %50
  store i64 0, ptr %62, align 8, !tbaa !28
  %66 = getelementptr inbounds i8, ptr %0, i64 88
  %67 = load ptr, ptr %66, align 8, !tbaa !29
  tail call void @free(ptr noundef %67) #7
  %68 = tail call noalias ptr @calloc(i64 noundef 1, i64 noundef %61) #8
  store ptr %68, ptr %66, align 8, !tbaa !29
  %69 = icmp eq ptr %68, null
  br i1 %69, label %71, label %70

70:                                               ; preds = %65
  store i64 %61, ptr %62, align 8, !tbaa !28
  br label %73

71:                                               ; preds = %65
  %72 = tail call i64 @err0r(i32 noundef 9)
  br label %143

73:                                               ; preds = %._crit_edge, %70
  %74 = phi ptr [ %.pre, %._crit_edge ], [ %68, %70 ]
  %75 = getelementptr inbounds i8, ptr %0, i64 96
  store ptr %74, ptr %75, align 8, !tbaa !30
  %76 = getelementptr inbounds i8, ptr %0, i64 104
  store i64 0, ptr %76, align 8, !tbaa !31
  %77 = getelementptr inbounds i8, ptr %0, i64 120
  %78 = tail call i32 @XXH32_reset(ptr noundef nonnull %77, i32 noundef 0) #7
  %79 = getelementptr inbounds i8, ptr %0, i64 64
  store ptr %3, ptr %79, align 8, !tbaa !32
  %80 = getelementptr inbounds i8, ptr %0, i64 4
  %81 = load i32, ptr %80, align 4, !tbaa !27
  %82 = icmp eq i32 %81, 0
  br i1 %82, label %83, label %87

83:                                               ; preds = %73
  %84 = getelementptr inbounds i8, ptr %0, i64 168
  %85 = load ptr, ptr %84, align 8, !tbaa !22
  %86 = load i32, ptr %12, align 8, !tbaa !13
  tail call void @LZ4F_initStream(ptr noundef %85, ptr noundef %3, i32 noundef %86, i32 noundef 0)
  br label %87

87:                                               ; preds = %83, %73
  %spec.store.select.sroa.sel103.v.sroa.sel.v.sroa.sel.v = select i1 %11, ptr %6, ptr %4
  %spec.store.select.sroa.sel103.v.sroa.sel.v.sroa.sel = getelementptr inbounds i8, ptr %spec.store.select.sroa.sel103.v.sroa.sel.v.sroa.sel.v, i64 32
  %88 = load i32, ptr %spec.store.select.sroa.sel103.v.sroa.sel.v.sroa.sel, align 8, !tbaa !33
  %89 = icmp sgt i32 %88, 2
  br i1 %89, label %90, label %94

90:                                               ; preds = %87
  %91 = getelementptr inbounds i8, ptr %0, i64 168
  %92 = load ptr, ptr %91, align 8, !tbaa !22
  %spec.store.select.sroa.sel106.v.sroa.sel.v.sroa.sel.v = select i1 %11, ptr %6, ptr %4
  %spec.store.select.sroa.sel106.v.sroa.sel.v.sroa.sel = getelementptr inbounds i8, ptr %spec.store.select.sroa.sel106.v.sroa.sel.v.sroa.sel.v, i64 40
  %93 = load i32, ptr %spec.store.select.sroa.sel106.v.sroa.sel.v.sroa.sel, align 8, !tbaa !34
  tail call void @LZ4_favorDecompressionSpeed(ptr noundef %92, i32 noundef %93) #7
  br label %94

94:                                               ; preds = %90, %87
  tail call void @LZ4F_writeLE32(ptr noundef %1, i32 noundef 407708164)
  %95 = getelementptr inbounds i8, ptr %1, i64 4
  %96 = load i32, ptr %80, align 4, !tbaa !27
  %97 = shl i32 %96, 5
  %98 = and i32 %97, 32
  %99 = getelementptr inbounds i8, ptr %0, i64 28
  %100 = load i32, ptr %99, align 4, !tbaa !35
  %101 = shl i32 %100, 4
  %102 = and i32 %101, 16
  %103 = or disjoint i32 %102, %98
  %104 = getelementptr inbounds i8, ptr %0, i64 16
  %105 = load i64, ptr %104, align 8, !tbaa !36
  %.not97 = icmp eq i64 %105, 0
  %106 = select i1 %.not97, i32 0, i32 8
  %107 = or disjoint i32 %103, %106
  %108 = getelementptr inbounds i8, ptr %0, i64 8
  %109 = load i32, ptr %108, align 8, !tbaa !37
  %110 = shl i32 %109, 2
  %111 = and i32 %110, 4
  %112 = or disjoint i32 %107, %111
  %113 = getelementptr inbounds i8, ptr %0, i64 24
  %114 = load i32, ptr %113, align 8, !tbaa !38
  %115 = icmp ne i32 %114, 0
  %116 = zext i1 %115 to i32
  %117 = or disjoint i32 %112, %116
  %118 = trunc nuw nsw i32 %117 to i8
  %119 = or i8 %118, 64
  %120 = getelementptr inbounds i8, ptr %1, i64 5
  store i8 %119, ptr %95, align 1, !tbaa !12
  %121 = load i32, ptr %0, align 8, !tbaa !24
  %.tr = trunc i32 %121 to i8
  %122 = shl i8 %.tr, 4
  %123 = and i8 %122, 112
  %124 = getelementptr inbounds i8, ptr %1, i64 6
  store i8 %123, ptr %120, align 1, !tbaa !12
  %125 = load i64, ptr %104, align 8, !tbaa !36
  %.not98 = icmp eq i64 %125, 0
  br i1 %.not98, label %129, label %126

126:                                              ; preds = %94
  tail call void @LZ4F_writeLE64(ptr noundef nonnull %124, i64 noundef %125)
  %127 = getelementptr inbounds i8, ptr %1, i64 14
  %128 = getelementptr inbounds i8, ptr %0, i64 112
  store i64 0, ptr %128, align 8, !tbaa !39
  br label %129

129:                                              ; preds = %126, %94
  %.090 = phi ptr [ %127, %126 ], [ %124, %94 ]
  %130 = load i32, ptr %113, align 8, !tbaa !38
  %.not99 = icmp eq i32 %130, 0
  br i1 %.not99, label %133, label %131

131:                                              ; preds = %129
  tail call void @LZ4F_writeLE32(ptr noundef nonnull %.090, i32 noundef %130)
  %132 = getelementptr inbounds i8, ptr %.090, i64 4
  br label %133

133:                                              ; preds = %131, %129
  %.191 = phi ptr [ %132, %131 ], [ %.090, %129 ]
  %134 = ptrtoint ptr %.191 to i64
  %135 = ptrtoint ptr %95 to i64
  %136 = sub i64 %134, %135
  %137 = tail call zeroext i8 @LZ4F_headerChecksum(ptr noundef nonnull %95, i64 noundef %136)
  store i8 %137, ptr %.191, align 1, !tbaa !12
  %138 = getelementptr inbounds i8, ptr %.191, i64 1
  %139 = getelementptr inbounds i8, ptr %0, i64 60
  store i32 1, ptr %139, align 4, !tbaa !40
  %140 = ptrtoint ptr %138 to i64
  %141 = ptrtoint ptr %1 to i64
  %142 = sub i64 %140, %141
  br label %143

143:                                              ; preds = %71, %44, %133, %8
  %.2 = phi i64 [ %9, %8 ], [ %142, %133 ], [ %72, %71 ], [ %45, %44 ]
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %6) #7
  ret i64 %.2
}

declare ptr @LZ4_initStream(ptr noundef, i64 noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #5

declare ptr @LZ4_createStream() local_unnamed_addr #4

declare ptr @LZ4_createStreamHC() local_unnamed_addr #4

declare void @LZ4_setCompressionLevel(ptr noundef, i32 noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @calloc(i64 noundef, i64 noundef) local_unnamed_addr #6

declare ptr @LZ4_initStreamHC(ptr noundef, i64 noundef) local_unnamed_addr #4

declare i32 @XXH32_reset(ptr noundef, i32 noundef) local_unnamed_addr #4

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

declare void @LZ4_favorDecompressionSpeed(ptr noundef, i32 noundef) local_unnamed_addr #4

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

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

; Function Attrs: nounwind uwtable
declare hidden zeroext i8 @LZ4F_headerChecksum(ptr noundef, 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" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { "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 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "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 #6 = { mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "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 #7 = { nounwind }
attributes #8 = { nounwind allocsize(0,1) }

!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 = !{i64 0, i64 4, !6, i64 4, i64 4, !6, i64 8, i64 4, !6, i64 12, i64 4, !6, i64 16, i64 8, !10, i64 24, i64 4, !6, i64 28, i64 4, !6, i64 32, i64 4, !6, i64 36, i64 4, !6, i64 40, i64 4, !6, i64 44, i64 12, !12}
!6 = !{!7, !7, i64 0}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!11, !11, i64 0}
!11 = !{!"long long", !8, i64 0}
!12 = !{!8, !8, i64 0}
!13 = !{!14, !7, i64 32}
!14 = !{!"LZ4F_cctx_s", !15, i64 0, !7, i64 56, !7, i64 60, !17, i64 64, !18, i64 72, !18, i64 80, !17, i64 88, !17, i64 96, !18, i64 104, !18, i64 112, !19, i64 120, !17, i64 168, !20, i64 176, !20, i64 178}
!15 = !{!"", !16, i64 0, !7, i64 32, !7, i64 36, !7, i64 40, !8, i64 44}
!16 = !{!"", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !11, i64 16, !7, i64 24, !7, i64 28}
!17 = !{!"any pointer", !8, i64 0}
!18 = !{!"long", !8, i64 0}
!19 = !{!"XXH32_state_s", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20, !8, i64 24, !7, i64 40, !7, i64 44}
!20 = !{!"short", !8, i64 0}
!21 = !{!14, !20, i64 176}
!22 = !{!14, !17, i64 168}
!23 = !{!14, !20, i64 178}
!24 = !{!14, !7, i64 0}
!25 = !{!14, !18, i64 72}
!26 = !{!15, !7, i64 36}
!27 = !{!14, !7, i64 4}
!28 = !{!14, !18, i64 80}
!29 = !{!14, !17, i64 88}
!30 = !{!14, !17, i64 96}
!31 = !{!14, !18, i64 104}
!32 = !{!14, !17, i64 64}
!33 = !{!15, !7, i64 32}
!34 = !{!15, !7, i64 40}
!35 = !{!14, !7, i64 28}
!36 = !{!14, !11, i64 16}
!37 = !{!14, !7, i64 8}
!38 = !{!14, !7, i64 24}
!39 = !{!14, !18, i64 112}
!40 = !{!14, !7, i64 60}


; Effective O3 passes: BDCEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass