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

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

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

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

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

; Function Attrs: 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) #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @ZSTD_isError(i64 noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local void @ZSTD_getCParamsFromCCtxParams(ptr dead_on_unwind noalias writable sret(%struct.ZSTD_compressionParameters) align 4, ptr noundef, i64 noundef, i64 noundef, i32 noundef) #2

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

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

; Function Attrs: nounwind uwtable
define dso_local ptr @ZSTD_createCDict_advanced2(ptr noundef %0, i64 noundef %1, i32 noundef %2, i32 noundef %3, ptr noundef %4, ptr noundef byval(%struct.ZSTD_customMem) align 8 %5) #2 {
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i64, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca %struct.ZSTD_CCtx_params_s, align 8
  %14 = alloca %struct.ZSTD_compressionParameters, align 4
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca %struct.ZSTD_compressionParameters, align 4
  %18 = alloca %struct.ZSTD_compressionParameters, align 4
  %19 = alloca %struct.ZSTD_compressionParameters, align 4
  %20 = alloca %struct.ZSTD_compressionParameters, align 8
  store ptr %0, ptr %8, align 8, !tbaa !5
  store i64 %1, ptr %9, align 8, !tbaa !9
  store i32 %2, ptr %10, align 4, !tbaa !11
  store i32 %3, ptr %11, align 4, !tbaa !11
  store ptr %4, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 216, ptr %13) #3
  %21 = load ptr, ptr %12, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %13, ptr align 8 %21, i64 216, i1 false), !tbaa.struct !13
  call void @llvm.lifetime.start.p0(i64 28, ptr %14) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #3
  br label %22

22:                                               ; preds = %6
  br label %23

23:                                               ; preds = %22
  br label %24

24:                                               ; preds = %23
  %25 = getelementptr inbounds %struct.ZSTD_customMem, ptr %5, i32 0, i32 0
  %26 = load ptr, ptr %25, align 8, !tbaa !14
  %27 = icmp ne ptr %26, null
  %28 = xor i1 %27, true
  %29 = zext i1 %28 to i32
  %30 = getelementptr inbounds %struct.ZSTD_customMem, ptr %5, i32 0, i32 1
  %31 = load ptr, ptr %30, align 8, !tbaa !16
  %32 = icmp ne ptr %31, null
  %33 = xor i1 %32, true
  %34 = zext i1 %33 to i32
  %35 = xor i32 %29, %34
  %36 = icmp ne i32 %35, 0
  br i1 %36, label %37, label %38

37:                                               ; preds = %24
  store ptr null, ptr %7, align 8
  store i32 1, ptr %16, align 4
  br label %88

38:                                               ; preds = %24
  %39 = getelementptr inbounds %struct.ZSTD_CCtx_params_s, ptr %13, i32 0, i32 14
  %40 = load i32, ptr %39, align 8, !tbaa !17
  %41 = icmp ne i32 %40, 0
  br i1 %41, label %42, label %47

42:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 28, ptr %17) #3
  %43 = getelementptr inbounds %struct.ZSTD_CCtx_params_s, ptr %13, i32 0, i32 3
  %44 = load i32, ptr %43, align 4, !tbaa !22
  %45 = load i64, ptr %9, align 8, !tbaa !9
  call void @ZSTD_dedicatedDictSearch_getCParams(ptr dead_on_unwind writable sret(%struct.ZSTD_compressionParameters) align 4 %17, i32 noundef %44, i64 noundef %45)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %14, ptr align 4 %17, i64 28, i1 false), !tbaa.struct !23
  call void @llvm.lifetime.end.p0(i64 28, ptr %17) #3
  %46 = getelementptr inbounds %struct.ZSTD_CCtx_params_s, ptr %13, i32 0, i32 1
  call void @ZSTD_overrideCParams(ptr noundef %14, ptr noundef %46)
  br label %49

47:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 28, ptr %18) #3
  %48 = load i64, ptr %9, align 8, !tbaa !9
  call void @ZSTD_getCParamsFromCCtxParams(ptr dead_on_unwind writable sret(%struct.ZSTD_compressionParameters) align 4 %18, ptr noundef %13, i64 noundef -1, i64 noundef %48, i32 noundef 2)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %14, ptr align 4 %18, i64 28, i1 false), !tbaa.struct !23
  call void @llvm.lifetime.end.p0(i64 28, ptr %18) #3
  br label %49

49:                                               ; preds = %47, %42
  %50 = call i32 @ZSTD_dedicatedDictSearch_isSupported(ptr noundef %14)
  %51 = icmp ne i32 %50, 0
  br i1 %51, label %55, label %52

52:                                               ; preds = %49
  %53 = getelementptr inbounds %struct.ZSTD_CCtx_params_s, ptr %13, i32 0, i32 14
  store i32 0, ptr %53, align 8, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 28, ptr %19) #3
  %54 = load i64, ptr %9, align 8, !tbaa !9
  call void @ZSTD_getCParamsFromCCtxParams(ptr dead_on_unwind writable sret(%struct.ZSTD_compressionParameters) align 4 %19, ptr noundef %13, i64 noundef -1, i64 noundef %54, i32 noundef 2)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %14, ptr align 4 %19, i64 28, i1 false), !tbaa.struct !23
  call void @llvm.lifetime.end.p0(i64 28, ptr %19) #3
  br label %55

55:                                               ; preds = %52, %49
  br label %56

56:                                               ; preds = %55
  br label %57

57:                                               ; preds = %56
  br label %58

58:                                               ; preds = %57
  %59 = getelementptr inbounds %struct.ZSTD_CCtx_params_s, ptr %13, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %59, ptr align 4 %14, i64 28, i1 false), !tbaa.struct !23
  %60 = getelementptr inbounds %struct.ZSTD_CCtx_params_s, ptr %13, i32 0, i32 20
  %61 = load i32, ptr %60, align 8, !tbaa !24
  %62 = call i32 @ZSTD_resolveRowMatchFinderMode(i32 noundef %61, ptr noundef %14)
  %63 = getelementptr inbounds %struct.ZSTD_CCtx_params_s, ptr %13, i32 0, i32 20
  store i32 %62, ptr %63, align 8, !tbaa !24
  %64 = load i64, ptr %9, align 8, !tbaa !9
  %65 = load i32, ptr %10, align 4, !tbaa !11
  %66 = getelementptr inbounds %struct.ZSTD_CCtx_params_s, ptr %13, i32 0, i32 1
  %67 = getelementptr inbounds %struct.ZSTD_CCtx_params_s, ptr %13, i32 0, i32 20
  %68 = load i32, ptr %67, align 8, !tbaa !24
  %69 = getelementptr inbounds %struct.ZSTD_CCtx_params_s, ptr %13, i32 0, i32 14
  %70 = load i32, ptr %69, align 8, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 28, ptr %20) #3
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %20, ptr align 4 %66, i64 28, i1 false), !tbaa.struct !23
  %71 = call ptr @ZSTD_createCDict_advanced_internal(i64 noundef %64, i32 noundef %65, ptr noundef byval(%struct.ZSTD_compressionParameters) align 8 %20, i32 noundef %68, i32 noundef %70, ptr noundef byval(%struct.ZSTD_customMem) align 8 %5)
  call void @llvm.lifetime.end.p0(i64 28, ptr %20) #3
  store ptr %71, ptr %15, align 8, !tbaa !5
  %72 = load ptr, ptr %15, align 8, !tbaa !5
  %73 = icmp ne ptr %72, null
  br i1 %73, label %74, label %83

74:                                               ; preds = %58
  %75 = load ptr, ptr %15, align 8, !tbaa !5
  %76 = load ptr, ptr %8, align 8, !tbaa !5
  %77 = load i64, ptr %9, align 8, !tbaa !9
  %78 = load i32, ptr %10, align 4, !tbaa !11
  %79 = load i32, ptr %11, align 4, !tbaa !11
  %80 = call i64 @ZSTD_initCDict_internal(ptr noundef %75, ptr noundef %76, i64 noundef %77, i32 noundef %78, i32 noundef %79, ptr noundef byval(%struct.ZSTD_CCtx_params_s) align 8 %13)
  %81 = call i32 @ZSTD_isError(i64 noundef %80)
  %82 = icmp ne i32 %81, 0
  br i1 %82, label %83, label %86

83:                                               ; preds = %74, %58
  %84 = load ptr, ptr %15, align 8, !tbaa !5
  %85 = call i64 @ZSTD_freeCDict(ptr noundef %84)
  store ptr null, ptr %7, align 8
  store i32 1, ptr %16, align 4
  br label %88

86:                                               ; preds = %74
  %87 = load ptr, ptr %15, align 8, !tbaa !5
  store ptr %87, ptr %7, align 8
  store i32 1, ptr %16, align 4
  br label %88

88:                                               ; preds = %86, %83, %37
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 28, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 216, ptr %13) #3
  %89 = load ptr, ptr %7, align 8
  ret ptr %89
}

; Function Attrs: nounwind uwtable
declare hidden void @ZSTD_dedicatedDictSearch_getCParams(ptr dead_on_unwind noalias writable sret(%struct.ZSTD_compressionParameters) align 4, i32 noundef, i64 noundef) #2

; Function Attrs: nounwind uwtable
declare hidden i32 @ZSTD_dedicatedDictSearch_isSupported(ptr noundef) #2

; Function Attrs: nounwind uwtable
declare hidden ptr @ZSTD_createCDict_advanced_internal(i64 noundef, i32 noundef, ptr noundef byval(%struct.ZSTD_compressionParameters) align 8, i32 noundef, i32 noundef, ptr noundef byval(%struct.ZSTD_customMem) align 8) #2

; Function Attrs: nounwind uwtable
declare hidden i64 @ZSTD_initCDict_internal(ptr noundef, ptr noundef, i64 noundef, i32 noundef, i32 noundef, ptr noundef byval(%struct.ZSTD_CCtx_params_s) align 8) #2

; Function Attrs: nounwind uwtable
declare dso_local i64 @ZSTD_freeCDict(ptr noundef) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{i64 0, i64 4, !11, i64 4, i64 4, !11, i64 8, i64 4, !11, i64 12, i64 4, !11, i64 16, i64 4, !11, i64 20, i64 4, !11, i64 24, i64 4, !11, i64 28, i64 4, !11, i64 32, i64 4, !11, i64 36, i64 4, !11, i64 40, i64 4, !11, i64 44, i64 4, !11, i64 48, i64 4, !11, i64 56, i64 8, !9, i64 64, i64 4, !11, i64 68, i64 4, !11, i64 72, i64 4, !11, i64 76, i64 4, !11, i64 80, i64 8, !9, i64 88, i64 4, !11, i64 92, i64 4, !11, i64 96, i64 4, !11, i64 100, i64 4, !11, i64 104, i64 4, !11, i64 108, i64 4, !11, i64 112, i64 4, !11, i64 116, i64 4, !11, i64 120, i64 4, !11, i64 124, i64 4, !11, i64 128, i64 4, !11, i64 132, i64 4, !11, i64 136, i64 4, !11, i64 140, i64 4, !11, i64 144, i64 4, !11, i64 148, i64 4, !11, i64 152, i64 8, !5, i64 160, i64 8, !5, i64 168, i64 8, !5, i64 176, i64 4, !11, i64 180, i64 4, !11, i64 184, i64 8, !5, i64 192, i64 8, !5, i64 200, i64 8, !9, i64 208, i64 4, !11}
!14 = !{!15, !6, i64 0}
!15 = !{!"", !6, i64 0, !6, i64 8, !6, i64 16}
!16 = !{!15, !6, i64 8}
!17 = !{!18, !12, i64 120}
!18 = !{!"ZSTD_CCtx_params_s", !12, i64 0, !19, i64 4, !20, i64 32, !12, i64 44, !12, i64 48, !10, i64 56, !12, i64 64, !12, i64 68, !12, i64 72, !12, i64 76, !10, i64 80, !12, i64 88, !12, i64 92, !21, i64 96, !12, i64 120, !12, i64 124, !12, i64 128, !12, i64 132, !12, i64 136, !12, i64 140, !12, i64 144, !12, i64 148, !15, i64 152, !12, i64 176, !12, i64 180, !6, i64 184, !6, i64 192, !10, i64 200, !12, i64 208}
!19 = !{!"", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20, !12, i64 24}
!20 = !{!"", !12, i64 0, !12, i64 4, !12, i64 8}
!21 = !{!"", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20}
!22 = !{!18, !12, i64 44}
!23 = !{i64 0, i64 4, !11, i64 4, i64 4, !11, i64 8, i64 4, !11, i64 12, i64 4, !11, i64 16, i64 4, !11, i64 20, i64 4, !11, i64 24, i64 4, !11}
!24 = !{!18, !12, i64 144}


; 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_compressionParameters = type { i32, i32, i32, i32, i32, i32, i32 }
%struct.ZSTD_customMem = type { ptr, ptr, ptr }
%struct.ZSTD_CCtx_params_s = type { i32, %struct.ZSTD_compressionParameters, %struct.ZSTD_frameParameters, i32, i32, i64, i32, i32, i32, i32, i64, i32, i32, %struct.ldmParams_t, i32, i32, i32, i32, i32, i32, i32, i32, %struct.ZSTD_customMem, i32, i32, ptr, ptr, i64, i32 }
%struct.ZSTD_frameParameters = type { i32, i32, i32 }
%struct.ldmParams_t = type { i32, i32, i32, i32, i32, i32 }

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

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

; 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) #1

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

; Function Attrs: nounwind uwtable
declare dso_local void @ZSTD_getCParamsFromCCtxParams(ptr dead_on_unwind noalias writable sret(%struct.ZSTD_compressionParameters) align 4, ptr noundef, i64 noundef, i64 noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden void @ZSTD_overrideCParams(ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden i32 @ZSTD_resolveRowMatchFinderMode(i32 noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local ptr @ZSTD_createCDict_advanced2(ptr noundef %0, i64 noundef %1, i32 noundef %2, i32 noundef %3, ptr nocapture noundef readonly %4, ptr noundef byval(%struct.ZSTD_customMem) align 8 %5) local_unnamed_addr #2 {
  %7 = alloca %struct.ZSTD_CCtx_params_s, align 8
  %8 = alloca %struct.ZSTD_compressionParameters, align 4
  %9 = alloca %struct.ZSTD_compressionParameters, align 4
  %10 = alloca %struct.ZSTD_compressionParameters, align 8
  call void @llvm.lifetime.start.p0(i64 216, ptr nonnull %7) #3
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(216) %7, ptr noundef nonnull align 8 dereferenceable(216) %4, i64 216, i1 false), !tbaa.struct !5
  call void @llvm.lifetime.start.p0(i64 28, ptr nonnull %8) #3
  %11 = load ptr, ptr %5, align 8, !tbaa !14
  %.not = icmp eq ptr %11, null
  %12 = getelementptr inbounds i8, ptr %5, i64 8
  %13 = load ptr, ptr %12, align 8, !tbaa !16
  %.not15 = icmp eq ptr %13, null
  %14 = xor i1 %.not, %.not15
  br i1 %14, label %38, label %15

15:                                               ; preds = %6
  %16 = getelementptr inbounds i8, ptr %7, i64 120
  %17 = load i32, ptr %16, align 8, !tbaa !17
  %.not16 = icmp eq i32 %17, 0
  br i1 %.not16, label %22, label %18

18:                                               ; preds = %15
  %19 = getelementptr inbounds i8, ptr %7, i64 44
  %20 = load i32, ptr %19, align 4, !tbaa !22
  call void @ZSTD_dedicatedDictSearch_getCParams(ptr dead_on_unwind nonnull writable sret(%struct.ZSTD_compressionParameters) align 4 %8, i32 noundef %20, i64 noundef %1)
  %21 = getelementptr inbounds i8, ptr %7, i64 4
  call void @ZSTD_overrideCParams(ptr noundef nonnull %8, ptr noundef nonnull %21)
  br label %23

22:                                               ; preds = %15
  call void @ZSTD_getCParamsFromCCtxParams(ptr dead_on_unwind nonnull writable sret(%struct.ZSTD_compressionParameters) align 4 %8, ptr noundef nonnull %7, i64 noundef -1, i64 noundef %1, i32 noundef 2)
  br label %23

23:                                               ; preds = %22, %18
  %24 = call i32 @ZSTD_dedicatedDictSearch_isSupported(ptr noundef nonnull %8)
  %.not17 = icmp eq i32 %24, 0
  br i1 %.not17, label %25, label %26

25:                                               ; preds = %23
  store i32 0, ptr %16, align 8, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 28, ptr nonnull %9) #3
  call void @ZSTD_getCParamsFromCCtxParams(ptr dead_on_unwind nonnull writable sret(%struct.ZSTD_compressionParameters) align 4 %9, ptr noundef nonnull %7, i64 noundef -1, i64 noundef %1, i32 noundef 2)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(28) %8, ptr noundef nonnull align 4 dereferenceable(28) %9, i64 28, i1 false), !tbaa.struct !23
  call void @llvm.lifetime.end.p0(i64 28, ptr nonnull %9) #3
  br label %26

26:                                               ; preds = %23, %25
  %27 = getelementptr inbounds i8, ptr %7, i64 4
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(28) %27, ptr noundef nonnull align 4 dereferenceable(28) %8, i64 28, i1 false), !tbaa.struct !23
  %28 = getelementptr inbounds i8, ptr %7, i64 144
  %29 = load i32, ptr %28, align 8, !tbaa !24
  %30 = call i32 @ZSTD_resolveRowMatchFinderMode(i32 noundef %29, ptr noundef nonnull %8)
  store i32 %30, ptr %28, align 8, !tbaa !24
  %31 = load i32, ptr %16, align 8, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 28, ptr nonnull %10) #3
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(28) %10, ptr noundef nonnull align 4 dereferenceable(28) %27, i64 28, i1 false), !tbaa.struct !23
  %32 = call ptr @ZSTD_createCDict_advanced_internal(i64 noundef %1, i32 noundef %2, ptr noundef nonnull byval(%struct.ZSTD_compressionParameters) align 8 %10, i32 noundef %30, i32 noundef %31, ptr noundef nonnull byval(%struct.ZSTD_customMem) align 8 %5)
  call void @llvm.lifetime.end.p0(i64 28, ptr nonnull %10) #3
  %.not18 = icmp eq ptr %32, null
  br i1 %.not18, label %36, label %33

33:                                               ; preds = %26
  %34 = call i64 @ZSTD_initCDict_internal(ptr noundef nonnull %32, ptr noundef %0, i64 noundef %1, i32 noundef %2, i32 noundef %3, ptr noundef nonnull byval(%struct.ZSTD_CCtx_params_s) align 8 %7)
  %35 = call i32 @ZSTD_isError(i64 noundef %34)
  %.not19 = icmp eq i32 %35, 0
  br i1 %.not19, label %38, label %36

36:                                               ; preds = %33, %26
  %37 = call i64 @ZSTD_freeCDict(ptr noundef %32)
  br label %38

38:                                               ; preds = %33, %6, %36
  %.0 = phi ptr [ null, %36 ], [ null, %6 ], [ %32, %33 ]
  call void @llvm.lifetime.end.p0(i64 28, ptr nonnull %8) #3
  call void @llvm.lifetime.end.p0(i64 216, ptr nonnull %7) #3
  ret ptr %.0
}

; Function Attrs: nounwind uwtable
declare hidden void @ZSTD_dedicatedDictSearch_getCParams(ptr dead_on_unwind noalias writable sret(%struct.ZSTD_compressionParameters) align 4, i32 noundef, i64 noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden i32 @ZSTD_dedicatedDictSearch_isSupported(ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden ptr @ZSTD_createCDict_advanced_internal(i64 noundef, i32 noundef, ptr noundef byval(%struct.ZSTD_compressionParameters) align 8, i32 noundef, i32 noundef, ptr noundef byval(%struct.ZSTD_customMem) align 8) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden i64 @ZSTD_initCDict_internal(ptr noundef, ptr noundef, i64 noundef, i32 noundef, i32 noundef, ptr noundef byval(%struct.ZSTD_CCtx_params_s) align 8) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local i64 @ZSTD_freeCDict(ptr noundef) local_unnamed_addr #2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 56, i64 8, !10, i64 64, i64 4, !6, i64 68, i64 4, !6, i64 72, i64 4, !6, i64 76, i64 4, !6, i64 80, i64 8, !10, i64 88, i64 4, !6, i64 92, i64 4, !6, i64 96, i64 4, !6, i64 100, i64 4, !6, i64 104, i64 4, !6, i64 108, i64 4, !6, i64 112, i64 4, !6, i64 116, i64 4, !6, i64 120, i64 4, !6, i64 124, i64 4, !6, i64 128, i64 4, !6, i64 132, i64 4, !6, i64 136, i64 4, !6, i64 140, i64 4, !6, i64 144, i64 4, !6, i64 148, i64 4, !6, i64 152, i64 8, !12, i64 160, i64 8, !12, i64 168, i64 8, !12, i64 176, i64 4, !6, i64 180, i64 4, !6, i64 184, i64 8, !12, i64 192, i64 8, !12, i64 200, i64 8, !10, i64 208, i64 4, !6}
!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", !8, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"any pointer", !8, i64 0}
!14 = !{!15, !13, i64 0}
!15 = !{!"", !13, i64 0, !13, i64 8, !13, i64 16}
!16 = !{!15, !13, i64 8}
!17 = !{!18, !7, i64 120}
!18 = !{!"ZSTD_CCtx_params_s", !7, i64 0, !19, i64 4, !20, i64 32, !7, i64 44, !7, i64 48, !11, i64 56, !7, i64 64, !7, i64 68, !7, i64 72, !7, i64 76, !11, i64 80, !7, i64 88, !7, i64 92, !21, i64 96, !7, i64 120, !7, i64 124, !7, i64 128, !7, i64 132, !7, i64 136, !7, i64 140, !7, i64 144, !7, i64 148, !15, i64 152, !7, i64 176, !7, i64 180, !13, i64 184, !13, i64 192, !11, i64 200, !7, i64 208}
!19 = !{!"", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20, !7, i64 24}
!20 = !{!"", !7, i64 0, !7, i64 4, !7, i64 8}
!21 = !{!"", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20}
!22 = !{!18, !7, i64 44}
!23 = !{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}
!24 = !{!18, !7, i64 144}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,MemCpyOptPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass