; 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::BitStreamReadOnly" = type <{ ptr, ptr, i32, i32, i32, [4 x i8] }>

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

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

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

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

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN12cudaCompress17decompressImageLLEPNS_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) #4 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 %"class.cudaCompress::BitStreamReadOnly", align 8
  %24 = alloca ptr, align 8
  %25 = alloca i32, align 4
  %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
  call void @llvm.lifetime.start.p0(i64 32, ptr %23) #6
  %30 = load ptr, ptr %13, align 8, !tbaa !5
  %31 = call noundef ptr @_ZNSt6vectorIjSaIjEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %30) #6
  %32 = load ptr, ptr %13, align 8, !tbaa !5
  %33 = call noundef i64 @_ZNKSt6vectorIjSaIjEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %32) #6
  %34 = mul i64 %33, 4
  %35 = mul i64 %34, 8
  %36 = trunc i64 %35 to i32
  call void @_ZN12cudaCompress17BitStreamReadOnlyC2EPKjj(ptr noundef nonnull align 8 dereferenceable(28) %23, ptr noundef %31, i32 noundef %36)
  %37 = load ptr, ptr %12, 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 = invoke noundef zeroext i1 @_ZN12cudaCompress12decodeRLHuffEPNS_8InstanceERNS_17BitStreamReadOnlyEPPtjj(ptr noundef %37, ptr noundef nonnull align 8 dereferenceable(28) %23, ptr noundef %17, i32 noundef 1, i32 noundef %40)
          to label %42 unwind label %64

42:                                               ; preds = %11
  %43 = load ptr, ptr %15, align 8, !tbaa !5
  %44 = load ptr, ptr %17, align 8, !tbaa !5
  %45 = load i32, ptr %18, align 4, !tbaa !9
  %46 = load i32, ptr %19, align 4, !tbaa !9
  invoke void @_ZN12cudaCompress4util11unsymbolizeEPsPKtjjjjj(ptr noundef %43, ptr noundef %44, i32 noundef %45, i32 noundef %46, i32 noundef 1, i32 noundef 0, i32 noundef 0)
          to label %47 unwind label %64

47:                                               ; preds = %42
  %48 = load i64, ptr %21, align 8, !tbaa !11
  %49 = icmp ugt i64 %48, 0
  br i1 %49, label %50, label %92

50:                                               ; preds = %47
  %51 = load i64, ptr %21, align 8, !tbaa !11
  %52 = icmp ult i64 %51, 100
  br i1 %52, label %53, label %92

53:                                               ; preds = %50
  %54 = load ptr, ptr %14, align 8, !tbaa !5
  %55 = load ptr, ptr %15, align 8, !tbaa !5
  %56 = load i32, ptr %18, align 4, !tbaa !9
  %57 = load i32, ptr %19, align 4, !tbaa !9
  %58 = mul nsw i32 %56, %57
  %59 = sext i32 %58 to i64
  %60 = mul i64 %59, 2
  %61 = invoke i32 @cudaMemcpy(ptr noundef %54, ptr noundef %55, i64 noundef %60, i32 noundef 3)
          to label %62 unwind label %64

62:                                               ; preds = %53
  %63 = load i64, ptr %21, align 8, !tbaa !11
  switch i64 %63, label %89 [
    i64 1, label %68
    i64 2, label %68
    i64 7, label %68
    i64 9, label %79
  ]

64:                                               ; preds = %130, %90, %79, %68, %53, %42, %11
  %65 = landingpad { ptr, i32 }
          cleanup
  %66 = extractvalue { ptr, i32 } %65, 0
  store ptr %66, ptr %24, align 8
  %67 = extractvalue { ptr, i32 } %65, 1
  store i32 %67, ptr %25, align 4
  br label %140

68:                                               ; preds = %62, %62, %62
  %69 = load ptr, ptr %15, align 8, !tbaa !5
  %70 = load ptr, ptr %14, align 8, !tbaa !5
  %71 = load i32, ptr %18, align 4, !tbaa !9
  %72 = sext i32 %71 to i64
  %73 = mul i64 %72, 2
  %74 = trunc i64 %73 to i32
  %75 = load i32, ptr %18, align 4, !tbaa !9
  %76 = load i32, ptr %19, align 4, !tbaa !9
  %77 = load i32, ptr %22, align 4, !tbaa !9
  invoke void @_ZN12cudaCompress4util18unPredictor7_tilesEPKsPsiiii(ptr noundef %69, ptr noundef %70, i32 noundef %74, i32 noundef %75, i32 noundef %76, i32 noundef %77)
          to label %78 unwind label %64

78:                                               ; preds = %68
  br label %90

79:                                               ; preds = %62
  %80 = load ptr, ptr %15, align 8, !tbaa !5
  %81 = load ptr, ptr %14, align 8, !tbaa !5
  %82 = load i32, ptr %18, align 4, !tbaa !9
  %83 = sext i32 %82 to i64
  %84 = mul i64 %83, 2
  %85 = trunc i64 %84 to i32
  %86 = load i32, ptr %18, align 4, !tbaa !9
  %87 = load i32, ptr %19, align 4, !tbaa !9
  invoke void @_ZN12cudaCompress4util20unPredictorMed_tilesEPKsPsiii(ptr noundef %80, ptr noundef %81, i32 noundef %85, i32 noundef %86, i32 noundef %87)
          to label %88 unwind label %64

88:                                               ; preds = %79
  br label %90

89:                                               ; preds = %62
  br label %90

90:                                               ; preds = %89, %88, %78
  invoke void @_Z14__cudaCheckMsgPKcS0_i(ptr noundef @.str.2, ptr noundef @.str.1, i32 noundef 109)
          to label %91 unwind label %64

91:                                               ; preds = %90
  br label %139

92:                                               ; preds = %50, %47
  %93 = load i64, ptr %21, align 8, !tbaa !11
  %94 = sub i64 %93, 100
  store i64 %94, ptr %21, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #6
  %95 = load i64, ptr %21, align 8, !tbaa !11
  %96 = sub i64 %95, 1
  %97 = trunc i64 %96 to i32
  store i32 %97, ptr %26, align 4, !tbaa !9
  br label %98

98:                                               ; preds = %123, %92
  %99 = load i32, ptr %26, align 4, !tbaa !9
  %100 = icmp sgt i32 %99, 0
  br i1 %100, label %102, label %101

101:                                              ; preds = %98
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #6
  br label %130

102:                                              ; preds = %98
  %103 = load ptr, ptr %15, align 8, !tbaa !5
  %104 = load ptr, ptr %16, align 8, !tbaa !5
  %105 = load ptr, ptr %15, align 8, !tbaa !5
  %106 = load i32, ptr %18, align 4, !tbaa !9
  %107 = sitofp i32 %106 to double
  %108 = load i32, ptr %26, align 4, !tbaa !9
  %109 = invoke 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 %108)
          to label %110 unwind label %126

110:                                              ; preds = %102
  %111 = fdiv double %107, %109
  %112 = fptosi double %111 to i32
  %113 = load i32, ptr %19, align 4, !tbaa !9
  %114 = sitofp i32 %113 to double
  %115 = load i32, ptr %26, align 4, !tbaa !9
  %116 = invoke 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 %115)
          to label %117 unwind label %126

117:                                              ; preds = %110
  %118 = fdiv double %114, %116
  %119 = fptosi double %118 to i32
  %120 = load i32, ptr %18, align 4, !tbaa !9
  %121 = load i32, ptr %18, align 4, !tbaa !9
  invoke void @_ZN12cudaCompress4util13dwtIntInverseEPsS1_PKsiiiiiiiP11CUstream_st(ptr noundef %103, ptr noundef %104, ptr noundef %105, i32 noundef %112, i32 noundef %119, i32 noundef 1, i32 noundef %120, i32 noundef 0, i32 noundef %121, i32 noundef 0, ptr noundef null)
          to label %122 unwind label %126

122:                                              ; preds = %117
  br label %123

123:                                              ; preds = %122
  %124 = load i32, ptr %26, align 4, !tbaa !9
  %125 = add nsw i32 %124, -1
  store i32 %125, ptr %26, align 4, !tbaa !9
  br label %98, !llvm.loop !13

126:                                              ; preds = %117, %110, %102
  %127 = landingpad { ptr, i32 }
          cleanup
  %128 = extractvalue { ptr, i32 } %127, 0
  store ptr %128, ptr %24, align 8
  %129 = extractvalue { ptr, i32 } %127, 1
  store i32 %129, ptr %25, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #6
  br label %140

130:                                              ; preds = %101
  %131 = load ptr, ptr %14, align 8, !tbaa !5
  %132 = load ptr, ptr %16, align 8, !tbaa !5
  %133 = load ptr, ptr %15, align 8, !tbaa !5
  %134 = load i32, ptr %18, align 4, !tbaa !9
  %135 = load i32, ptr %19, align 4, !tbaa !9
  %136 = load i32, ptr %18, align 4, !tbaa !9
  %137 = load i32, ptr %18, align 4, !tbaa !9
  invoke void @_ZN12cudaCompress4util13dwtIntInverseEPsS1_PKsiiiiiiiP11CUstream_st(ptr noundef %131, ptr noundef %132, ptr noundef %133, i32 noundef %134, i32 noundef %135, i32 noundef 1, i32 noundef %136, i32 noundef 0, i32 noundef %137, i32 noundef 0, ptr noundef null)
          to label %138 unwind label %64

138:                                              ; preds = %130
  br label %139

139:                                              ; preds = %138, %91
  call void @_ZN12cudaCompress17BitStreamReadOnlyD2Ev(ptr noundef nonnull align 8 dereferenceable(28) %23) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %23) #6
  ret void

140:                                              ; preds = %126, %64
  call void @_ZN12cudaCompress17BitStreamReadOnlyD2Ev(ptr noundef nonnull align 8 dereferenceable(28) %23) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %23) #6
  br label %141

141:                                              ; preds = %140
  %142 = load ptr, ptr %24, align 8
  %143 = load i32, ptr %25, align 4
  %144 = insertvalue { ptr, i32 } poison, ptr %142, 0
  %145 = insertvalue { ptr, i32 } %144, i32 %143, 1
  resume { ptr, i32 } %145
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNSt6vectorIjSaIjEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24)) #5 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIjSaIjEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #5 align 2

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

declare noundef zeroext i1 @_ZN12cudaCompress12decodeRLHuffEPNS_8InstanceERNS_17BitStreamReadOnlyEPPtjj(ptr noundef, ptr noundef nonnull align 8 dereferenceable(28), ptr noundef, i32 noundef, i32 noundef) #1

declare void @_ZN12cudaCompress4util11unsymbolizeEPsPKtjjjjj(ptr noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) #1

declare void @_ZN12cudaCompress4util18unPredictor7_tilesEPKsPsiiii(ptr noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) #1

declare void @_ZN12cudaCompress4util20unPredictorMed_tilesEPKsPsiii(ptr noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef) #1

declare void @_ZN12cudaCompress4util13dwtIntInverseEPsS1_PKsiiiiiiiP11CUstream_st(ptr noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef) #1

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 = { "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 = { 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 #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { 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 #6 = { 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::BitStreamReadOnly" = type <{ ptr, ptr, i32, i32, i32, [4 x i8] }>

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_Z14__cudaCheckMsgPKcS0_i(ptr noundef, ptr noundef, i32 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) #3

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN12cudaCompress17decompressImageLLEPNS_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 #4 personality ptr @__gxx_personality_v0 {
  %12 = alloca ptr, align 8
  %13 = alloca %"class.cudaCompress::BitStreamReadOnly", align 8
  store ptr %5, ptr %12, align 8, !tbaa !5
  %14 = mul nsw i32 %8, %7
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %13) #6
  %15 = tail call noundef ptr @_ZNSt6vectorIjSaIjEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #6
  %16 = tail call noundef i64 @_ZNKSt6vectorIjSaIjEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #6
  %.tr = trunc i64 %16 to i32
  %17 = shl i32 %.tr, 5
  call void @_ZN12cudaCompress17BitStreamReadOnlyC2EPKjj(ptr noundef nonnull align 8 dereferenceable(28) %13, ptr noundef %15, i32 noundef %17)
  %18 = mul nsw i32 %14, %6
  %19 = invoke noundef zeroext i1 @_ZN12cudaCompress12decodeRLHuffEPNS_8InstanceERNS_17BitStreamReadOnlyEPPtjj(ptr noundef %0, ptr noundef nonnull align 8 dereferenceable(28) %13, ptr noundef nonnull %12, i32 noundef 1, i32 noundef %18)
          to label %20 unwind label %29

20:                                               ; preds = %11
  %21 = load ptr, ptr %12, align 8, !tbaa !5
  invoke void @_ZN12cudaCompress4util11unsymbolizeEPsPKtjjjjj(ptr noundef %3, ptr noundef %21, i32 noundef %6, i32 noundef %14, i32 noundef 1, i32 noundef 0, i32 noundef 0)
          to label %22 unwind label %29

22:                                               ; preds = %20
  %23 = add i64 %9, -1
  %or.cond = icmp ult i64 %23, 99
  br i1 %or.cond, label %24, label %36

24:                                               ; preds = %22
  %25 = sext i32 %18 to i64
  %26 = shl nsw i64 %25, 1
  %27 = invoke i32 @cudaMemcpy(ptr noundef %2, ptr noundef %3, i64 noundef %26, i32 noundef 3)
          to label %28 unwind label %29

28:                                               ; preds = %24
  switch i64 %9, label %35 [
    i64 1, label %31
    i64 2, label %31
    i64 7, label %31
    i64 9, label %33
  ]

29:                                               ; preds = %._crit_edge, %35, %33, %31, %24, %20, %11
  %30 = landingpad { ptr, i32 }
          cleanup
  br label %55

31:                                               ; preds = %28, %28, %28
  %32 = shl i32 %6, 1
  invoke void @_ZN12cudaCompress4util18unPredictor7_tilesEPKsPsiiii(ptr noundef %3, ptr noundef %2, i32 noundef %32, i32 noundef %6, i32 noundef %14, i32 noundef %10)
          to label %35 unwind label %29

33:                                               ; preds = %28
  %34 = shl i32 %6, 1
  invoke void @_ZN12cudaCompress4util20unPredictorMed_tilesEPKsPsiii(ptr noundef %3, ptr noundef %2, i32 noundef %34, i32 noundef %6, i32 noundef %14)
          to label %35 unwind label %29

35:                                               ; preds = %28, %33, %31
  invoke void @_Z14__cudaCheckMsgPKcS0_i(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.1, i32 noundef 109)
          to label %54 unwind label %29

36:                                               ; preds = %22
  %37 = trunc i64 %9 to i32
  %38 = add i32 %37, -101
  %39 = icmp sgt i32 %38, 0
  br i1 %39, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %36
  %40 = sitofp i32 %6 to double
  %41 = sitofp i32 %14 to double
  br label %42

._crit_edge:                                      ; preds = %49, %36
  invoke void @_ZN12cudaCompress4util13dwtIntInverseEPsS1_PKsiiiiiiiP11CUstream_st(ptr noundef %2, ptr noundef %4, ptr noundef %3, i32 noundef %6, i32 noundef %14, i32 noundef 1, i32 noundef %6, i32 noundef 0, i32 noundef %6, i32 noundef 0, ptr noundef null)
          to label %54 unwind label %29

42:                                               ; preds = %.lr.ph, %49
  %.054 = phi i32 [ %38, %.lr.ph ], [ %50, %49 ]
  %43 = 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 %.054)
  %44 = fdiv double %40, %43
  %45 = fptosi double %44 to i32
  %46 = 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 %.054)
  %47 = fdiv double %41, %46
  %48 = fptosi double %47 to i32
  invoke void @_ZN12cudaCompress4util13dwtIntInverseEPsS1_PKsiiiiiiiP11CUstream_st(ptr noundef %3, ptr noundef %4, ptr noundef %3, i32 noundef %45, i32 noundef %48, i32 noundef 1, i32 noundef %6, i32 noundef 0, i32 noundef %6, i32 noundef 0, ptr noundef null)
          to label %49 unwind label %52

49:                                               ; preds = %42
  %50 = add nsw i32 %.054, -1
  %51 = icmp sgt i32 %.054, 1
  br i1 %51, label %42, label %._crit_edge, !llvm.loop !9

52:                                               ; preds = %42
  %53 = landingpad { ptr, i32 }
          cleanup
  br label %55

54:                                               ; preds = %._crit_edge, %35
  call void @_ZN12cudaCompress17BitStreamReadOnlyD2Ev(ptr noundef nonnull align 8 dereferenceable(28) %13) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %13) #6
  ret void

55:                                               ; preds = %52, %29
  %.pn = phi { ptr, i32 } [ %30, %29 ], [ %53, %52 ]
  call void @_ZN12cudaCompress17BitStreamReadOnlyD2Ev(ptr noundef nonnull align 8 dereferenceable(28) %13) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %13) #6
  resume { ptr, i32 } %.pn
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNSt6vectorIjSaIjEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #5 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIjSaIjEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #5 align 2

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

declare noundef zeroext i1 @_ZN12cudaCompress12decodeRLHuffEPNS_8InstanceERNS_17BitStreamReadOnlyEPPtjj(ptr noundef, ptr noundef nonnull align 8 dereferenceable(28), ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

declare void @_ZN12cudaCompress4util11unsymbolizeEPsPKtjjjjj(ptr noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

declare void @_ZN12cudaCompress4util18unPredictor7_tilesEPKsPsiiii(ptr noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

declare void @_ZN12cudaCompress4util20unPredictorMed_tilesEPKsPsiii(ptr noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

declare void @_ZN12cudaCompress4util13dwtIntInverseEPsS1_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 #1

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 = { "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 = { 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 #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { 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 #6 = { 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,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass