; LLVM IR from catid/Zpng :: zstd (zstdmt_compress)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.ZSTD_CCtx_params_s = type { i32, %struct.ZSTD_compressionParameters, %struct.ZSTD_frameParameters, i32, i32, i32, i32, i32, i32, %struct.ldmParams_t, %struct.ZSTD_customMem }
%struct.ZSTD_compressionParameters = type { i32, i32, i32, i32, i32, i32, i32 }
%struct.ZSTD_frameParameters = type { i32, i32, i32 }
%struct.ldmParams_t = type { i32, i32, i32, i32, i32, i32 }
%struct.ZSTD_customMem = type { ptr, ptr, ptr }
%struct.rawSeqStore_t = type { ptr, i64, i64, i64 }
%struct.buffer_s = type { ptr, i64 }
%struct.ZSTDMT_jobDescription = type { i64, i64, i32, i32, ptr, ptr, ptr, ptr, %struct.buffer_s, %struct.range_t, %struct.range_t, i32, i32, i32, %struct.ZSTD_CCtx_params_s, ptr, i64, i64, i32 }
%struct.range_t = type { ptr, i64 }

; Function Attrs: nounwind uwtable
define dso_local void @ZSTDMT_compressionJob(ptr noundef %0) #0 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca %struct.ZSTD_CCtx_params_s, align 8
  %5 = alloca ptr, align 8
  %6 = alloca %struct.rawSeqStore_t, align 8
  %7 = alloca %struct.buffer_s, align 8
  %8 = alloca %struct.buffer_s, align 8
  %9 = alloca i64, align 8
  %10 = alloca i32, align 4
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca i32, align 4
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  %21 = alloca i32, align 4
  %22 = alloca i64, align 8
  %23 = alloca i64, align 8
  %24 = alloca i64, align 8
  %25 = alloca i64, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #4
  %26 = load ptr, ptr %2, align 8, !tbaa !5
  store ptr %26, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 120, ptr %4) #4
  %27 = load ptr, ptr %3, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.ZSTDMT_jobDescription, ptr %27, i32 0, i32 14
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %4, ptr align 8 %28, i64 120, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  %29 = load ptr, ptr %3, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.ZSTDMT_jobDescription, ptr %29, i32 0, i32 4
  %31 = load ptr, ptr %30, align 8, !tbaa !12
  %32 = call ptr @ZSTDMT_getCCtx(ptr noundef %31)
  store ptr %32, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr %6) #4
  %33 = load ptr, ptr %3, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.ZSTDMT_jobDescription, ptr %33, i32 0, i32 6
  %35 = load ptr, ptr %34, align 8, !tbaa !23
  call void @ZSTDMT_getSeq(ptr dead_on_unwind writable sret(%struct.rawSeqStore_t) align 8 %6, ptr noundef %35)
  call void @llvm.lifetime.start.p0(i64 16, ptr %7) #4
  %36 = load ptr, ptr %3, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.ZSTDMT_jobDescription, ptr %36, i32 0, i32 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %7, ptr align 8 %37, i64 16, i1 false), !tbaa.struct !24
  %38 = load ptr, ptr %3, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.ZSTDMT_jobDescription, ptr %38, i32 0, i32 11
  %40 = load i32, ptr %39, align 8, !tbaa !26
  %41 = icmp ne i32 %40, 0
  br i1 %41, label %42, label %45

42:                                               ; preds = %1
  %43 = getelementptr inbounds %struct.ZSTD_CCtx_params_s, ptr %4, i32 0, i32 2
  %44 = getelementptr inbounds %struct.ZSTD_frameParameters, ptr %43, i32 0, i32 1
  store i32 0, ptr %44, align 4, !tbaa !27
  br label %45

45:                                               ; preds = %42, %1
  %46 = getelementptr inbounds %struct.ZSTD_CCtx_params_s, ptr %4, i32 0, i32 9
  %47 = getelementptr inbounds %struct.ldmParams_t, ptr %46, i32 0, i32 0
  store i32 0, ptr %47, align 4, !tbaa !28
  %48 = load ptr, ptr %5, align 8, !tbaa !5
  %49 = icmp eq ptr %48, null
  br i1 %49, label %50, label %53

50:                                               ; preds = %45
  %51 = load ptr, ptr %3, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.ZSTDMT_jobDescription, ptr %51, i32 0, i32 1
  store i64 -64, ptr %52, align 8, !tbaa !29
  br label %351

53:                                               ; preds = %45
  %54 = getelementptr inbounds %struct.buffer_s, ptr %7, i32 0, i32 0
  %55 = load ptr, ptr %54, align 8, !tbaa !30
  %56 = icmp eq ptr %55, null
  br i1 %56, label %57, label %75

57:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 16, ptr %8) #4
  %58 = load ptr, ptr %3, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.ZSTDMT_jobDescription, ptr %58, i32 0, i32 5
  %60 = load ptr, ptr %59, align 8, !tbaa !31
  %61 = call { ptr, i64 } @ZSTDMT_getBuffer(ptr noundef %60)
  %62 = getelementptr inbounds { ptr, i64 }, ptr %8, i32 0, i32 0
  %63 = extractvalue { ptr, i64 } %61, 0
  store ptr %63, ptr %62, align 8
  %64 = getelementptr inbounds { ptr, i64 }, ptr %8, i32 0, i32 1
  %65 = extractvalue { ptr, i64 } %61, 1
  store i64 %65, ptr %64, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %7, ptr align 8 %8, i64 16, i1 false), !tbaa.struct !24
  call void @llvm.lifetime.end.p0(i64 16, ptr %8) #4
  %66 = getelementptr inbounds %struct.buffer_s, ptr %7, i32 0, i32 0
  %67 = load ptr, ptr %66, align 8, !tbaa !30
  %68 = icmp eq ptr %67, null
  br i1 %68, label %69, label %72

69:                                               ; preds = %57
  %70 = load ptr, ptr %3, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.ZSTDMT_jobDescription, ptr %70, i32 0, i32 1
  store i64 -64, ptr %71, align 8, !tbaa !29
  br label %351

72:                                               ; preds = %57
  %73 = load ptr, ptr %3, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.ZSTDMT_jobDescription, ptr %73, i32 0, i32 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %74, ptr align 8 %7, i64 16, i1 false), !tbaa.struct !24
  br label %75

75:                                               ; preds = %72, %53
  %76 = load ptr, ptr %3, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.ZSTDMT_jobDescription, ptr %76, i32 0, i32 15
  %78 = load ptr, ptr %77, align 8, !tbaa !32
  %79 = icmp ne ptr %78, null
  br i1 %79, label %80, label %100

80:                                               ; preds = %75
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %81 = load ptr, ptr %5, align 8, !tbaa !5
  %82 = load ptr, ptr %3, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.ZSTDMT_jobDescription, ptr %82, i32 0, i32 15
  %84 = load ptr, ptr %83, align 8, !tbaa !32
  %85 = load ptr, ptr %3, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.ZSTDMT_jobDescription, ptr %85, i32 0, i32 16
  %87 = load i64, ptr %86, align 8, !tbaa !33
  %88 = call i64 @ZSTD_compressBegin_advanced_internal(ptr noundef %81, ptr noundef null, i64 noundef 0, i32 noundef 0, i32 noundef 0, ptr noundef %84, ptr noundef byval(%struct.ZSTD_CCtx_params_s) align 8 %4, i64 noundef %87)
  store i64 %88, ptr %9, align 8, !tbaa !25
  %89 = load i64, ptr %9, align 8, !tbaa !25
  %90 = call i32 @ZSTD_isError(i64 noundef %89)
  %91 = icmp ne i32 %90, 0
  br i1 %91, label %92, label %96

92:                                               ; preds = %80
  %93 = load i64, ptr %9, align 8, !tbaa !25
  %94 = load ptr, ptr %3, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.ZSTDMT_jobDescription, ptr %94, i32 0, i32 1
  store i64 %93, ptr %95, align 8, !tbaa !29
  store i32 2, ptr %10, align 4
  br label %97

96:                                               ; preds = %80
  store i32 0, ptr %10, align 4
  br label %97

97:                                               ; preds = %96, %92
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  %98 = load i32, ptr %10, align 4
  switch i32 %98, label %387 [
    i32 0, label %99
    i32 2, label %351
  ]

99:                                               ; preds = %97
  br label %159

100:                                              ; preds = %75
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  %101 = load ptr, ptr %3, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.ZSTDMT_jobDescription, ptr %101, i32 0, i32 12
  %103 = load i32, ptr %102, align 4, !tbaa !34
  %104 = icmp ne i32 %103, 0
  br i1 %104, label %105, label %109

105:                                              ; preds = %100
  %106 = load ptr, ptr %3, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.ZSTDMT_jobDescription, ptr %106, i32 0, i32 16
  %108 = load i64, ptr %107, align 8, !tbaa !33
  br label %114

109:                                              ; preds = %100
  %110 = load ptr, ptr %3, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.ZSTDMT_jobDescription, ptr %110, i32 0, i32 10
  %112 = getelementptr inbounds %struct.range_t, ptr %111, i32 0, i32 1
  %113 = load i64, ptr %112, align 8, !tbaa !35
  br label %114

114:                                              ; preds = %109, %105
  %115 = phi i64 [ %108, %105 ], [ %113, %109 ]
  store i64 %115, ptr %11, align 8, !tbaa !25
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  %116 = load ptr, ptr %3, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.ZSTDMT_jobDescription, ptr %116, i32 0, i32 12
  %118 = load i32, ptr %117, align 4, !tbaa !34
  %119 = icmp ne i32 %118, 0
  %120 = xor i1 %119, true
  %121 = zext i1 %120 to i32
  %122 = call i64 @ZSTD_CCtxParam_setParameter(ptr noundef %4, i32 noundef 1100, i32 noundef %121)
  store i64 %122, ptr %12, align 8, !tbaa !25
  %123 = load i64, ptr %12, align 8, !tbaa !25
  %124 = call i32 @ZSTD_isError(i64 noundef %123)
  %125 = icmp ne i32 %124, 0
  br i1 %125, label %126, label %130

126:                                              ; preds = %114
  %127 = load i64, ptr %12, align 8, !tbaa !25
  %128 = load ptr, ptr %3, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.ZSTDMT_jobDescription, ptr %128, i32 0, i32 1
  store i64 %127, ptr %129, align 8, !tbaa !29
  store i32 2, ptr %10, align 4
  br label %131

130:                                              ; preds = %114
  store i32 0, ptr %10, align 4
  br label %131

131:                                              ; preds = %130, %126
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  %132 = load i32, ptr %10, align 4
  switch i32 %132, label %156 [
    i32 0, label %133
  ]

133:                                              ; preds = %131
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  %134 = load ptr, ptr %5, align 8, !tbaa !5
  %135 = load ptr, ptr %3, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.ZSTDMT_jobDescription, ptr %135, i32 0, i32 9
  %137 = getelementptr inbounds %struct.range_t, ptr %136, i32 0, i32 0
  %138 = load ptr, ptr %137, align 8, !tbaa !36
  %139 = load ptr, ptr %3, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.ZSTDMT_jobDescription, ptr %139, i32 0, i32 9
  %141 = getelementptr inbounds %struct.range_t, ptr %140, i32 0, i32 1
  %142 = load i64, ptr %141, align 8, !tbaa !37
  %143 = load i64, ptr %11, align 8, !tbaa !25
  %144 = call i64 @ZSTD_compressBegin_advanced_internal(ptr noundef %134, ptr noundef %138, i64 noundef %142, i32 noundef 1, i32 noundef 0, ptr noundef null, ptr noundef byval(%struct.ZSTD_CCtx_params_s) align 8 %4, i64 noundef %143)
  store i64 %144, ptr %13, align 8, !tbaa !25
  %145 = load i64, ptr %13, align 8, !tbaa !25
  %146 = call i32 @ZSTD_isError(i64 noundef %145)
  %147 = icmp ne i32 %146, 0
  br i1 %147, label %148, label %152

148:                                              ; preds = %133
  %149 = load i64, ptr %13, align 8, !tbaa !25
  %150 = load ptr, ptr %3, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct.ZSTDMT_jobDescription, ptr %150, i32 0, i32 1
  store i64 %149, ptr %151, align 8, !tbaa !29
  store i32 2, ptr %10, align 4
  br label %153

152:                                              ; preds = %133
  store i32 0, ptr %10, align 4
  br label %153

153:                                              ; preds = %152, %148
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  %154 = load i32, ptr %10, align 4
  switch i32 %154, label %156 [
    i32 0, label %155
  ]

155:                                              ; preds = %153
  store i32 0, ptr %10, align 4
  br label %156

156:                                              ; preds = %155, %153, %131
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  %157 = load i32, ptr %10, align 4
  switch i32 %157, label %387 [
    i32 0, label %158
    i32 2, label %351
  ]

158:                                              ; preds = %156
  br label %159

159:                                              ; preds = %158, %99
  %160 = load ptr, ptr %3, align 8, !tbaa !5
  %161 = getelementptr inbounds %struct.ZSTDMT_jobDescription, ptr %160, i32 0, i32 7
  %162 = load ptr, ptr %161, align 8, !tbaa !38
  %163 = load ptr, ptr %5, align 8, !tbaa !5
  %164 = load ptr, ptr %3, align 8, !tbaa !5
  %165 = getelementptr inbounds %struct.ZSTDMT_jobDescription, ptr %164, i32 0, i32 10
  %166 = load ptr, ptr %3, align 8, !tbaa !5
  %167 = getelementptr inbounds %struct.ZSTDMT_jobDescription, ptr %166, i32 0, i32 11
  %168 = load i32, ptr %167, align 8, !tbaa !26
  %169 = getelementptr inbounds { ptr, i64 }, ptr %165, i32 0, i32 0
  %170 = load ptr, ptr %169, align 8
  %171 = getelementptr inbounds { ptr, i64 }, ptr %165, i32 0, i32 1
  %172 = load i64, ptr %171, align 8
  call void @ZSTDMT_serialState_update(ptr noundef %162, ptr noundef %163, ptr noundef byval(%struct.rawSeqStore_t) align 8 %6, ptr %170, i64 %172, i32 noundef %168)
  %173 = load ptr, ptr %3, align 8, !tbaa !5
  %174 = getelementptr inbounds %struct.ZSTDMT_jobDescription, ptr %173, i32 0, i32 12
  %175 = load i32, ptr %174, align 4, !tbaa !34
  %176 = icmp ne i32 %175, 0
  br i1 %176, label %200, label %177

177:                                              ; preds = %159
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  %178 = load ptr, ptr %5, align 8, !tbaa !5
  %179 = getelementptr inbounds %struct.buffer_s, ptr %7, i32 0, i32 0
  %180 = load ptr, ptr %179, align 8, !tbaa !30
  %181 = getelementptr inbounds %struct.buffer_s, ptr %7, i32 0, i32 1
  %182 = load i64, ptr %181, align 8, !tbaa !39
  %183 = load ptr, ptr %3, align 8, !tbaa !5
  %184 = getelementptr inbounds %struct.ZSTDMT_jobDescription, ptr %183, i32 0, i32 10
  %185 = getelementptr inbounds %struct.range_t, ptr %184, i32 0, i32 0
  %186 = load ptr, ptr %185, align 8, !tbaa !40
  %187 = call i64 @ZSTD_compressContinue(ptr noundef %178, ptr noundef %180, i64 noundef %182, ptr noundef %186, i64 noundef 0)
  store i64 %187, ptr %14, align 8, !tbaa !25
  %188 = load i64, ptr %14, align 8, !tbaa !25
  %189 = call i32 @ZSTD_isError(i64 noundef %188)
  %190 = icmp ne i32 %189, 0
  br i1 %190, label %191, label %195

191:                                              ; preds = %177
  %192 = load i64, ptr %14, align 8, !tbaa !25
  %193 = load ptr, ptr %3, align 8, !tbaa !5
  %194 = getelementptr inbounds %struct.ZSTDMT_jobDescription, ptr %193, i32 0, i32 1
  store i64 %192, ptr %194, align 8, !tbaa !29
  store i32 2, ptr %10, align 4
  br label %197

195:                                              ; preds = %177
  %196 = load ptr, ptr %5, align 8, !tbaa !5
  call void @ZSTD_invalidateRepCodes(ptr noundef %196)
  store i32 0, ptr %10, align 4
  br label %197

197:                                              ; preds = %195, %191
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  %198 = load i32, ptr %10, align 4
  switch i32 %198, label %387 [
    i32 0, label %199
    i32 2, label %351
  ]

199:                                              ; preds = %197
  br label %200

200:                                              ; preds = %199, %159
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  store i64 524288, ptr %15, align 8, !tbaa !25
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  %201 = load ptr, ptr %3, align 8, !tbaa !5
  %202 = getelementptr inbounds %struct.ZSTDMT_jobDescription, ptr %201, i32 0, i32 10
  %203 = getelementptr inbounds %struct.range_t, ptr %202, i32 0, i32 1
  %204 = load i64, ptr %203, align 8, !tbaa !35
  %205 = add i64 %204, 524287
  %206 = udiv i64 %205, 524288
  %207 = trunc i64 %206 to i32
  store i32 %207, ptr %16, align 4, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  %208 = load ptr, ptr %3, align 8, !tbaa !5
  %209 = getelementptr inbounds %struct.ZSTDMT_jobDescription, ptr %208, i32 0, i32 10
  %210 = getelementptr inbounds %struct.range_t, ptr %209, i32 0, i32 0
  %211 = load ptr, ptr %210, align 8, !tbaa !40
  store ptr %211, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #4
  %212 = getelementptr inbounds %struct.buffer_s, ptr %7, i32 0, i32 0
  %213 = load ptr, ptr %212, align 8, !tbaa !30
  store ptr %213, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #4
  %214 = load ptr, ptr %18, align 8, !tbaa !5
  store ptr %214, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #4
  %215 = load ptr, ptr %19, align 8, !tbaa !5
  %216 = getelementptr inbounds %struct.buffer_s, ptr %7, i32 0, i32 1
  %217 = load i64, ptr %216, align 8, !tbaa !39
  %218 = getelementptr inbounds i8, ptr %215, i64 %217
  store ptr %218, ptr %20, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #4
  store i32 1, ptr %21, align 4, !tbaa !10
  br label %219

219:                                              ; preds = %265, %200
  %220 = load i32, ptr %21, align 4, !tbaa !10
  %221 = load i32, ptr %16, align 4, !tbaa !10
  %222 = icmp slt i32 %220, %221
  br i1 %222, label %223, label %268

223:                                              ; preds = %219
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #4
  %224 = load ptr, ptr %5, align 8, !tbaa !5
  %225 = load ptr, ptr %19, align 8, !tbaa !5
  %226 = load ptr, ptr %20, align 8, !tbaa !5
  %227 = load ptr, ptr %19, align 8, !tbaa !5
  %228 = ptrtoint ptr %226 to i64
  %229 = ptrtoint ptr %227 to i64
  %230 = sub i64 %228, %229
  %231 = load ptr, ptr %17, align 8, !tbaa !5
  %232 = call i64 @ZSTD_compressContinue(ptr noundef %224, ptr noundef %225, i64 noundef %230, ptr noundef %231, i64 noundef 524288)
  store i64 %232, ptr %22, align 8, !tbaa !25
  %233 = load i64, ptr %22, align 8, !tbaa !25
  %234 = call i32 @ZSTD_isError(i64 noundef %233)
  %235 = icmp ne i32 %234, 0
  br i1 %235, label %236, label %240

236:                                              ; preds = %223
  %237 = load i64, ptr %22, align 8, !tbaa !25
  %238 = load ptr, ptr %3, align 8, !tbaa !5
  %239 = getelementptr inbounds %struct.ZSTDMT_jobDescription, ptr %238, i32 0, i32 1
  store i64 %237, ptr %239, align 8, !tbaa !29
  store i32 2, ptr %10, align 4
  br label %262

240:                                              ; preds = %223
  %241 = load ptr, ptr %17, align 8, !tbaa !5
  %242 = getelementptr inbounds i8, ptr %241, i64 524288
  store ptr %242, ptr %17, align 8, !tbaa !5
  %243 = load i64, ptr %22, align 8, !tbaa !25
  %244 = load ptr, ptr %19, align 8, !tbaa !5
  %245 = getelementptr inbounds i8, ptr %244, i64 %243
  store ptr %245, ptr %19, align 8, !tbaa !5
  %246 = load ptr, ptr %3, align 8, !tbaa !5
  %247 = getelementptr inbounds %struct.ZSTDMT_jobDescription, ptr %246, i32 0, i32 2
  %248 = load i64, ptr %22, align 8, !tbaa !25
  %249 = load ptr, ptr %3, align 8, !tbaa !5
  %250 = getelementptr inbounds %struct.ZSTDMT_jobDescription, ptr %249, i32 0, i32 1
  %251 = load i64, ptr %250, align 8, !tbaa !29
  %252 = add i64 %251, %248
  store i64 %252, ptr %250, align 8, !tbaa !29
  %253 = load i32, ptr %21, align 4, !tbaa !10
  %254 = sext i32 %253 to i64
  %255 = mul i64 524288, %254
  %256 = load ptr, ptr %3, align 8, !tbaa !5
  %257 = getelementptr inbounds %struct.ZSTDMT_jobDescription, ptr %256, i32 0, i32 0
  store i64 %255, ptr %257, align 8, !tbaa !41
  %258 = load ptr, ptr %3, align 8, !tbaa !5
  %259 = getelementptr inbounds %struct.ZSTDMT_jobDescription, ptr %258, i32 0, i32 3
  %260 = load ptr, ptr %3, align 8, !tbaa !5
  %261 = getelementptr inbounds %struct.ZSTDMT_jobDescription, ptr %260, i32 0, i32 2
  store i32 0, ptr %10, align 4
  br label %262

262:                                              ; preds = %240, %236
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #4
  %263 = load i32, ptr %10, align 4
  switch i32 %263, label %348 [
    i32 0, label %264
  ]

264:                                              ; preds = %262
  br label %265

265:                                              ; preds = %264
  %266 = load i32, ptr %21, align 4, !tbaa !10
  %267 = add nsw i32 %266, 1
  store i32 %267, ptr %21, align 4, !tbaa !10
  br label %219, !llvm.loop !42

268:                                              ; preds = %219
  %269 = load i32, ptr %16, align 4, !tbaa !10
  %270 = icmp sgt i32 %269, 0
  %271 = zext i1 %270 to i32
  %272 = load ptr, ptr %3, align 8, !tbaa !5
  %273 = getelementptr inbounds %struct.ZSTDMT_jobDescription, ptr %272, i32 0, i32 13
  %274 = load i32, ptr %273, align 8, !tbaa !44
  %275 = or i32 %271, %274
  %276 = icmp ne i32 %275, 0
  br i1 %276, label %277, label %347

277:                                              ; preds = %268
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #4
  %278 = load ptr, ptr %3, align 8, !tbaa !5
  %279 = getelementptr inbounds %struct.ZSTDMT_jobDescription, ptr %278, i32 0, i32 10
  %280 = getelementptr inbounds %struct.range_t, ptr %279, i32 0, i32 1
  %281 = load i64, ptr %280, align 8, !tbaa !35
  %282 = and i64 %281, 524287
  store i64 %282, ptr %23, align 8, !tbaa !25
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #4
  %283 = load i64, ptr %23, align 8, !tbaa !25
  %284 = icmp eq i64 %283, 0
  %285 = zext i1 %284 to i32
  %286 = load ptr, ptr %3, align 8, !tbaa !5
  %287 = getelementptr inbounds %struct.ZSTDMT_jobDescription, ptr %286, i32 0, i32 10
  %288 = getelementptr inbounds %struct.range_t, ptr %287, i32 0, i32 1
  %289 = load i64, ptr %288, align 8, !tbaa !35
  %290 = icmp uge i64 %289, 524288
  %291 = zext i1 %290 to i32
  %292 = and i32 %285, %291
  %293 = icmp ne i32 %292, 0
  br i1 %293, label %294, label %295

294:                                              ; preds = %277
  br label %297

295:                                              ; preds = %277
  %296 = load i64, ptr %23, align 8, !tbaa !25
  br label %297

297:                                              ; preds = %295, %294
  %298 = phi i64 [ 524288, %294 ], [ %296, %295 ]
  store i64 %298, ptr %24, align 8, !tbaa !25
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #4
  %299 = load ptr, ptr %3, align 8, !tbaa !5
  %300 = getelementptr inbounds %struct.ZSTDMT_jobDescription, ptr %299, i32 0, i32 13
  %301 = load i32, ptr %300, align 8, !tbaa !44
  %302 = icmp ne i32 %301, 0
  br i1 %302, label %303, label %314

303:                                              ; preds = %297
  %304 = load ptr, ptr %5, align 8, !tbaa !5
  %305 = load ptr, ptr %19, align 8, !tbaa !5
  %306 = load ptr, ptr %20, align 8, !tbaa !5
  %307 = load ptr, ptr %19, align 8, !tbaa !5
  %308 = ptrtoint ptr %306 to i64
  %309 = ptrtoint ptr %307 to i64
  %310 = sub i64 %308, %309
  %311 = load ptr, ptr %17, align 8, !tbaa !5
  %312 = load i64, ptr %24, align 8, !tbaa !25
  %313 = call i64 @ZSTD_compressEnd(ptr noundef %304, ptr noundef %305, i64 noundef %310, ptr noundef %311, i64 noundef %312)
  br label %325

314:                                              ; preds = %297
  %315 = load ptr, ptr %5, align 8, !tbaa !5
  %316 = load ptr, ptr %19, align 8, !tbaa !5
  %317 = load ptr, ptr %20, align 8, !tbaa !5
  %318 = load ptr, ptr %19, align 8, !tbaa !5
  %319 = ptrtoint ptr %317 to i64
  %320 = ptrtoint ptr %318 to i64
  %321 = sub i64 %319, %320
  %322 = load ptr, ptr %17, align 8, !tbaa !5
  %323 = load i64, ptr %24, align 8, !tbaa !25
  %324 = call i64 @ZSTD_compressContinue(ptr noundef %315, ptr noundef %316, i64 noundef %321, ptr noundef %322, i64 noundef %323)
  br label %325

325:                                              ; preds = %314, %303
  %326 = phi i64 [ %313, %303 ], [ %324, %314 ]
  store i64 %326, ptr %25, align 8, !tbaa !25
  %327 = load i64, ptr %25, align 8, !tbaa !25
  %328 = call i32 @ZSTD_isError(i64 noundef %327)
  %329 = icmp ne i32 %328, 0
  br i1 %329, label %330, label %334

330:                                              ; preds = %325
  %331 = load i64, ptr %25, align 8, !tbaa !25
  %332 = load ptr, ptr %3, align 8, !tbaa !5
  %333 = getelementptr inbounds %struct.ZSTDMT_jobDescription, ptr %332, i32 0, i32 1
  store i64 %331, ptr %333, align 8, !tbaa !29
  store i32 2, ptr %10, align 4
  br label %344

334:                                              ; preds = %325
  %335 = load ptr, ptr %3, align 8, !tbaa !5
  %336 = getelementptr inbounds %struct.ZSTDMT_jobDescription, ptr %335, i32 0, i32 2
  %337 = load i64, ptr %25, align 8, !tbaa !25
  %338 = load ptr, ptr %3, align 8, !tbaa !5
  %339 = getelementptr inbounds %struct.ZSTDMT_jobDescription, ptr %338, i32 0, i32 1
  %340 = load i64, ptr %339, align 8, !tbaa !29
  %341 = add i64 %340, %337
  store i64 %341, ptr %339, align 8, !tbaa !29
  %342 = load ptr, ptr %3, align 8, !tbaa !5
  %343 = getelementptr inbounds %struct.ZSTDMT_jobDescription, ptr %342, i32 0, i32 2
  store i32 0, ptr %10, align 4
  br label %344

344:                                              ; preds = %334, %330
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #4
  %345 = load i32, ptr %10, align 4
  switch i32 %345, label %348 [
    i32 0, label %346
  ]

346:                                              ; preds = %344
  br label %347

347:                                              ; preds = %346, %268
  store i32 0, ptr %10, align 4
  br label %348

348:                                              ; preds = %347, %344, %262
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  %349 = load i32, ptr %10, align 4
  switch i32 %349, label %387 [
    i32 0, label %350
    i32 2, label %351
  ]

350:                                              ; preds = %348
  br label %351

351:                                              ; preds = %350, %348, %197, %156, %97, %69, %50
  %352 = load ptr, ptr %3, align 8, !tbaa !5
  %353 = getelementptr inbounds %struct.ZSTDMT_jobDescription, ptr %352, i32 0, i32 7
  %354 = load ptr, ptr %353, align 8, !tbaa !38
  %355 = load ptr, ptr %3, align 8, !tbaa !5
  %356 = getelementptr inbounds %struct.ZSTDMT_jobDescription, ptr %355, i32 0, i32 11
  %357 = load i32, ptr %356, align 8, !tbaa !26
  %358 = load ptr, ptr %3, align 8, !tbaa !5
  %359 = getelementptr inbounds %struct.ZSTDMT_jobDescription, ptr %358, i32 0, i32 1
  %360 = load i64, ptr %359, align 8, !tbaa !29
  call void @ZSTDMT_serialState_ensureFinished(ptr noundef %354, i32 noundef %357, i64 noundef %360)
  %361 = load ptr, ptr %3, align 8, !tbaa !5
  %362 = getelementptr inbounds %struct.ZSTDMT_jobDescription, ptr %361, i32 0, i32 9
  %363 = getelementptr inbounds %struct.range_t, ptr %362, i32 0, i32 1
  %364 = load i64, ptr %363, align 8, !tbaa !37
  %365 = icmp ugt i64 %364, 0
  br i1 %365, label %366, label %367

366:                                              ; preds = %351
  br label %367

367:                                              ; preds = %366, %351
  %368 = load ptr, ptr %3, align 8, !tbaa !5
  %369 = getelementptr inbounds %struct.ZSTDMT_jobDescription, ptr %368, i32 0, i32 6
  %370 = load ptr, ptr %369, align 8, !tbaa !23
  call void @ZSTDMT_releaseSeq(ptr noundef %370, ptr noundef byval(%struct.rawSeqStore_t) align 8 %6)
  %371 = load ptr, ptr %3, align 8, !tbaa !5
  %372 = getelementptr inbounds %struct.ZSTDMT_jobDescription, ptr %371, i32 0, i32 4
  %373 = load ptr, ptr %372, align 8, !tbaa !12
  %374 = load ptr, ptr %5, align 8, !tbaa !5
  call void @ZSTDMT_releaseCCtx(ptr noundef %373, ptr noundef %374)
  %375 = load ptr, ptr %3, align 8, !tbaa !5
  %376 = getelementptr inbounds %struct.ZSTDMT_jobDescription, ptr %375, i32 0, i32 2
  %377 = load ptr, ptr %3, align 8, !tbaa !5
  %378 = getelementptr inbounds %struct.ZSTDMT_jobDescription, ptr %377, i32 0, i32 10
  %379 = getelementptr inbounds %struct.range_t, ptr %378, i32 0, i32 1
  %380 = load i64, ptr %379, align 8, !tbaa !35
  %381 = load ptr, ptr %3, align 8, !tbaa !5
  %382 = getelementptr inbounds %struct.ZSTDMT_jobDescription, ptr %381, i32 0, i32 0
  store i64 %380, ptr %382, align 8, !tbaa !41
  %383 = load ptr, ptr %3, align 8, !tbaa !5
  %384 = getelementptr inbounds %struct.ZSTDMT_jobDescription, ptr %383, i32 0, i32 3
  %385 = load ptr, ptr %3, align 8, !tbaa !5
  %386 = getelementptr inbounds %struct.ZSTDMT_jobDescription, ptr %385, i32 0, i32 2
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 120, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #4
  ret void

387:                                              ; preds = %348, %197, %156, %97
  unreachable
}

; 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: nounwind uwtable
declare hidden ptr @ZSTDMT_getCCtx(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @ZSTDMT_getSeq(ptr dead_on_unwind noalias writable sret(%struct.rawSeqStore_t) align 8, ptr noundef) #0

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

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

declare i64 @ZSTD_compressBegin_advanced_internal(ptr noundef, ptr noundef, i64 noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef byval(%struct.ZSTD_CCtx_params_s) align 8, i64 noundef) #3

declare i32 @ZSTD_isError(i64 noundef) #3

declare i64 @ZSTD_CCtxParam_setParameter(ptr noundef, i32 noundef, i32 noundef) #3

; Function Attrs: nounwind uwtable
declare hidden void @ZSTDMT_serialState_update(ptr noundef, ptr noundef, ptr noundef byval(%struct.rawSeqStore_t) align 8, ptr, i64, i32 noundef) #0

declare i64 @ZSTD_compressContinue(ptr noundef, ptr noundef, i64 noundef, ptr noundef, i64 noundef) #3

declare void @ZSTD_invalidateRepCodes(ptr noundef) #3

declare i64 @ZSTD_compressEnd(ptr noundef, ptr noundef, i64 noundef, ptr noundef, i64 noundef) #3

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

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

; Function Attrs: nounwind uwtable
declare hidden void @ZSTDMT_releaseCCtx(ptr noundef, ptr 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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }

!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 = !{i64 0, i64 4, !10, i64 4, i64 4, !10, i64 8, i64 4, !10, i64 12, i64 4, !10, i64 16, i64 4, !10, i64 20, i64 4, !10, i64 24, i64 4, !10, i64 28, i64 4, !10, i64 32, i64 4, !10, i64 36, i64 4, !10, i64 40, i64 4, !10, i64 44, i64 4, !10, i64 48, i64 4, !10, i64 52, i64 4, !10, i64 56, i64 4, !10, i64 60, i64 4, !10, i64 64, i64 4, !10, i64 68, i64 4, !10, i64 72, i64 4, !10, i64 76, i64 4, !10, i64 80, i64 4, !10, i64 84, i64 4, !10, i64 88, i64 4, !10, i64 96, i64 8, !5, i64 104, i64 8, !5, i64 112, i64 8, !5}
!10 = !{!11, !11, i64 0}
!11 = !{!"int", !7, i64 0}
!12 = !{!13, !6, i64 24}
!13 = !{!"", !14, i64 0, !14, i64 8, !11, i64 16, !11, i64 20, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !15, i64 56, !16, i64 72, !16, i64 88, !11, i64 104, !11, i64 108, !11, i64 112, !17, i64 120, !6, i64 240, !22, i64 248, !14, i64 256, !11, i64 264}
!14 = !{!"long", !7, i64 0}
!15 = !{!"buffer_s", !6, i64 0, !14, i64 8}
!16 = !{!"", !6, i64 0, !14, i64 8}
!17 = !{!"ZSTD_CCtx_params_s", !11, i64 0, !18, i64 4, !19, i64 32, !11, i64 44, !11, i64 48, !11, i64 52, !11, i64 56, !11, i64 60, !11, i64 64, !20, i64 68, !21, i64 96}
!18 = !{!"", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24}
!19 = !{!"", !11, i64 0, !11, i64 4, !11, i64 8}
!20 = !{!"", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20}
!21 = !{!"", !6, i64 0, !6, i64 8, !6, i64 16}
!22 = !{!"long long", !7, i64 0}
!23 = !{!13, !6, i64 40}
!24 = !{i64 0, i64 8, !5, i64 8, i64 8, !25}
!25 = !{!14, !14, i64 0}
!26 = !{!13, !11, i64 104}
!27 = !{!17, !11, i64 36}
!28 = !{!17, !11, i64 68}
!29 = !{!13, !14, i64 8}
!30 = !{!15, !6, i64 0}
!31 = !{!13, !6, i64 32}
!32 = !{!13, !6, i64 240}
!33 = !{!13, !22, i64 248}
!34 = !{!13, !11, i64 108}
!35 = !{!13, !14, i64 96}
!36 = !{!13, !6, i64 72}
!37 = !{!13, !14, i64 80}
!38 = !{!13, !6, i64 48}
!39 = !{!15, !14, i64 8}
!40 = !{!13, !6, i64 88}
!41 = !{!13, !14, i64 0}
!42 = distinct !{!42, !43}
!43 = !{!"llvm.loop.mustprogress"}
!44 = !{!13, !11, i64 112}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.ZSTD_CCtx_params_s = type { i32, %struct.ZSTD_compressionParameters, %struct.ZSTD_frameParameters, i32, i32, i32, i32, i32, i32, %struct.ldmParams_t, %struct.ZSTD_customMem }
%struct.ZSTD_compressionParameters = type { i32, i32, i32, i32, i32, i32, i32 }
%struct.ZSTD_frameParameters = type { i32, i32, i32 }
%struct.ldmParams_t = type { i32, i32, i32, i32, i32, i32 }
%struct.ZSTD_customMem = type { ptr, ptr, ptr }
%struct.rawSeqStore_t = type { ptr, i64, i64, i64 }

; Function Attrs: nounwind uwtable
define dso_local void @ZSTDMT_compressionJob(ptr nocapture noundef %0) local_unnamed_addr #0 {
  %2 = alloca %struct.ZSTD_CCtx_params_s, align 8
  %3 = alloca %struct.rawSeqStore_t, align 8
  call void @llvm.lifetime.start.p0(i64 120, ptr nonnull %2) #4
  %4 = getelementptr inbounds i8, ptr %0, i64 120
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(120) %2, ptr noundef nonnull align 8 dereferenceable(120) %4, i64 120, i1 false), !tbaa.struct !5
  %5 = getelementptr inbounds i8, ptr %0, i64 24
  %6 = load ptr, ptr %5, align 8, !tbaa !12
  %7 = tail call ptr @ZSTDMT_getCCtx(ptr noundef %6)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %3) #4
  %8 = getelementptr inbounds i8, ptr %0, i64 40
  %9 = load ptr, ptr %8, align 8, !tbaa !23
  call void @ZSTDMT_getSeq(ptr dead_on_unwind nonnull writable sret(%struct.rawSeqStore_t) align 8 %3, ptr noundef %9)
  %10 = getelementptr inbounds i8, ptr %0, i64 56
  %.sroa.050.0.copyload = load ptr, ptr %10, align 8, !tbaa !10
  %.sroa.9.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 64
  %.sroa.9.0.copyload = load i64, ptr %.sroa.9.0..sroa_idx, align 8, !tbaa !24
  %11 = getelementptr inbounds i8, ptr %0, i64 104
  %12 = load i32, ptr %11, align 8, !tbaa !25
  %.not = icmp eq i32 %12, 0
  br i1 %.not, label %15, label %13

13:                                               ; preds = %1
  %14 = getelementptr inbounds i8, ptr %2, i64 36
  store i32 0, ptr %14, align 4, !tbaa !26
  br label %15

15:                                               ; preds = %13, %1
  %16 = getelementptr inbounds i8, ptr %2, i64 68
  store i32 0, ptr %16, align 4, !tbaa !27
  %17 = icmp eq ptr %7, null
  br i1 %17, label %18, label %20

18:                                               ; preds = %15
  %19 = getelementptr inbounds i8, ptr %0, i64 8
  store i64 -64, ptr %19, align 8, !tbaa !28
  br label %.thread152

20:                                               ; preds = %15
  %21 = icmp eq ptr %.sroa.050.0.copyload, null
  br i1 %21, label %22, label %32

22:                                               ; preds = %20
  %23 = getelementptr inbounds i8, ptr %0, i64 32
  %24 = load ptr, ptr %23, align 8, !tbaa !29
  %25 = call { ptr, i64 } @ZSTDMT_getBuffer(ptr noundef %24)
  %26 = extractvalue { ptr, i64 } %25, 0
  %27 = icmp eq ptr %26, null
  br i1 %27, label %28, label %30

28:                                               ; preds = %22
  %29 = getelementptr inbounds i8, ptr %0, i64 8
  store i64 -64, ptr %29, align 8, !tbaa !28
  br label %.thread152

30:                                               ; preds = %22
  %31 = extractvalue { ptr, i64 } %25, 1
  store ptr %26, ptr %10, align 8, !tbaa !10
  store i64 %31, ptr %.sroa.9.0..sroa_idx, align 8, !tbaa !24
  br label %32

32:                                               ; preds = %30, %20
  %.sroa.050.0 = phi ptr [ %26, %30 ], [ %.sroa.050.0.copyload, %20 ]
  %.sroa.9.0 = phi i64 [ %31, %30 ], [ %.sroa.9.0.copyload, %20 ]
  %33 = getelementptr inbounds i8, ptr %0, i64 240
  %34 = load ptr, ptr %33, align 8, !tbaa !30
  %.not132 = icmp eq ptr %34, null
  br i1 %.not132, label %42, label %35

35:                                               ; preds = %32
  %36 = getelementptr inbounds i8, ptr %0, i64 248
  %37 = load i64, ptr %36, align 8, !tbaa !31
  %38 = call i64 @ZSTD_compressBegin_advanced_internal(ptr noundef nonnull %7, ptr noundef null, i64 noundef 0, i32 noundef 0, i32 noundef 0, ptr noundef nonnull %34, ptr noundef nonnull byval(%struct.ZSTD_CCtx_params_s) align 8 %2, i64 noundef %37) #4
  %39 = call i32 @ZSTD_isError(i64 noundef %38) #4
  %.not137 = icmp eq i32 %39, 0
  br i1 %.not137, label %.thread, label %40

40:                                               ; preds = %35
  %41 = getelementptr inbounds i8, ptr %0, i64 8
  store i64 %38, ptr %41, align 8, !tbaa !28
  br label %.thread152

42:                                               ; preds = %32
  %43 = getelementptr inbounds i8, ptr %0, i64 108
  %44 = load i32, ptr %43, align 4, !tbaa !32
  %.not133 = icmp eq i32 %44, 0
  %.in.v = select i1 %.not133, i64 96, i64 248
  %.in = getelementptr inbounds i8, ptr %0, i64 %.in.v
  %45 = load i64, ptr %.in, align 8, !tbaa !33
  %46 = zext i1 %.not133 to i32
  %47 = call i64 @ZSTD_CCtxParam_setParameter(ptr noundef nonnull %2, i32 noundef 1100, i32 noundef %46) #4
  %48 = call i32 @ZSTD_isError(i64 noundef %47) #4
  %.not135 = icmp eq i32 %48, 0
  br i1 %.not135, label %51, label %49

49:                                               ; preds = %42
  %50 = getelementptr inbounds i8, ptr %0, i64 8
  store i64 %47, ptr %50, align 8, !tbaa !28
  br label %.thread152

51:                                               ; preds = %42
  %52 = getelementptr inbounds i8, ptr %0, i64 72
  %53 = load ptr, ptr %52, align 8, !tbaa !34
  %54 = getelementptr inbounds i8, ptr %0, i64 80
  %55 = load i64, ptr %54, align 8, !tbaa !35
  %56 = call i64 @ZSTD_compressBegin_advanced_internal(ptr noundef nonnull %7, ptr noundef %53, i64 noundef %55, i32 noundef 1, i32 noundef 0, ptr noundef null, ptr noundef nonnull byval(%struct.ZSTD_CCtx_params_s) align 8 %2, i64 noundef %45) #4
  %57 = call i32 @ZSTD_isError(i64 noundef %56) #4
  %.not136 = icmp eq i32 %57, 0
  br i1 %.not136, label %.thread, label %58

58:                                               ; preds = %51
  %59 = getelementptr inbounds i8, ptr %0, i64 8
  store i64 %56, ptr %59, align 8, !tbaa !28
  br label %.thread152

.thread:                                          ; preds = %35, %51
  %60 = getelementptr inbounds i8, ptr %0, i64 48
  %61 = load ptr, ptr %60, align 8, !tbaa !36
  %62 = getelementptr inbounds i8, ptr %0, i64 88
  %63 = load i32, ptr %11, align 8, !tbaa !25
  %64 = load ptr, ptr %62, align 8
  %65 = getelementptr inbounds i8, ptr %0, i64 96
  %66 = load i64, ptr %65, align 8
  call void @ZSTDMT_serialState_update(ptr noundef %61, ptr noundef nonnull %7, ptr noundef nonnull byval(%struct.rawSeqStore_t) align 8 %3, ptr %64, i64 %66, i32 noundef %63)
  %67 = getelementptr inbounds i8, ptr %0, i64 108
  %68 = load i32, ptr %67, align 4, !tbaa !32
  %.not138 = icmp eq i32 %68, 0
  br i1 %.not138, label %69, label %75

69:                                               ; preds = %.thread
  %70 = load ptr, ptr %62, align 8, !tbaa !37
  %71 = call i64 @ZSTD_compressContinue(ptr noundef nonnull %7, ptr noundef nonnull %.sroa.050.0, i64 noundef %.sroa.9.0, ptr noundef %70, i64 noundef 0) #4
  %72 = call i32 @ZSTD_isError(i64 noundef %71) #4
  %.not139 = icmp eq i32 %72, 0
  br i1 %.not139, label %.thread155, label %73

.thread155:                                       ; preds = %69
  call void @ZSTD_invalidateRepCodes(ptr noundef nonnull %7) #4
  br label %75

73:                                               ; preds = %69
  %74 = getelementptr inbounds i8, ptr %0, i64 8
  store i64 %71, ptr %74, align 8, !tbaa !28
  br label %.thread152

75:                                               ; preds = %.thread155, %.thread
  %76 = load i64, ptr %65, align 8, !tbaa !38
  %77 = add i64 %76, 524287
  %78 = lshr i64 %77, 19
  %79 = trunc i64 %78 to i32
  %80 = load ptr, ptr %62, align 8, !tbaa !37
  %81 = getelementptr inbounds i8, ptr %.sroa.050.0, i64 %.sroa.9.0
  %82 = icmp sgt i32 %79, 1
  br i1 %82, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %75
  %83 = ptrtoint ptr %81 to i64
  %84 = getelementptr inbounds i8, ptr %0, i64 8
  %wide.trip.count = and i64 %78, 2147483647
  br label %85

85:                                               ; preds = %.lr.ph, %91
  %indvars.iv = phi i64 [ 1, %.lr.ph ], [ %indvars.iv.next, %91 ]
  %.0123167 = phi ptr [ %80, %.lr.ph ], [ %92, %91 ]
  %.0126165 = phi ptr [ %.sroa.050.0, %.lr.ph ], [ %93, %91 ]
  %86 = ptrtoint ptr %.0126165 to i64
  %87 = sub i64 %83, %86
  %88 = call i64 @ZSTD_compressContinue(ptr noundef nonnull %7, ptr noundef %.0126165, i64 noundef %87, ptr noundef %.0123167, i64 noundef 524288) #4
  %89 = call i32 @ZSTD_isError(i64 noundef %88) #4
  %.not143 = icmp eq i32 %89, 0
  br i1 %.not143, label %91, label %90

90:                                               ; preds = %85
  store i64 %88, ptr %84, align 8, !tbaa !28
  br label %.thread152

91:                                               ; preds = %85
  %92 = getelementptr inbounds i8, ptr %.0123167, i64 524288
  %93 = getelementptr inbounds i8, ptr %.0126165, i64 %88
  %94 = load i64, ptr %84, align 8, !tbaa !28
  %95 = add i64 %94, %88
  store i64 %95, ptr %84, align 8, !tbaa !28
  %96 = shl nuw nsw i64 %indvars.iv, 19
  store i64 %96, ptr %0, align 8, !tbaa !39
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %85, !llvm.loop !40

._crit_edge:                                      ; preds = %91, %75
  %.0126.lcssa = phi ptr [ %.sroa.050.0, %75 ], [ %93, %91 ]
  %.0123.lcssa = phi ptr [ %80, %75 ], [ %92, %91 ]
  %97 = icmp sgt i32 %79, 0
  %98 = zext i1 %97 to i32
  %99 = getelementptr inbounds i8, ptr %0, i64 112
  %100 = load i32, ptr %99, align 8, !tbaa !42
  %101 = or i32 %100, %98
  %.not140 = icmp eq i32 %101, 0
  br i1 %.not140, label %._crit_edge..thread152_crit_edge, label %102

._crit_edge..thread152_crit_edge:                 ; preds = %._crit_edge
  %.phi.trans.insert = getelementptr inbounds i8, ptr %0, i64 8
  %.pre = load i64, ptr %.phi.trans.insert, align 8, !tbaa !28
  br label %.thread152

102:                                              ; preds = %._crit_edge
  %103 = load i64, ptr %65, align 8, !tbaa !38
  %104 = and i64 %103, 524287
  %105 = icmp eq i64 %104, 0
  %106 = icmp ugt i64 %103, 524287
  %107 = and i1 %106, %105
  %108 = select i1 %107, i64 524288, i64 %104
  %.not141 = icmp eq i32 %100, 0
  %109 = ptrtoint ptr %81 to i64
  %110 = ptrtoint ptr %.0126.lcssa to i64
  %111 = sub i64 %109, %110
  br i1 %.not141, label %114, label %112

112:                                              ; preds = %102
  %113 = call i64 @ZSTD_compressEnd(ptr noundef nonnull %7, ptr noundef %.0126.lcssa, i64 noundef %111, ptr noundef %.0123.lcssa, i64 noundef %108) #4
  br label %116

114:                                              ; preds = %102
  %115 = call i64 @ZSTD_compressContinue(ptr noundef nonnull %7, ptr noundef %.0126.lcssa, i64 noundef %111, ptr noundef %.0123.lcssa, i64 noundef %108) #4
  br label %116

116:                                              ; preds = %114, %112
  %117 = phi i64 [ %113, %112 ], [ %115, %114 ]
  %118 = call i32 @ZSTD_isError(i64 noundef %117) #4
  %.not142 = icmp eq i32 %118, 0
  %119 = getelementptr inbounds i8, ptr %0, i64 8
  br i1 %.not142, label %121, label %120

120:                                              ; preds = %116
  store i64 %117, ptr %119, align 8, !tbaa !28
  br label %.thread152

121:                                              ; preds = %116
  %122 = load i64, ptr %119, align 8, !tbaa !28
  %123 = add i64 %122, %117
  store i64 %123, ptr %119, align 8, !tbaa !28
  br label %.thread152

.thread152:                                       ; preds = %._crit_edge..thread152_crit_edge, %58, %49, %90, %73, %40, %120, %121, %28, %18
  %124 = phi i64 [ %.pre, %._crit_edge..thread152_crit_edge ], [ %56, %58 ], [ %47, %49 ], [ %88, %90 ], [ %71, %73 ], [ %38, %40 ], [ %117, %120 ], [ %123, %121 ], [ -64, %28 ], [ -64, %18 ]
  %125 = getelementptr inbounds i8, ptr %0, i64 48
  %126 = load ptr, ptr %125, align 8, !tbaa !36
  %127 = load i32, ptr %11, align 8, !tbaa !25
  call void @ZSTDMT_serialState_ensureFinished(ptr noundef %126, i32 noundef %127, i64 noundef %124)
  %128 = load ptr, ptr %8, align 8, !tbaa !23
  call void @ZSTDMT_releaseSeq(ptr noundef %128, ptr noundef nonnull byval(%struct.rawSeqStore_t) align 8 %3)
  %129 = load ptr, ptr %5, align 8, !tbaa !12
  call void @ZSTDMT_releaseCCtx(ptr noundef %129, ptr noundef %7)
  %130 = getelementptr inbounds i8, ptr %0, i64 96
  %131 = load i64, ptr %130, align 8, !tbaa !38
  store i64 %131, ptr %0, align 8, !tbaa !39
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #4
  call void @llvm.lifetime.end.p0(i64 120, ptr nonnull %2) #4
  ret void
}

; 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: nounwind uwtable
declare hidden ptr @ZSTDMT_getCCtx(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare hidden void @ZSTDMT_getSeq(ptr dead_on_unwind noalias writable sret(%struct.rawSeqStore_t) align 8, ptr noundef) local_unnamed_addr #0

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

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

declare i64 @ZSTD_compressBegin_advanced_internal(ptr noundef, ptr noundef, i64 noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef byval(%struct.ZSTD_CCtx_params_s) align 8, i64 noundef) local_unnamed_addr #3

declare i32 @ZSTD_isError(i64 noundef) local_unnamed_addr #3

declare i64 @ZSTD_CCtxParam_setParameter(ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #3

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

declare i64 @ZSTD_compressContinue(ptr noundef, ptr noundef, i64 noundef, ptr noundef, i64 noundef) local_unnamed_addr #3

declare void @ZSTD_invalidateRepCodes(ptr noundef) local_unnamed_addr #3

declare i64 @ZSTD_compressEnd(ptr noundef, ptr noundef, i64 noundef, ptr noundef, i64 noundef) local_unnamed_addr #3

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

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

; Function Attrs: nounwind uwtable
declare hidden void @ZSTDMT_releaseCCtx(ptr noundef, ptr 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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }

!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 4, !6, i64 20, i64 4, !6, 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 4, !6, i64 48, i64 4, !6, i64 52, i64 4, !6, i64 56, i64 4, !6, i64 60, i64 4, !6, i64 64, i64 4, !6, i64 68, i64 4, !6, i64 72, i64 4, !6, i64 76, i64 4, !6, i64 80, i64 4, !6, i64 84, i64 4, !6, i64 88, i64 4, !6, i64 96, i64 8, !10, i64 104, i64 8, !10, i64 112, i64 8, !10}
!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 = !{!"any pointer", !8, i64 0}
!12 = !{!13, !11, i64 24}
!13 = !{!"", !14, i64 0, !14, i64 8, !7, i64 16, !7, i64 20, !11, i64 24, !11, i64 32, !11, i64 40, !11, i64 48, !15, i64 56, !16, i64 72, !16, i64 88, !7, i64 104, !7, i64 108, !7, i64 112, !17, i64 120, !11, i64 240, !22, i64 248, !14, i64 256, !7, i64 264}
!14 = !{!"long", !8, i64 0}
!15 = !{!"buffer_s", !11, i64 0, !14, i64 8}
!16 = !{!"", !11, i64 0, !14, i64 8}
!17 = !{!"ZSTD_CCtx_params_s", !7, i64 0, !18, i64 4, !19, i64 32, !7, i64 44, !7, i64 48, !7, i64 52, !7, i64 56, !7, i64 60, !7, i64 64, !20, i64 68, !21, i64 96}
!18 = !{!"", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20, !7, i64 24}
!19 = !{!"", !7, i64 0, !7, i64 4, !7, i64 8}
!20 = !{!"", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20}
!21 = !{!"", !11, i64 0, !11, i64 8, !11, i64 16}
!22 = !{!"long long", !8, i64 0}
!23 = !{!13, !11, i64 40}
!24 = !{!14, !14, i64 0}
!25 = !{!13, !7, i64 104}
!26 = !{!17, !7, i64 36}
!27 = !{!17, !7, i64 68}
!28 = !{!13, !14, i64 8}
!29 = !{!13, !11, i64 32}
!30 = !{!13, !11, i64 240}
!31 = !{!13, !22, i64 248}
!32 = !{!13, !7, i64 108}
!33 = !{!8, !8, i64 0}
!34 = !{!13, !11, i64 72}
!35 = !{!13, !14, i64 80}
!36 = !{!13, !11, i64 48}
!37 = !{!13, !11, i64 88}
!38 = !{!13, !14, i64 96}
!39 = !{!13, !14, i64 0}
!40 = distinct !{!40, !41}
!41 = !{!"llvm.loop.mustprogress"}
!42 = !{!13, !7, i64 112}


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