; LLVM IR from balintbalazs/B3D :: source/src/B3D_cudaCompress/B3D (B3DcompressFunctions)

; 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"

%"class.cudaCompress::BitStream" = type <{ %"class.cudaCompress::BitStreamReadOnly.base", [4 x i8], ptr, i8, [7 x i8] }>
%"class.cudaCompress::BitStreamReadOnly.base" = type <{ ptr, ptr, i32, i32, i32 }>

@.str = external hidden unnamed_addr constant [17 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [107 x i8], align 1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN12cudaCompress9BitStreamD2Ev(ptr noundef nonnull align 8 dereferenceable(41)) unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN12cudaCompress15compressImageLLEPNS_8InstanceERSt6vectorIjSaIjEEPsS6_S6_Ptiiimi(ptr noundef %0, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5, i32 noundef %6, i32 noundef %7, i32 noundef %8, i64 noundef %9, i32 noundef %10) #1 personality ptr @__gxx_personality_v0 {
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i64, align 8
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca %"class.cudaCompress::BitStream", align 8
  %25 = alloca ptr, align 8
  %26 = alloca i32, align 4
  store ptr %0, ptr %12, align 8, !tbaa !5
  store ptr %1, ptr %13, align 8, !tbaa !5
  store ptr %2, ptr %14, align 8, !tbaa !5
  store ptr %3, ptr %15, align 8, !tbaa !5
  store ptr %4, ptr %16, align 8, !tbaa !5
  store ptr %5, ptr %17, align 8, !tbaa !5
  store i32 %6, ptr %18, align 4, !tbaa !9
  store i32 %7, ptr %19, align 4, !tbaa !9
  store i32 %8, ptr %20, align 4, !tbaa !9
  store i64 %9, ptr %21, align 8, !tbaa !11
  store i32 %10, ptr %22, align 4, !tbaa !9
  %27 = load i32, ptr %19, align 4, !tbaa !9
  %28 = load i32, ptr %20, align 4, !tbaa !9
  %29 = mul nsw i32 %27, %28
  store i32 %29, ptr %19, align 4, !tbaa !9
  %30 = load i64, ptr %21, align 8, !tbaa !11
  %31 = icmp ugt i64 %30, 0
  br i1 %31, label %32, label %66

32:                                               ; preds = %11
  %33 = load i64, ptr %21, align 8, !tbaa !11
  %34 = icmp ult i64 %33, 100
  br i1 %34, label %35, label %66

35:                                               ; preds = %32
  %36 = load ptr, ptr %15, align 8, !tbaa !5
  %37 = load ptr, ptr %14, align 8, !tbaa !5
  %38 = load i32, ptr %18, align 4, !tbaa !9
  %39 = load i32, ptr %19, align 4, !tbaa !9
  %40 = mul nsw i32 %38, %39
  %41 = sext i32 %40 to i64
  %42 = mul i64 %41, 2
  %43 = call i32 @cudaMemcpy(ptr noundef %36, ptr noundef %37, i64 noundef %42, i32 noundef 3)
  %44 = load i64, ptr %21, align 8, !tbaa !11
  switch i64 %44, label %64 [
    i64 1, label %45
    i64 2, label %45
    i64 7, label %45
    i64 9, label %55
  ]

45:                                               ; preds = %35, %35, %35
  %46 = load ptr, ptr %14, align 8, !tbaa !5
  %47 = load ptr, ptr %15, align 8, !tbaa !5
  %48 = load i32, ptr %18, align 4, !tbaa !9
  %49 = sext i32 %48 to i64
  %50 = mul i64 %49, 2
  %51 = trunc i64 %50 to i32
  %52 = load i32, ptr %18, align 4, !tbaa !9
  %53 = load i32, ptr %19, align 4, !tbaa !9
  %54 = load i32, ptr %22, align 4, !tbaa !9
  call void @_ZN12cudaCompress4util16predictor7_tilesEPKsPsiiii(ptr noundef %46, ptr noundef %47, i32 noundef %51, i32 noundef %52, i32 noundef %53, i32 noundef %54)
  br label %65

55:                                               ; preds = %35
  %56 = load ptr, ptr %14, align 8, !tbaa !5
  %57 = load ptr, ptr %15, align 8, !tbaa !5
  %58 = load i32, ptr %18, align 4, !tbaa !9
  %59 = sext i32 %58 to i64
  %60 = mul i64 %59, 2
  %61 = trunc i64 %60 to i32
  %62 = load i32, ptr %18, align 4, !tbaa !9
  %63 = load i32, ptr %19, align 4, !tbaa !9
  call void @_ZN12cudaCompress4util18predictorMed_tilesEPKsPsiii(ptr noundef %56, ptr noundef %57, i32 noundef %61, i32 noundef %62, i32 noundef %63)
  br label %65

64:                                               ; preds = %35
  br label %65

65:                                               ; preds = %64, %55, %45
  call void @_Z14__cudaCheckMsgPKcS0_i(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 42)
  br label %104

66:                                               ; preds = %32, %11
  %67 = load i64, ptr %21, align 8, !tbaa !11
  %68 = sub i64 %67, 100
  store i64 %68, ptr %21, align 8, !tbaa !11
  %69 = load ptr, ptr %15, align 8, !tbaa !5
  %70 = load ptr, ptr %16, align 8, !tbaa !5
  %71 = load ptr, ptr %14, align 8, !tbaa !5
  %72 = load i32, ptr %18, align 4, !tbaa !9
  %73 = load i32, ptr %19, align 4, !tbaa !9
  %74 = load i32, ptr %18, align 4, !tbaa !9
  %75 = load i32, ptr %18, align 4, !tbaa !9
  call void @_ZN12cudaCompress4util13dwtIntForwardEPsS1_PKsiiiiiiiP11CUstream_st(ptr noundef %69, ptr noundef %70, ptr noundef %71, i32 noundef %72, i32 noundef %73, i32 noundef 1, i32 noundef %74, i32 noundef 0, i32 noundef %75, i32 noundef 0, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #5
  store i32 1, ptr %23, align 4, !tbaa !9
  br label %76

76:                                               ; preds = %100, %66
  %77 = load i32, ptr %23, align 4, !tbaa !9
  %78 = sext i32 %77 to i64
  %79 = load i64, ptr %21, align 8, !tbaa !11
  %80 = icmp ult i64 %78, %79
  br i1 %80, label %82, label %81

81:                                               ; preds = %76
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #5
  br label %103

82:                                               ; preds = %76
  %83 = load ptr, ptr %15, align 8, !tbaa !5
  %84 = load ptr, ptr %16, align 8, !tbaa !5
  %85 = load ptr, ptr %15, align 8, !tbaa !5
  %86 = load i32, ptr %18, align 4, !tbaa !9
  %87 = sitofp i32 %86 to double
  %88 = load i32, ptr %23, align 4, !tbaa !9
  %89 = call noundef double @_ZSt3powIdiEN9__gnu_cxx9__promoteIDTplcvNS1_IT_Xsr3std12__is_integerIS2_EE7__valueEE6__typeELi0EcvNS1_IT0_Xsr3std12__is_integerIS5_EE7__valueEE6__typeELi0EEXsr3std12__is_integerIS8_EE7__valueEE6__typeES2_S5_(double noundef 2.000000e+00, i32 noundef %88)
  %90 = fdiv double %87, %89
  %91 = fptosi double %90 to i32
  %92 = load i32, ptr %19, align 4, !tbaa !9
  %93 = sitofp i32 %92 to double
  %94 = load i32, ptr %23, align 4, !tbaa !9
  %95 = call noundef double @_ZSt3powIdiEN9__gnu_cxx9__promoteIDTplcvNS1_IT_Xsr3std12__is_integerIS2_EE7__valueEE6__typeELi0EcvNS1_IT0_Xsr3std12__is_integerIS5_EE7__valueEE6__typeELi0EEXsr3std12__is_integerIS8_EE7__valueEE6__typeES2_S5_(double noundef 2.000000e+00, i32 noundef %94)
  %96 = fdiv double %93, %95
  %97 = fptosi double %96 to i32
  %98 = load i32, ptr %18, align 4, !tbaa !9
  %99 = load i32, ptr %18, align 4, !tbaa !9
  call void @_ZN12cudaCompress4util13dwtIntForwardEPsS1_PKsiiiiiiiP11CUstream_st(ptr noundef %83, ptr noundef %84, ptr noundef %85, i32 noundef %91, i32 noundef %97, i32 noundef 1, i32 noundef %98, i32 noundef 0, i32 noundef %99, i32 noundef 0, ptr noundef null)
  br label %100

100:                                              ; preds = %82
  %101 = load i32, ptr %23, align 4, !tbaa !9
  %102 = add nsw i32 %101, 1
  store i32 %102, ptr %23, align 4, !tbaa !9
  br label %76, !llvm.loop !13

103:                                              ; preds = %81
  br label %104

104:                                              ; preds = %103, %65
  %105 = load ptr, ptr %17, align 8, !tbaa !5
  %106 = load ptr, ptr %15, align 8, !tbaa !5
  %107 = load i32, ptr %18, align 4, !tbaa !9
  %108 = load i32, ptr %19, align 4, !tbaa !9
  call void @_ZN12cudaCompress4util9symbolizeEPtPKsjjjjj(ptr noundef %105, ptr noundef %106, i32 noundef %107, i32 noundef %108, i32 noundef 1, i32 noundef 0, i32 noundef 0)
  call void @llvm.lifetime.start.p0(i64 48, ptr %24) #5
  %109 = load ptr, ptr %13, align 8, !tbaa !5
  call void @_ZN12cudaCompress9BitStreamC2EPSt6vectorIjSaIjEE(ptr noundef nonnull align 8 dereferenceable(41) %24, ptr noundef %109)
  %110 = load ptr, ptr %12, align 8, !tbaa !5
  %111 = load i32, ptr %18, align 4, !tbaa !9
  %112 = load i32, ptr %19, align 4, !tbaa !9
  %113 = mul nsw i32 %111, %112
  %114 = invoke noundef zeroext i1 @_ZN12cudaCompress12encodeRLHuffEPNS_8InstanceERNS_9BitStreamEPKPKtjj(ptr noundef %110, ptr noundef nonnull align 8 dereferenceable(41) %24, ptr noundef %17, i32 noundef 1, i32 noundef %113)
          to label %115 unwind label %116

115:                                              ; preds = %104
  call void @_ZN12cudaCompress9BitStreamD2Ev(ptr noundef nonnull align 8 dereferenceable(41) %24) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr %24) #5
  ret void

116:                                              ; preds = %104
  %117 = landingpad { ptr, i32 }
          cleanup
  %118 = extractvalue { ptr, i32 } %117, 0
  store ptr %118, ptr %25, align 8
  %119 = extractvalue { ptr, i32 } %117, 1
  store i32 %119, ptr %26, align 4
  call void @_ZN12cudaCompress9BitStreamD2Ev(ptr noundef nonnull align 8 dereferenceable(41) %24) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr %24) #5
  br label %120

120:                                              ; preds = %116
  %121 = load ptr, ptr %25, align 8
  %122 = load i32, ptr %26, align 4
  %123 = insertvalue { ptr, i32 } poison, ptr %121, 0
  %124 = insertvalue { ptr, i32 } %123, i32 %122, 1
  resume { ptr, i32 } %124
}

declare i32 @cudaMemcpy(ptr noundef, ptr noundef, i64 noundef, i32 noundef) #2

declare void @_ZN12cudaCompress4util16predictor7_tilesEPKsPsiiii(ptr noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) #2

declare void @_ZN12cudaCompress4util18predictorMed_tilesEPKsPsiii(ptr noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef) #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_Z14__cudaCheckMsgPKcS0_i(ptr noundef, ptr noundef, i32 noundef) #3

declare void @_ZN12cudaCompress4util13dwtIntForwardEPsS1_PKsiiiiiiiP11CUstream_st(ptr noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef) #2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt3powIdiEN9__gnu_cxx9__promoteIDTplcvNS1_IT_Xsr3std12__is_integerIS2_EE7__valueEE6__typeELi0EcvNS1_IT0_Xsr3std12__is_integerIS5_EE7__valueEE6__typeELi0EEXsr3std12__is_integerIS8_EE7__valueEE6__typeES2_S5_(double noundef, i32 noundef) #0

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

declare void @_ZN12cudaCompress4util9symbolizeEPtPKsjjjjj(ptr noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN12cudaCompress9BitStreamC2EPSt6vectorIjSaIjEE(ptr noundef nonnull align 8 dereferenceable(41), ptr noundef) unnamed_addr #3 align 2

declare noundef zeroext i1 @_ZN12cudaCompress12encodeRLHuffEPNS_8InstanceERNS_9BitStreamEPKPKtjj(ptr noundef, ptr noundef nonnull align 8 dereferenceable(41), ptr noundef, i32 noundef, i32 noundef) #2

declare i32 @__gxx_personality_v0(...)

attributes #0 = { inlinehint mustprogress 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 uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}


; 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"

%"class.cudaCompress::BitStream" = type <{ %"class.cudaCompress::BitStreamReadOnly.base", [4 x i8], ptr, i8, [7 x i8] }>
%"class.cudaCompress::BitStreamReadOnly.base" = type <{ ptr, ptr, i32, i32, i32 }>

@.str = external hidden unnamed_addr constant [17 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [107 x i8], align 1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN12cudaCompress9BitStreamD2Ev(ptr noundef nonnull align 8 dereferenceable(41)) unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN12cudaCompress15compressImageLLEPNS_8InstanceERSt6vectorIjSaIjEEPsS6_S6_Ptiiimi(ptr noundef %0, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5, i32 noundef %6, i32 noundef %7, i32 noundef %8, i64 noundef %9, i32 noundef %10) local_unnamed_addr #1 personality ptr @__gxx_personality_v0 {
  %12 = alloca ptr, align 8
  %13 = alloca %"class.cudaCompress::BitStream", align 8
  store ptr %5, ptr %12, align 8, !tbaa !5
  %14 = mul nsw i32 %8, %7
  %15 = add i64 %9, -1
  %or.cond = icmp ult i64 %15, 99
  br i1 %or.cond, label %16, label %26

16:                                               ; preds = %11
  %17 = mul nsw i32 %14, %6
  %18 = sext i32 %17 to i64
  %19 = shl nsw i64 %18, 1
  %20 = tail call i32 @cudaMemcpy(ptr noundef %3, ptr noundef %2, i64 noundef %19, i32 noundef 3)
  switch i64 %9, label %25 [
    i64 1, label %21
    i64 2, label %21
    i64 7, label %21
    i64 9, label %23
  ]

21:                                               ; preds = %16, %16, %16
  %22 = shl i32 %6, 1
  tail call void @_ZN12cudaCompress4util16predictor7_tilesEPKsPsiiii(ptr noundef %2, ptr noundef %3, i32 noundef %22, i32 noundef %6, i32 noundef %14, i32 noundef %10)
  br label %25

23:                                               ; preds = %16
  %24 = shl i32 %6, 1
  tail call void @_ZN12cudaCompress4util18predictorMed_tilesEPKsPsiii(ptr noundef %2, ptr noundef %3, i32 noundef %24, i32 noundef %6, i32 noundef %14)
  br label %25

25:                                               ; preds = %16, %23, %21
  tail call void @_Z14__cudaCheckMsgPKcS0_i(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 42)
  br label %.loopexit

26:                                               ; preds = %11
  %27 = add i64 %9, -100
  tail call void @_ZN12cudaCompress4util13dwtIntForwardEPsS1_PKsiiiiiiiP11CUstream_st(ptr noundef %3, ptr noundef %4, ptr noundef %2, i32 noundef %6, i32 noundef %14, i32 noundef 1, i32 noundef %6, i32 noundef 0, i32 noundef %6, i32 noundef 0, ptr noundef null)
  %28 = icmp ugt i64 %27, 1
  br i1 %28, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %26
  %29 = sitofp i32 %6 to double
  %30 = sitofp i32 %14 to double
  br label %31

31:                                               ; preds = %.lr.ph, %31
  %indvars.iv = phi i64 [ 1, %.lr.ph ], [ %indvars.iv.next, %31 ]
  %32 = trunc nuw nsw i64 %indvars.iv to i32
  %33 = tail call noundef double @_ZSt3powIdiEN9__gnu_cxx9__promoteIDTplcvNS1_IT_Xsr3std12__is_integerIS2_EE7__valueEE6__typeELi0EcvNS1_IT0_Xsr3std12__is_integerIS5_EE7__valueEE6__typeELi0EEXsr3std12__is_integerIS8_EE7__valueEE6__typeES2_S5_(double noundef 2.000000e+00, i32 noundef %32)
  %34 = fdiv double %29, %33
  %35 = fptosi double %34 to i32
  %36 = tail call noundef double @_ZSt3powIdiEN9__gnu_cxx9__promoteIDTplcvNS1_IT_Xsr3std12__is_integerIS2_EE7__valueEE6__typeELi0EcvNS1_IT0_Xsr3std12__is_integerIS5_EE7__valueEE6__typeELi0EEXsr3std12__is_integerIS8_EE7__valueEE6__typeES2_S5_(double noundef 2.000000e+00, i32 noundef %32)
  %37 = fdiv double %30, %36
  %38 = fptosi double %37 to i32
  tail call void @_ZN12cudaCompress4util13dwtIntForwardEPsS1_PKsiiiiiiiP11CUstream_st(ptr noundef %3, ptr noundef %4, ptr noundef %3, i32 noundef %35, i32 noundef %38, i32 noundef 1, i32 noundef %6, i32 noundef 0, i32 noundef %6, i32 noundef 0, ptr noundef null)
  %indvars.iv.next = add nuw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %27
  br i1 %exitcond.not, label %.loopexit, label %31, !llvm.loop !9

.loopexit:                                        ; preds = %31, %26, %25
  tail call void @_ZN12cudaCompress4util9symbolizeEPtPKsjjjjj(ptr noundef %5, ptr noundef %3, i32 noundef %6, i32 noundef %14, i32 noundef 1, i32 noundef 0, i32 noundef 0)
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %13) #5
  call void @_ZN12cudaCompress9BitStreamC2EPSt6vectorIjSaIjEE(ptr noundef nonnull align 8 dereferenceable(41) %13, ptr noundef nonnull %1)
  %39 = mul nsw i32 %14, %6
  %40 = invoke noundef zeroext i1 @_ZN12cudaCompress12encodeRLHuffEPNS_8InstanceERNS_9BitStreamEPKPKtjj(ptr noundef %0, ptr noundef nonnull align 8 dereferenceable(41) %13, ptr noundef nonnull %12, i32 noundef 1, i32 noundef %39)
          to label %41 unwind label %42

41:                                               ; preds = %.loopexit
  call void @_ZN12cudaCompress9BitStreamD2Ev(ptr noundef nonnull align 8 dereferenceable(41) %13) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %13) #5
  ret void

42:                                               ; preds = %.loopexit
  %43 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN12cudaCompress9BitStreamD2Ev(ptr noundef nonnull align 8 dereferenceable(41) %13) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %13) #5
  resume { ptr, i32 } %43
}

declare i32 @cudaMemcpy(ptr noundef, ptr noundef, i64 noundef, i32 noundef) local_unnamed_addr #2

declare void @_ZN12cudaCompress4util16predictor7_tilesEPKsPsiiii(ptr noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

declare void @_ZN12cudaCompress4util18predictorMed_tilesEPKsPsiii(ptr noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_Z14__cudaCheckMsgPKcS0_i(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #3

declare void @_ZN12cudaCompress4util13dwtIntForwardEPsS1_PKsiiiiiiiP11CUstream_st(ptr noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt3powIdiEN9__gnu_cxx9__promoteIDTplcvNS1_IT_Xsr3std12__is_integerIS2_EE7__valueEE6__typeELi0EcvNS1_IT0_Xsr3std12__is_integerIS5_EE7__valueEE6__typeELi0EEXsr3std12__is_integerIS8_EE7__valueEE6__typeES2_S5_(double noundef, i32 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) #4

declare void @_ZN12cudaCompress4util9symbolizeEPtPKsjjjjj(ptr noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN12cudaCompress9BitStreamC2EPSt6vectorIjSaIjEE(ptr noundef nonnull align 8 dereferenceable(41), ptr noundef) unnamed_addr #3 align 2

declare noundef zeroext i1 @_ZN12cudaCompress12encodeRLHuffEPNS_8InstanceERNS_9BitStreamEPKPKtjj(ptr noundef, ptr noundef nonnull align 8 dereferenceable(41), ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

declare i32 @__gxx_personality_v0(...)

attributes #0 = { inlinehint mustprogress 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 uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}


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