; LLVM IR from DanEngelbrecht/longtail :: lib/lz4/ext (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_CustomMem = type { ptr, ptr, ptr, ptr }
%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_CustomMem, %struct.LZ4F_preferences_t, i32, i32, ptr, i64, i64, ptr, ptr, i64, i64, %struct.XXH32_state_s, ptr, i16, i16, i32 }
%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 @LZ4F_returnErrorCode(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 nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.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

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

; Function Attrs: nounwind uwtable
declare hidden void @LZ4F_free(ptr noundef, ptr noundef byval(%struct.LZ4F_CustomMem) align 8) #0

; Function Attrs: nounwind uwtable
declare hidden ptr @LZ4F_malloc(i64 noundef, ptr noundef byval(%struct.LZ4F_CustomMem) align 8) #0

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

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

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

; Function Attrs: nounwind uwtable
define dso_local i64 @LZ4F_compressBegin_internal(ptr noundef %0, ptr noundef %1, i64 noundef %2, ptr noundef %3, i64 noundef %4, ptr noundef %5, ptr 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 ptr, align 8
  %16 = alloca %struct.LZ4F_preferences_t, align 8
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca i32, align 4
  %20 = alloca i16, align 2
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i64, align 8
  %24 = alloca ptr, align 8
  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 ptr %6, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 56, ptr %16) #5
  call void @llvm.memset.p0.i64(ptr align 8 %16, i8 0, i64 56, i1 false)
  %25 = getelementptr inbounds %struct.LZ4F_preferences_t, ptr %16, i32 0, i32 0
  %26 = getelementptr inbounds %struct.LZ4F_frameInfo_t, ptr %25, i32 0, i32 0
  store i32 4, ptr %26, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  %27 = load ptr, ptr %10, align 8, !tbaa !5
  store ptr %27, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  %28 = load ptr, ptr %17, align 8, !tbaa !5
  store ptr %28, ptr %18, align 8, !tbaa !5
  br label %29

29:                                               ; preds = %7
  %30 = load i64, ptr %11, align 8, !tbaa !9
  %31 = icmp ult i64 %30, 19
  br i1 %31, label %32, label %34

32:                                               ; preds = %29
  %33 = call i64 @LZ4F_returnErrorCode(i32 noundef 11)
  store i64 %33, ptr %8, align 8
  store i32 1, ptr %19, align 4
  br label %433

34:                                               ; preds = %29
  br label %35

35:                                               ; preds = %34
  br label %36

36:                                               ; preds = %35
  %37 = load ptr, ptr %15, align 8, !tbaa !5
  %38 = icmp eq ptr %37, null
  br i1 %38, label %39, label %40

39:                                               ; preds = %36
  store ptr %16, ptr %15, align 8, !tbaa !5
  br label %40

40:                                               ; preds = %39, %36
  %41 = load ptr, ptr %9, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %41, i32 0, i32 1
  %43 = load ptr, ptr %15, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %42, ptr align 8 %43, i64 56, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.start.p0(i64 2, ptr %20) #5
  %44 = load ptr, ptr %9, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %44, i32 0, i32 1
  %46 = getelementptr inbounds %struct.LZ4F_preferences_t, ptr %45, i32 0, i32 1
  %47 = load i32, ptr %46, align 8, !tbaa !17
  %48 = icmp slt i32 %47, 2
  %49 = zext i1 %48 to i64
  %50 = select i1 %48, i32 1, i32 2
  %51 = trunc i32 %50 to i16
  store i16 %51, ptr %20, align 2, !tbaa !24
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #5
  %52 = load i16, ptr %20, align 2, !tbaa !24
  %53 = zext i16 %52 to i32
  %54 = call i32 @ctxTypeID_to_size(i32 noundef %53)
  store i32 %54, ptr %21, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #5
  %55 = load ptr, ptr %9, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %55, i32 0, i32 13
  %57 = load i16, ptr %56, align 8, !tbaa !25
  %58 = zext i16 %57 to i32
  %59 = call i32 @ctxTypeID_to_size(i32 noundef %58)
  store i32 %59, ptr %22, align 4, !tbaa !12
  %60 = load i32, ptr %22, align 4, !tbaa !12
  %61 = load i32, ptr %21, align 4, !tbaa !12
  %62 = icmp slt i32 %60, %61
  br i1 %62, label %63, label %123

63:                                               ; preds = %40
  %64 = load ptr, ptr %9, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %64, i32 0, i32 12
  %66 = load ptr, ptr %65, align 8, !tbaa !26
  %67 = load ptr, ptr %9, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %67, i32 0, i32 0
  call void @LZ4F_free(ptr noundef %66, ptr noundef byval(%struct.LZ4F_CustomMem) align 8 %68)
  %69 = load ptr, ptr %9, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %69, i32 0, i32 1
  %71 = getelementptr inbounds %struct.LZ4F_preferences_t, ptr %70, i32 0, i32 1
  %72 = load i32, ptr %71, align 8, !tbaa !17
  %73 = icmp slt i32 %72, 2
  br i1 %73, label %74, label %90

74:                                               ; preds = %63
  %75 = load ptr, ptr %9, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %75, i32 0, i32 0
  %77 = call ptr @LZ4F_malloc(i64 noundef 16416, ptr noundef byval(%struct.LZ4F_CustomMem) align 8 %76)
  %78 = load ptr, ptr %9, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %78, i32 0, i32 12
  store ptr %77, ptr %79, align 8, !tbaa !26
  %80 = load ptr, ptr %9, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %80, i32 0, i32 12
  %82 = load ptr, ptr %81, align 8, !tbaa !26
  %83 = icmp ne ptr %82, null
  br i1 %83, label %84, label %89

84:                                               ; preds = %74
  %85 = load ptr, ptr %9, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %85, i32 0, i32 12
  %87 = load ptr, ptr %86, align 8, !tbaa !26
  %88 = call ptr @LZ4_initStream(ptr noundef %87, i64 noundef 16416)
  br label %89

89:                                               ; preds = %84, %74
  br label %106

90:                                               ; preds = %63
  %91 = load ptr, ptr %9, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %91, i32 0, i32 0
  %93 = call ptr @LZ4F_malloc(i64 noundef 262200, ptr noundef byval(%struct.LZ4F_CustomMem) align 8 %92)
  %94 = load ptr, ptr %9, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %94, i32 0, i32 12
  store ptr %93, ptr %95, align 8, !tbaa !26
  %96 = load ptr, ptr %9, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %96, i32 0, i32 12
  %98 = load ptr, ptr %97, align 8, !tbaa !26
  %99 = icmp ne ptr %98, null
  br i1 %99, label %100, label %105

100:                                              ; preds = %90
  %101 = load ptr, ptr %9, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %101, i32 0, i32 12
  %103 = load ptr, ptr %102, align 8, !tbaa !26
  %104 = call ptr @LZ4_initStreamHC(ptr noundef %103, i64 noundef 262200)
  br label %105

105:                                              ; preds = %100, %90
  br label %106

106:                                              ; preds = %105, %89
  br label %107

107:                                              ; preds = %106
  %108 = load ptr, ptr %9, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %108, i32 0, i32 12
  %110 = load ptr, ptr %109, align 8, !tbaa !26
  %111 = icmp eq ptr %110, null
  br i1 %111, label %112, label %114

112:                                              ; preds = %107
  %113 = call i64 @LZ4F_returnErrorCode(i32 noundef 9)
  store i64 %113, ptr %8, align 8
  store i32 1, ptr %19, align 4
  br label %160

114:                                              ; preds = %107
  br label %115

115:                                              ; preds = %114
  br label %116

116:                                              ; preds = %115
  %117 = load i16, ptr %20, align 2, !tbaa !24
  %118 = load ptr, ptr %9, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %118, i32 0, i32 13
  store i16 %117, ptr %119, align 8, !tbaa !25
  %120 = load i16, ptr %20, align 2, !tbaa !24
  %121 = load ptr, ptr %9, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %121, i32 0, i32 14
  store i16 %120, ptr %122, align 2, !tbaa !27
  br label %159

123:                                              ; preds = %40
  %124 = load ptr, ptr %9, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %124, i32 0, i32 14
  %126 = load i16, ptr %125, align 2, !tbaa !27
  %127 = zext i16 %126 to i32
  %128 = load i16, ptr %20, align 2, !tbaa !24
  %129 = zext i16 %128 to i32
  %130 = icmp ne i32 %127, %129
  br i1 %130, label %131, label %158

131:                                              ; preds = %123
  %132 = load ptr, ptr %9, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %132, i32 0, i32 1
  %134 = getelementptr inbounds %struct.LZ4F_preferences_t, ptr %133, i32 0, i32 1
  %135 = load i32, ptr %134, align 8, !tbaa !17
  %136 = icmp slt i32 %135, 2
  br i1 %136, label %137, label %142

137:                                              ; preds = %131
  %138 = load ptr, ptr %9, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %138, i32 0, i32 12
  %140 = load ptr, ptr %139, align 8, !tbaa !26
  %141 = call ptr @LZ4_initStream(ptr noundef %140, i64 noundef 16416)
  br label %154

142:                                              ; preds = %131
  %143 = load ptr, ptr %9, align 8, !tbaa !5
  %144 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %143, i32 0, i32 12
  %145 = load ptr, ptr %144, align 8, !tbaa !26
  %146 = call ptr @LZ4_initStreamHC(ptr noundef %145, i64 noundef 262200)
  %147 = load ptr, ptr %9, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %147, i32 0, i32 12
  %149 = load ptr, ptr %148, align 8, !tbaa !26
  %150 = load ptr, ptr %9, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %150, i32 0, i32 1
  %152 = getelementptr inbounds %struct.LZ4F_preferences_t, ptr %151, i32 0, i32 1
  %153 = load i32, ptr %152, align 8, !tbaa !17
  call void @LZ4_setCompressionLevel(ptr noundef %149, i32 noundef %153)
  br label %154

154:                                              ; preds = %142, %137
  %155 = load i16, ptr %20, align 2, !tbaa !24
  %156 = load ptr, ptr %9, align 8, !tbaa !5
  %157 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %156, i32 0, i32 14
  store i16 %155, ptr %157, align 2, !tbaa !27
  br label %158

158:                                              ; preds = %154, %123
  br label %159

159:                                              ; preds = %158, %116
  store i32 0, ptr %19, align 4
  br label %160

160:                                              ; preds = %159, %112
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 2, ptr %20) #5
  %161 = load i32, ptr %19, align 4
  switch i32 %161, label %433 [
    i32 0, label %162
  ]

162:                                              ; preds = %160
  %163 = load ptr, ptr %9, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %163, i32 0, i32 1
  %165 = getelementptr inbounds %struct.LZ4F_preferences_t, ptr %164, i32 0, i32 0
  %166 = getelementptr inbounds %struct.LZ4F_frameInfo_t, ptr %165, i32 0, i32 0
  %167 = load i32, ptr %166, align 8, !tbaa !28
  %168 = icmp eq i32 %167, 0
  br i1 %168, label %169, label %174

169:                                              ; preds = %162
  %170 = load ptr, ptr %9, align 8, !tbaa !5
  %171 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %170, i32 0, i32 1
  %172 = getelementptr inbounds %struct.LZ4F_preferences_t, ptr %171, i32 0, i32 0
  %173 = getelementptr inbounds %struct.LZ4F_frameInfo_t, ptr %172, i32 0, i32 0
  store i32 4, ptr %173, align 8, !tbaa !28
  br label %174

174:                                              ; preds = %169, %162
  %175 = load ptr, ptr %9, align 8, !tbaa !5
  %176 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %175, i32 0, i32 1
  %177 = getelementptr inbounds %struct.LZ4F_preferences_t, ptr %176, i32 0, i32 0
  %178 = getelementptr inbounds %struct.LZ4F_frameInfo_t, ptr %177, i32 0, i32 0
  %179 = load i32, ptr %178, align 8, !tbaa !28
  %180 = call i64 @LZ4F_getBlockSize(i32 noundef %179)
  %181 = load ptr, ptr %9, align 8, !tbaa !5
  %182 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %181, i32 0, i32 5
  store i64 %180, ptr %182, align 8, !tbaa !29
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #5
  %183 = load ptr, ptr %15, align 8, !tbaa !5
  %184 = getelementptr inbounds %struct.LZ4F_preferences_t, ptr %183, i32 0, i32 2
  %185 = load i32, ptr %184, align 4, !tbaa !30
  %186 = icmp ne i32 %185, 0
  br i1 %186, label %187, label %197

187:                                              ; preds = %174
  %188 = load ptr, ptr %9, align 8, !tbaa !5
  %189 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %188, i32 0, i32 1
  %190 = getelementptr inbounds %struct.LZ4F_preferences_t, ptr %189, i32 0, i32 0
  %191 = getelementptr inbounds %struct.LZ4F_frameInfo_t, ptr %190, i32 0, i32 1
  %192 = load i32, ptr %191, align 4, !tbaa !31
  %193 = icmp eq i32 %192, 0
  %194 = zext i1 %193 to i64
  %195 = select i1 %193, i32 65536, i32 0
  %196 = sext i32 %195 to i64
  br label %211

197:                                              ; preds = %174
  %198 = load ptr, ptr %9, align 8, !tbaa !5
  %199 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %198, i32 0, i32 5
  %200 = load i64, ptr %199, align 8, !tbaa !29
  %201 = load ptr, ptr %9, align 8, !tbaa !5
  %202 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %201, i32 0, i32 1
  %203 = getelementptr inbounds %struct.LZ4F_preferences_t, ptr %202, i32 0, i32 0
  %204 = getelementptr inbounds %struct.LZ4F_frameInfo_t, ptr %203, i32 0, i32 1
  %205 = load i32, ptr %204, align 4, !tbaa !31
  %206 = icmp eq i32 %205, 0
  %207 = zext i1 %206 to i64
  %208 = select i1 %206, i32 131072, i32 0
  %209 = sext i32 %208 to i64
  %210 = add i64 %200, %209
  br label %211

211:                                              ; preds = %197, %187
  %212 = phi i64 [ %196, %187 ], [ %210, %197 ]
  store i64 %212, ptr %23, align 8, !tbaa !9
  %213 = load ptr, ptr %9, align 8, !tbaa !5
  %214 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %213, i32 0, i32 6
  %215 = load i64, ptr %214, align 8, !tbaa !32
  %216 = load i64, ptr %23, align 8, !tbaa !9
  %217 = icmp ult i64 %215, %216
  br i1 %217, label %218, label %245

218:                                              ; preds = %211
  %219 = load ptr, ptr %9, align 8, !tbaa !5
  %220 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %219, i32 0, i32 6
  store i64 0, ptr %220, align 8, !tbaa !32
  %221 = load ptr, ptr %9, align 8, !tbaa !5
  %222 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %221, i32 0, i32 7
  %223 = load ptr, ptr %222, align 8, !tbaa !33
  %224 = load ptr, ptr %9, align 8, !tbaa !5
  %225 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %224, i32 0, i32 0
  call void @LZ4F_free(ptr noundef %223, ptr noundef byval(%struct.LZ4F_CustomMem) align 8 %225)
  %226 = load i64, ptr %23, align 8, !tbaa !9
  %227 = load ptr, ptr %9, align 8, !tbaa !5
  %228 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %227, i32 0, i32 0
  %229 = call ptr @LZ4F_malloc(i64 noundef %226, ptr noundef byval(%struct.LZ4F_CustomMem) align 8 %228)
  %230 = load ptr, ptr %9, align 8, !tbaa !5
  %231 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %230, i32 0, i32 7
  store ptr %229, ptr %231, align 8, !tbaa !33
  br label %232

232:                                              ; preds = %218
  %233 = load ptr, ptr %9, align 8, !tbaa !5
  %234 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %233, i32 0, i32 7
  %235 = load ptr, ptr %234, align 8, !tbaa !33
  %236 = icmp eq ptr %235, null
  br i1 %236, label %237, label %239

237:                                              ; preds = %232
  %238 = call i64 @LZ4F_returnErrorCode(i32 noundef 9)
  store i64 %238, ptr %8, align 8
  store i32 1, ptr %19, align 4
  br label %246

239:                                              ; preds = %232
  br label %240

240:                                              ; preds = %239
  br label %241

241:                                              ; preds = %240
  %242 = load i64, ptr %23, align 8, !tbaa !9
  %243 = load ptr, ptr %9, align 8, !tbaa !5
  %244 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %243, i32 0, i32 6
  store i64 %242, ptr %244, align 8, !tbaa !32
  br label %245

245:                                              ; preds = %241, %211
  store i32 0, ptr %19, align 4
  br label %246

246:                                              ; preds = %245, %237
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #5
  %247 = load i32, ptr %19, align 4
  switch i32 %247, label %433 [
    i32 0, label %248
  ]

248:                                              ; preds = %246
  %249 = load ptr, ptr %9, align 8, !tbaa !5
  %250 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %249, i32 0, i32 7
  %251 = load ptr, ptr %250, align 8, !tbaa !33
  %252 = load ptr, ptr %9, align 8, !tbaa !5
  %253 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %252, i32 0, i32 8
  store ptr %251, ptr %253, align 8, !tbaa !34
  %254 = load ptr, ptr %9, align 8, !tbaa !5
  %255 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %254, i32 0, i32 9
  store i64 0, ptr %255, align 8, !tbaa !35
  %256 = load ptr, ptr %9, align 8, !tbaa !5
  %257 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %256, i32 0, i32 11
  %258 = call i32 @XXH32_reset(ptr noundef %257, i32 noundef 0)
  %259 = load ptr, ptr %14, align 8, !tbaa !5
  %260 = load ptr, ptr %9, align 8, !tbaa !5
  %261 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %260, i32 0, i32 4
  store ptr %259, ptr %261, align 8, !tbaa !36
  %262 = load ptr, ptr %9, align 8, !tbaa !5
  %263 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %262, i32 0, i32 1
  %264 = getelementptr inbounds %struct.LZ4F_preferences_t, ptr %263, i32 0, i32 0
  %265 = getelementptr inbounds %struct.LZ4F_frameInfo_t, ptr %264, i32 0, i32 1
  %266 = load i32, ptr %265, align 4, !tbaa !31
  %267 = icmp eq i32 %266, 0
  br i1 %267, label %268, label %277

268:                                              ; preds = %248
  %269 = load ptr, ptr %9, align 8, !tbaa !5
  %270 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %269, i32 0, i32 12
  %271 = load ptr, ptr %270, align 8, !tbaa !26
  %272 = load ptr, ptr %14, align 8, !tbaa !5
  %273 = load ptr, ptr %9, align 8, !tbaa !5
  %274 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %273, i32 0, i32 1
  %275 = getelementptr inbounds %struct.LZ4F_preferences_t, ptr %274, i32 0, i32 1
  %276 = load i32, ptr %275, align 8, !tbaa !17
  call void @LZ4F_initStream(ptr noundef %271, ptr noundef %272, i32 noundef %276, i32 noundef 0)
  br label %277

277:                                              ; preds = %268, %248
  %278 = load ptr, ptr %15, align 8, !tbaa !5
  %279 = getelementptr inbounds %struct.LZ4F_preferences_t, ptr %278, i32 0, i32 1
  %280 = load i32, ptr %279, align 8, !tbaa !37
  %281 = icmp sge i32 %280, 2
  br i1 %281, label %282, label %289

282:                                              ; preds = %277
  %283 = load ptr, ptr %9, align 8, !tbaa !5
  %284 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %283, i32 0, i32 12
  %285 = load ptr, ptr %284, align 8, !tbaa !26
  %286 = load ptr, ptr %15, align 8, !tbaa !5
  %287 = getelementptr inbounds %struct.LZ4F_preferences_t, ptr %286, i32 0, i32 3
  %288 = load i32, ptr %287, align 8, !tbaa !38
  call void @LZ4_favorDecompressionSpeed(ptr noundef %285, i32 noundef %288)
  br label %289

289:                                              ; preds = %282, %277
  %290 = load ptr, ptr %12, align 8, !tbaa !5
  %291 = icmp ne ptr %290, null
  br i1 %291, label %292, label %323

292:                                              ; preds = %289
  br label %293

293:                                              ; preds = %292
  %294 = load i64, ptr %13, align 8, !tbaa !9
  %295 = icmp ugt i64 %294, 2147483647
  br i1 %295, label %296, label %298

296:                                              ; preds = %293
  %297 = call i64 @LZ4F_returnErrorCode(i32 noundef 4)
  store i64 %297, ptr %8, align 8
  store i32 1, ptr %19, align 4
  br label %433

298:                                              ; preds = %293
  br label %299

299:                                              ; preds = %298
  br label %300

300:                                              ; preds = %299
  %301 = load ptr, ptr %9, align 8, !tbaa !5
  %302 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %301, i32 0, i32 14
  %303 = load i16, ptr %302, align 2, !tbaa !27
  %304 = zext i16 %303 to i32
  %305 = icmp eq i32 %304, 1
  br i1 %305, label %306, label %314

306:                                              ; preds = %300
  %307 = load ptr, ptr %9, align 8, !tbaa !5
  %308 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %307, i32 0, i32 12
  %309 = load ptr, ptr %308, align 8, !tbaa !26
  %310 = load ptr, ptr %12, align 8, !tbaa !5
  %311 = load i64, ptr %13, align 8, !tbaa !9
  %312 = trunc i64 %311 to i32
  %313 = call i32 @LZ4_loadDict(ptr noundef %309, ptr noundef %310, i32 noundef %312)
  br label %322

314:                                              ; preds = %300
  %315 = load ptr, ptr %9, align 8, !tbaa !5
  %316 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %315, i32 0, i32 12
  %317 = load ptr, ptr %316, align 8, !tbaa !26
  %318 = load ptr, ptr %12, align 8, !tbaa !5
  %319 = load i64, ptr %13, align 8, !tbaa !9
  %320 = trunc i64 %319 to i32
  %321 = call i32 @LZ4_loadDictHC(ptr noundef %317, ptr noundef %318, i32 noundef %320)
  br label %322

322:                                              ; preds = %314, %306
  br label %323

323:                                              ; preds = %322, %289
  %324 = load ptr, ptr %18, align 8, !tbaa !5
  call void @LZ4F_writeLE32(ptr noundef %324, i32 noundef 407708164)
  %325 = load ptr, ptr %18, align 8, !tbaa !5
  %326 = getelementptr inbounds i8, ptr %325, i64 4
  store ptr %326, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #5
  %327 = load ptr, ptr %18, align 8, !tbaa !5
  store ptr %327, ptr %24, align 8, !tbaa !5
  %328 = load ptr, ptr %9, align 8, !tbaa !5
  %329 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %328, i32 0, i32 1
  %330 = getelementptr inbounds %struct.LZ4F_preferences_t, ptr %329, i32 0, i32 0
  %331 = getelementptr inbounds %struct.LZ4F_frameInfo_t, ptr %330, i32 0, i32 1
  %332 = load i32, ptr %331, align 4, !tbaa !31
  %333 = and i32 %332, 1
  %334 = shl i32 %333, 5
  %335 = add i32 64, %334
  %336 = load ptr, ptr %9, align 8, !tbaa !5
  %337 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %336, i32 0, i32 1
  %338 = getelementptr inbounds %struct.LZ4F_preferences_t, ptr %337, i32 0, i32 0
  %339 = getelementptr inbounds %struct.LZ4F_frameInfo_t, ptr %338, i32 0, i32 6
  %340 = load i32, ptr %339, align 4, !tbaa !39
  %341 = and i32 %340, 1
  %342 = shl i32 %341, 4
  %343 = add i32 %335, %342
  %344 = load ptr, ptr %9, align 8, !tbaa !5
  %345 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %344, i32 0, i32 1
  %346 = getelementptr inbounds %struct.LZ4F_preferences_t, ptr %345, i32 0, i32 0
  %347 = getelementptr inbounds %struct.LZ4F_frameInfo_t, ptr %346, i32 0, i32 4
  %348 = load i64, ptr %347, align 8, !tbaa !40
  %349 = icmp ugt i64 %348, 0
  %350 = zext i1 %349 to i32
  %351 = shl i32 %350, 3
  %352 = add i32 %343, %351
  %353 = load ptr, ptr %9, align 8, !tbaa !5
  %354 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %353, i32 0, i32 1
  %355 = getelementptr inbounds %struct.LZ4F_preferences_t, ptr %354, i32 0, i32 0
  %356 = getelementptr inbounds %struct.LZ4F_frameInfo_t, ptr %355, i32 0, i32 2
  %357 = load i32, ptr %356, align 8, !tbaa !41
  %358 = and i32 %357, 1
  %359 = shl i32 %358, 2
  %360 = add i32 %352, %359
  %361 = load ptr, ptr %9, align 8, !tbaa !5
  %362 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %361, i32 0, i32 1
  %363 = getelementptr inbounds %struct.LZ4F_preferences_t, ptr %362, i32 0, i32 0
  %364 = getelementptr inbounds %struct.LZ4F_frameInfo_t, ptr %363, i32 0, i32 5
  %365 = load i32, ptr %364, align 8, !tbaa !42
  %366 = icmp ugt i32 %365, 0
  %367 = zext i1 %366 to i32
  %368 = add i32 %360, %367
  %369 = trunc i32 %368 to i8
  %370 = load ptr, ptr %18, align 8, !tbaa !5
  %371 = getelementptr inbounds i8, ptr %370, i32 1
  store ptr %371, ptr %18, align 8, !tbaa !5
  store i8 %369, ptr %370, align 1, !tbaa !16
  %372 = load ptr, ptr %9, align 8, !tbaa !5
  %373 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %372, i32 0, i32 1
  %374 = getelementptr inbounds %struct.LZ4F_preferences_t, ptr %373, i32 0, i32 0
  %375 = getelementptr inbounds %struct.LZ4F_frameInfo_t, ptr %374, i32 0, i32 0
  %376 = load i32, ptr %375, align 8, !tbaa !28
  %377 = and i32 %376, 7
  %378 = shl i32 %377, 4
  %379 = trunc i32 %378 to i8
  %380 = load ptr, ptr %18, align 8, !tbaa !5
  %381 = getelementptr inbounds i8, ptr %380, i32 1
  store ptr %381, ptr %18, align 8, !tbaa !5
  store i8 %379, ptr %380, align 1, !tbaa !16
  %382 = load ptr, ptr %9, align 8, !tbaa !5
  %383 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %382, i32 0, i32 1
  %384 = getelementptr inbounds %struct.LZ4F_preferences_t, ptr %383, i32 0, i32 0
  %385 = getelementptr inbounds %struct.LZ4F_frameInfo_t, ptr %384, i32 0, i32 4
  %386 = load i64, ptr %385, align 8, !tbaa !40
  %387 = icmp ne i64 %386, 0
  br i1 %387, label %388, label %399

388:                                              ; preds = %323
  %389 = load ptr, ptr %18, align 8, !tbaa !5
  %390 = load ptr, ptr %9, align 8, !tbaa !5
  %391 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %390, i32 0, i32 1
  %392 = getelementptr inbounds %struct.LZ4F_preferences_t, ptr %391, i32 0, i32 0
  %393 = getelementptr inbounds %struct.LZ4F_frameInfo_t, ptr %392, i32 0, i32 4
  %394 = load i64, ptr %393, align 8, !tbaa !40
  call void @LZ4F_writeLE64(ptr noundef %389, i64 noundef %394)
  %395 = load ptr, ptr %18, align 8, !tbaa !5
  %396 = getelementptr inbounds i8, ptr %395, i64 8
  store ptr %396, ptr %18, align 8, !tbaa !5
  %397 = load ptr, ptr %9, align 8, !tbaa !5
  %398 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %397, i32 0, i32 10
  store i64 0, ptr %398, align 8, !tbaa !43
  br label %399

399:                                              ; preds = %388, %323
  %400 = load ptr, ptr %9, align 8, !tbaa !5
  %401 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %400, i32 0, i32 1
  %402 = getelementptr inbounds %struct.LZ4F_preferences_t, ptr %401, i32 0, i32 0
  %403 = getelementptr inbounds %struct.LZ4F_frameInfo_t, ptr %402, i32 0, i32 5
  %404 = load i32, ptr %403, align 8, !tbaa !42
  %405 = icmp ne i32 %404, 0
  br i1 %405, label %406, label %415

406:                                              ; preds = %399
  %407 = load ptr, ptr %18, align 8, !tbaa !5
  %408 = load ptr, ptr %9, align 8, !tbaa !5
  %409 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %408, i32 0, i32 1
  %410 = getelementptr inbounds %struct.LZ4F_preferences_t, ptr %409, i32 0, i32 0
  %411 = getelementptr inbounds %struct.LZ4F_frameInfo_t, ptr %410, i32 0, i32 5
  %412 = load i32, ptr %411, align 8, !tbaa !42
  call void @LZ4F_writeLE32(ptr noundef %407, i32 noundef %412)
  %413 = load ptr, ptr %18, align 8, !tbaa !5
  %414 = getelementptr inbounds i8, ptr %413, i64 4
  store ptr %414, ptr %18, align 8, !tbaa !5
  br label %415

415:                                              ; preds = %406, %399
  %416 = load ptr, ptr %24, align 8, !tbaa !5
  %417 = load ptr, ptr %18, align 8, !tbaa !5
  %418 = load ptr, ptr %24, align 8, !tbaa !5
  %419 = ptrtoint ptr %417 to i64
  %420 = ptrtoint ptr %418 to i64
  %421 = sub i64 %419, %420
  %422 = call zeroext i8 @LZ4F_headerChecksum(ptr noundef %416, i64 noundef %421)
  %423 = load ptr, ptr %18, align 8, !tbaa !5
  store i8 %422, ptr %423, align 1, !tbaa !16
  %424 = load ptr, ptr %18, align 8, !tbaa !5
  %425 = getelementptr inbounds i8, ptr %424, i32 1
  store ptr %425, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #5
  %426 = load ptr, ptr %9, align 8, !tbaa !5
  %427 = getelementptr inbounds %struct.LZ4F_cctx_s, ptr %426, i32 0, i32 3
  store i32 1, ptr %427, align 4, !tbaa !44
  %428 = load ptr, ptr %18, align 8, !tbaa !5
  %429 = load ptr, ptr %17, align 8, !tbaa !5
  %430 = ptrtoint ptr %428 to i64
  %431 = ptrtoint ptr %429 to i64
  %432 = sub i64 %430, %431
  store i64 %432, ptr %8, align 8
  store i32 1, ptr %19, align 4
  br label %433

433:                                              ; preds = %415, %296, %246, %160, %32
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 56, ptr %16) #5
  %434 = load i64, ptr %8, align 8
  ret i64 %434
}

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

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

declare i32 @LZ4_loadDict(ptr noundef, 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 }

!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 64}
!18 = !{!"LZ4F_cctx_s", !19, i64 0, !20, i64 32, !13, i64 88, !13, i64 92, !6, i64 96, !10, i64 104, !10, i64 112, !6, i64 120, !6, i64 128, !10, i64 136, !10, i64 144, !22, i64 152, !6, i64 200, !23, i64 208, !23, i64 210, !13, i64 212}
!19 = !{!"", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!20 = !{!"", !21, i64 0, !13, i64 32, !13, i64 36, !13, i64 40, !7, i64 44}
!21 = !{!"", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !15, i64 16, !13, i64 24, !13, i64 28}
!22 = !{!"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}
!23 = !{!"short", !7, i64 0}
!24 = !{!23, !23, i64 0}
!25 = !{!18, !23, i64 208}
!26 = !{!18, !6, i64 200}
!27 = !{!18, !23, i64 210}
!28 = !{!18, !13, i64 32}
!29 = !{!18, !10, i64 104}
!30 = !{!20, !13, i64 36}
!31 = !{!18, !13, i64 36}
!32 = !{!18, !10, i64 112}
!33 = !{!18, !6, i64 120}
!34 = !{!18, !6, i64 128}
!35 = !{!18, !10, i64 136}
!36 = !{!18, !6, i64 96}
!37 = !{!20, !13, i64 32}
!38 = !{!20, !13, i64 40}
!39 = !{!18, !13, i64 60}
!40 = !{!18, !15, i64 48}
!41 = !{!18, !13, i64 40}
!42 = !{!18, !13, i64 56}
!43 = !{!18, !10, i64 144}
!44 = !{!18, !13, i64 92}


; 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_CustomMem = type { ptr, ptr, ptr, ptr }
%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 @LZ4F_returnErrorCode(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 nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.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

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

; Function Attrs: nounwind uwtable
declare hidden void @LZ4F_free(ptr noundef, ptr noundef byval(%struct.LZ4F_CustomMem) align 8) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare hidden ptr @LZ4F_malloc(i64 noundef, ptr noundef byval(%struct.LZ4F_CustomMem) align 8) local_unnamed_addr #0

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

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

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

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

10:                                               ; preds = %7
  %11 = tail call i64 @LZ4F_returnErrorCode(i32 noundef 11)
  br label %171

12:                                               ; preds = %7
  %13 = icmp eq ptr %6, null
  %spec.store.select = select i1 %13, ptr %8, ptr %6
  %14 = getelementptr inbounds i8, ptr %0, i64 32
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(56) %14, ptr noundef nonnull align 8 dereferenceable(56) %spec.store.select, i64 56, i1 false), !tbaa.struct !5
  %15 = getelementptr inbounds i8, ptr %0, i64 64
  %16 = load i32, ptr %15, align 8, !tbaa !13
  %17 = icmp slt i32 %16, 2
  %18 = select i1 %17, i16 1, i16 2
  %19 = zext nneg i16 %18 to i32
  %20 = tail call i32 @ctxTypeID_to_size(i32 noundef %19)
  %21 = getelementptr inbounds i8, ptr %0, i64 208
  %22 = load i16, ptr %21, align 8, !tbaa !22
  %23 = zext i16 %22 to i32
  %24 = tail call i32 @ctxTypeID_to_size(i32 noundef %23)
  %25 = icmp slt i32 %24, %20
  br i1 %25, label %26, label %43

26:                                               ; preds = %12
  %27 = getelementptr inbounds i8, ptr %0, i64 200
  %28 = load ptr, ptr %27, align 8, !tbaa !23
  tail call void @LZ4F_free(ptr noundef %28, ptr noundef nonnull byval(%struct.LZ4F_CustomMem) align 8 %0)
  %29 = load i32, ptr %15, align 8, !tbaa !13
  %30 = icmp slt i32 %29, 2
  br i1 %30, label %31, label %35

31:                                               ; preds = %26
  %32 = tail call ptr @LZ4F_malloc(i64 noundef 16416, ptr noundef nonnull byval(%struct.LZ4F_CustomMem) align 8 %0)
  store ptr %32, ptr %27, align 8, !tbaa !23
  %.not120 = icmp eq ptr %32, null
  br i1 %.not120, label %.thread, label %33

33:                                               ; preds = %31
  %34 = tail call ptr @LZ4_initStream(ptr noundef nonnull %32, i64 noundef 16416) #5
  br label %39

35:                                               ; preds = %26
  %36 = tail call ptr @LZ4F_malloc(i64 noundef 262200, ptr noundef nonnull byval(%struct.LZ4F_CustomMem) align 8 %0)
  store ptr %36, ptr %27, align 8, !tbaa !23
  %.not119 = icmp eq ptr %36, null
  br i1 %.not119, label %.thread, label %37

37:                                               ; preds = %35
  %38 = tail call ptr @LZ4_initStreamHC(ptr noundef nonnull %36, i64 noundef 262200) #5
  br label %39

39:                                               ; preds = %33, %37
  %.pr = load ptr, ptr %27, align 8, !tbaa !23
  %40 = icmp eq ptr %.pr, null
  br i1 %40, label %.thread, label %41

41:                                               ; preds = %39
  store i16 %18, ptr %21, align 8, !tbaa !22
  %42 = getelementptr inbounds i8, ptr %0, i64 210
  br label %.sink.split

43:                                               ; preds = %12
  %44 = getelementptr inbounds i8, ptr %0, i64 210
  %45 = load i16, ptr %44, align 2, !tbaa !24
  %.not = icmp eq i16 %45, %18
  br i1 %.not, label %58, label %46

46:                                               ; preds = %43
  %47 = load i32, ptr %15, align 8, !tbaa !13
  %48 = icmp slt i32 %47, 2
  %49 = getelementptr inbounds i8, ptr %0, i64 200
  %50 = load ptr, ptr %49, align 8, !tbaa !23
  br i1 %48, label %51, label %53

51:                                               ; preds = %46
  %52 = tail call ptr @LZ4_initStream(ptr noundef %50, i64 noundef 16416) #5
  br label %.sink.split

53:                                               ; preds = %46
  %54 = tail call ptr @LZ4_initStreamHC(ptr noundef %50, i64 noundef 262200) #5
  %55 = load ptr, ptr %49, align 8, !tbaa !23
  %56 = load i32, ptr %15, align 8, !tbaa !13
  tail call void @LZ4_setCompressionLevel(ptr noundef %55, i32 noundef %56) #5
  br label %.sink.split

.thread:                                          ; preds = %35, %31, %39
  %57 = tail call i64 @LZ4F_returnErrorCode(i32 noundef 9)
  br label %171

.sink.split:                                      ; preds = %51, %53, %41
  %.sink = phi ptr [ %42, %41 ], [ %44, %53 ], [ %44, %51 ]
  store i16 %18, ptr %.sink, align 2, !tbaa !24
  br label %58

58:                                               ; preds = %.sink.split, %43
  %59 = load i32, ptr %14, align 8, !tbaa !25
  %60 = icmp eq i32 %59, 0
  br i1 %60, label %61, label %62

61:                                               ; preds = %58
  store i32 4, ptr %14, align 8, !tbaa !25
  br label %62

62:                                               ; preds = %61, %58
  %63 = phi i32 [ 4, %61 ], [ %59, %58 ]
  %64 = tail call i64 @LZ4F_getBlockSize(i32 noundef %63)
  %65 = getelementptr inbounds i8, ptr %0, i64 104
  store i64 %64, ptr %65, align 8, !tbaa !26
  %spec.store.select.sroa.sel.v.sroa.sel.v.sroa.sel.v = select i1 %13, ptr %8, ptr %6
  %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
  %66 = load i32, ptr %spec.store.select.sroa.sel.v.sroa.sel.v.sroa.sel, align 4, !tbaa !27
  %.not121 = icmp eq i32 %66, 0
  %67 = getelementptr inbounds i8, ptr %0, i64 36
  %68 = load i32, ptr %67, align 4, !tbaa !28
  %69 = icmp eq i32 %68, 0
  %70 = select i1 %69, i64 65536, i64 0
  %71 = select i1 %69, i64 131072, i64 0
  %72 = add i64 %71, %64
  %73 = select i1 %.not121, i64 %72, i64 %70
  %74 = getelementptr inbounds i8, ptr %0, i64 112
  %75 = load i64, ptr %74, align 8, !tbaa !29
  %76 = icmp ult i64 %75, %73
  br i1 %76, label %77, label %._crit_edge

._crit_edge:                                      ; preds = %62
  %.phi.trans.insert = getelementptr inbounds i8, ptr %0, i64 120
  %.pre = load ptr, ptr %.phi.trans.insert, align 8, !tbaa !30
  br label %85

77:                                               ; preds = %62
  store i64 0, ptr %74, align 8, !tbaa !29
  %78 = getelementptr inbounds i8, ptr %0, i64 120
  %79 = load ptr, ptr %78, align 8, !tbaa !30
  tail call void @LZ4F_free(ptr noundef %79, ptr noundef nonnull byval(%struct.LZ4F_CustomMem) align 8 %0)
  %80 = tail call ptr @LZ4F_malloc(i64 noundef %73, ptr noundef nonnull byval(%struct.LZ4F_CustomMem) align 8 %0)
  store ptr %80, ptr %78, align 8, !tbaa !30
  %81 = icmp eq ptr %80, null
  br i1 %81, label %83, label %82

82:                                               ; preds = %77
  store i64 %73, ptr %74, align 8, !tbaa !29
  br label %85

83:                                               ; preds = %77
  %84 = tail call i64 @LZ4F_returnErrorCode(i32 noundef 9)
  br label %171

85:                                               ; preds = %._crit_edge, %82
  %86 = phi ptr [ %.pre, %._crit_edge ], [ %80, %82 ]
  %87 = getelementptr inbounds i8, ptr %0, i64 128
  store ptr %86, ptr %87, align 8, !tbaa !31
  %88 = getelementptr inbounds i8, ptr %0, i64 136
  store i64 0, ptr %88, align 8, !tbaa !32
  %89 = getelementptr inbounds i8, ptr %0, i64 152
  %90 = tail call i32 @XXH32_reset(ptr noundef nonnull %89, i32 noundef 0) #5
  %91 = getelementptr inbounds i8, ptr %0, i64 96
  store ptr %5, ptr %91, align 8, !tbaa !33
  %92 = getelementptr inbounds i8, ptr %0, i64 36
  %93 = load i32, ptr %92, align 4, !tbaa !28
  %94 = icmp eq i32 %93, 0
  br i1 %94, label %95, label %99

95:                                               ; preds = %85
  %96 = getelementptr inbounds i8, ptr %0, i64 200
  %97 = load ptr, ptr %96, align 8, !tbaa !23
  %98 = load i32, ptr %15, align 8, !tbaa !13
  tail call void @LZ4F_initStream(ptr noundef %97, ptr noundef %5, i32 noundef %98, i32 noundef 0)
  br label %99

99:                                               ; preds = %95, %85
  %spec.store.select.sroa.sel129.v.sroa.sel.v.sroa.sel.v = select i1 %13, ptr %8, ptr %6
  %spec.store.select.sroa.sel129.v.sroa.sel.v.sroa.sel = getelementptr inbounds i8, ptr %spec.store.select.sroa.sel129.v.sroa.sel.v.sroa.sel.v, i64 32
  %100 = load i32, ptr %spec.store.select.sroa.sel129.v.sroa.sel.v.sroa.sel, align 8, !tbaa !34
  %101 = icmp sgt i32 %100, 1
  br i1 %101, label %102, label %106

102:                                              ; preds = %99
  %103 = getelementptr inbounds i8, ptr %0, i64 200
  %104 = load ptr, ptr %103, align 8, !tbaa !23
  %spec.store.select.sroa.sel132.v.sroa.sel.v.sroa.sel.v = select i1 %13, ptr %8, ptr %6
  %spec.store.select.sroa.sel132.v.sroa.sel.v.sroa.sel = getelementptr inbounds i8, ptr %spec.store.select.sroa.sel132.v.sroa.sel.v.sroa.sel.v, i64 40
  %105 = load i32, ptr %spec.store.select.sroa.sel132.v.sroa.sel.v.sroa.sel, align 8, !tbaa !35
  tail call void @LZ4_favorDecompressionSpeed(ptr noundef %104, i32 noundef %105) #5
  br label %106

106:                                              ; preds = %102, %99
  %.not122 = icmp eq ptr %3, null
  br i1 %.not122, label %122, label %107

107:                                              ; preds = %106
  %108 = icmp ugt i64 %4, 2147483647
  br i1 %108, label %109, label %111

109:                                              ; preds = %107
  %110 = tail call i64 @LZ4F_returnErrorCode(i32 noundef 4)
  br label %171

111:                                              ; preds = %107
  %112 = getelementptr inbounds i8, ptr %0, i64 210
  %113 = load i16, ptr %112, align 2, !tbaa !24
  %114 = icmp eq i16 %113, 1
  %115 = getelementptr inbounds i8, ptr %0, i64 200
  %116 = load ptr, ptr %115, align 8, !tbaa !23
  %117 = trunc nuw nsw i64 %4 to i32
  br i1 %114, label %118, label %120

118:                                              ; preds = %111
  %119 = tail call i32 @LZ4_loadDict(ptr noundef %116, ptr noundef nonnull %3, i32 noundef %117) #5
  br label %122

120:                                              ; preds = %111
  %121 = tail call i32 @LZ4_loadDictHC(ptr noundef %116, ptr noundef nonnull %3, i32 noundef %117) #5
  br label %122

122:                                              ; preds = %118, %120, %106
  tail call void @LZ4F_writeLE32(ptr noundef %1, i32 noundef 407708164)
  %123 = getelementptr inbounds i8, ptr %1, i64 4
  %124 = load i32, ptr %92, align 4, !tbaa !28
  %125 = shl i32 %124, 5
  %126 = and i32 %125, 32
  %127 = getelementptr inbounds i8, ptr %0, i64 60
  %128 = load i32, ptr %127, align 4, !tbaa !36
  %129 = shl i32 %128, 4
  %130 = and i32 %129, 16
  %131 = or disjoint i32 %130, %126
  %132 = getelementptr inbounds i8, ptr %0, i64 48
  %133 = load i64, ptr %132, align 8, !tbaa !37
  %.not123 = icmp eq i64 %133, 0
  %134 = select i1 %.not123, i32 0, i32 8
  %135 = or disjoint i32 %131, %134
  %136 = getelementptr inbounds i8, ptr %0, i64 40
  %137 = load i32, ptr %136, align 8, !tbaa !38
  %138 = shl i32 %137, 2
  %139 = and i32 %138, 4
  %140 = or disjoint i32 %135, %139
  %141 = getelementptr inbounds i8, ptr %0, i64 56
  %142 = load i32, ptr %141, align 8, !tbaa !39
  %143 = icmp ne i32 %142, 0
  %144 = zext i1 %143 to i32
  %145 = or disjoint i32 %140, %144
  %146 = trunc nuw nsw i32 %145 to i8
  %147 = or i8 %146, 64
  %148 = getelementptr inbounds i8, ptr %1, i64 5
  store i8 %147, ptr %123, align 1, !tbaa !12
  %149 = load i32, ptr %14, align 8, !tbaa !25
  %.tr = trunc i32 %149 to i8
  %150 = shl i8 %.tr, 4
  %151 = and i8 %150, 112
  %152 = getelementptr inbounds i8, ptr %1, i64 6
  store i8 %151, ptr %148, align 1, !tbaa !12
  %153 = load i64, ptr %132, align 8, !tbaa !37
  %.not124 = icmp eq i64 %153, 0
  br i1 %.not124, label %157, label %154

154:                                              ; preds = %122
  tail call void @LZ4F_writeLE64(ptr noundef nonnull %152, i64 noundef %153)
  %155 = getelementptr inbounds i8, ptr %1, i64 14
  %156 = getelementptr inbounds i8, ptr %0, i64 144
  store i64 0, ptr %156, align 8, !tbaa !40
  br label %157

157:                                              ; preds = %154, %122
  %.0108 = phi ptr [ %155, %154 ], [ %152, %122 ]
  %158 = load i32, ptr %141, align 8, !tbaa !39
  %.not125 = icmp eq i32 %158, 0
  br i1 %.not125, label %161, label %159

159:                                              ; preds = %157
  tail call void @LZ4F_writeLE32(ptr noundef nonnull %.0108, i32 noundef %158)
  %160 = getelementptr inbounds i8, ptr %.0108, i64 4
  br label %161

161:                                              ; preds = %159, %157
  %.1109 = phi ptr [ %160, %159 ], [ %.0108, %157 ]
  %162 = ptrtoint ptr %.1109 to i64
  %163 = ptrtoint ptr %123 to i64
  %164 = sub i64 %162, %163
  %165 = tail call zeroext i8 @LZ4F_headerChecksum(ptr noundef nonnull %123, i64 noundef %164)
  store i8 %165, ptr %.1109, align 1, !tbaa !12
  %166 = getelementptr inbounds i8, ptr %.1109, i64 1
  %167 = getelementptr inbounds i8, ptr %0, i64 92
  store i32 1, ptr %167, align 4, !tbaa !41
  %168 = ptrtoint ptr %166 to i64
  %169 = ptrtoint ptr %1 to i64
  %170 = sub i64 %168, %169
  br label %171

171:                                              ; preds = %83, %.thread, %161, %109, %10
  %.2 = phi i64 [ %11, %10 ], [ %110, %109 ], [ %170, %161 ], [ %84, %83 ], [ %57, %.thread ]
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %8) #5
  ret i64 %.2
}

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

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

declare i32 @LZ4_loadDict(ptr noundef, 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 = { 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 = !{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 64}
!14 = !{!"LZ4F_cctx_s", !15, i64 0, !17, i64 32, !7, i64 88, !7, i64 92, !16, i64 96, !19, i64 104, !19, i64 112, !16, i64 120, !16, i64 128, !19, i64 136, !19, i64 144, !20, i64 152, !16, i64 200, !21, i64 208, !21, i64 210, !7, i64 212}
!15 = !{!"", !16, i64 0, !16, i64 8, !16, i64 16, !16, i64 24}
!16 = !{!"any pointer", !8, i64 0}
!17 = !{!"", !18, i64 0, !7, i64 32, !7, i64 36, !7, i64 40, !8, i64 44}
!18 = !{!"", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !11, i64 16, !7, i64 24, !7, i64 28}
!19 = !{!"long", !8, i64 0}
!20 = !{!"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}
!21 = !{!"short", !8, i64 0}
!22 = !{!14, !21, i64 208}
!23 = !{!14, !16, i64 200}
!24 = !{!14, !21, i64 210}
!25 = !{!14, !7, i64 32}
!26 = !{!14, !19, i64 104}
!27 = !{!17, !7, i64 36}
!28 = !{!14, !7, i64 36}
!29 = !{!14, !19, i64 112}
!30 = !{!14, !16, i64 120}
!31 = !{!14, !16, i64 128}
!32 = !{!14, !19, i64 136}
!33 = !{!14, !16, i64 96}
!34 = !{!17, !7, i64 32}
!35 = !{!17, !7, i64 40}
!36 = !{!14, !7, i64 60}
!37 = !{!14, !11, i64 48}
!38 = !{!14, !7, i64 40}
!39 = !{!14, !7, i64 56}
!40 = !{!14, !19, i64 144}
!41 = !{!14, !7, i64 92}


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