; LLVM IR from NVIDIA/DALI :: dali/operators/sequence/optical_flow/optical_flow_impl (optical_flow_impl)

; 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._NV_OF_CUDA_API_FUNCTION_LIST = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%"class.dali::optical_flow::OpticalFlowImpl" = type <{ %"class.dali::optical_flow::OpticalFlowAdapter", %"class.std::__cxx11::basic_string", i64, i64, i64, i32, i32, i32, [4 x i8], ptr, ptr, ptr, %struct._NV_OF_CUDA_API_FUNCTION_LIST, %struct._NV_OF_INIT_PARAMS, %struct._NV_OF_INIT_PARAMS, %"class.std::unique_ptr", %"class.std::unique_ptr", %"class.std::unique_ptr", %"class.std::unique_ptr", i32, [4 x i8], %"class.std::unique_ptr.6", %"class.std::vector", %"class.std::vector", %"class.std::vector", %"class.std::vector", i8, [7 x i8] }>
%"class.dali::optical_flow::OpticalFlowAdapter" = type { ptr, %"struct.dali::optical_flow::OpticalFlowParams" }
%"struct.dali::optical_flow::OpticalFlowParams" = type <{ float, i32, i32, i8, i8, [2 x i8] }>
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%struct._NV_OF_INIT_PARAMS = type { i32, i32, i32, i32, i32, i32, i32, i32, ptr, i32, i32 }
%"class.std::unique_ptr" = type { %"struct.std::__uniq_ptr_data" }
%"struct.std::__uniq_ptr_data" = type { %"class.std::__uniq_ptr_impl" }
%"class.std::__uniq_ptr_impl" = type { %"class.std::tuple" }
%"class.std::tuple" = type { %"struct.std::_Tuple_impl" }
%"struct.std::_Tuple_impl" = type { %"struct.std::_Head_base.5" }
%"struct.std::_Head_base.5" = type { ptr }
%"class.std::unique_ptr.6" = type { %"struct.std::__uniq_ptr_data.7" }
%"struct.std::__uniq_ptr_data.7" = type { %"class.std::__uniq_ptr_impl.8" }
%"class.std::__uniq_ptr_impl.8" = type { %"class.std::tuple.9" }
%"class.std::tuple.9" = type { %"struct.std::_Tuple_impl.10" }
%"struct.std::_Tuple_impl.10" = type { %"struct.std::_Tuple_impl.11", %"struct.std::_Head_base.13" }
%"struct.std::_Tuple_impl.11" = type { %"struct.std::_Head_base.12" }
%"struct.std::_Head_base.12" = type { %"class.std::function" }
%"class.std::function" = type { %"class.std::_Function_base", ptr }
%"class.std::_Function_base" = type { %"union.std::_Any_data", ptr }
%"union.std::_Any_data" = type { %"union.std::_Nocopy_types" }
%"union.std::_Nocopy_types" = type { { i64, i64 } }
%"struct.std::_Head_base.13" = type { ptr }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl_data" = type { ptr, ptr, ptr }

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4dali12optical_flow15OpticalFlowImpl13CreateBuffersEv(ptr noundef nonnull align 8 dereferenceable(489) %0) #1 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca %struct._NV_OF_CUDA_API_FUNCTION_LIST, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca %struct._NV_OF_CUDA_API_FUNCTION_LIST, align 8
  %7 = alloca %struct._NV_OF_CUDA_API_FUNCTION_LIST, align 8
  %8 = alloca %struct._NV_OF_CUDA_API_FUNCTION_LIST, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %9 = load ptr, ptr %2, align 8
  %10 = getelementptr inbounds %"class.dali::optical_flow::OpticalFlowImpl", ptr %9, i32 0, i32 15
  %11 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 144) #5
  %12 = getelementptr inbounds %"class.dali::optical_flow::OpticalFlowImpl", ptr %9, i32 0, i32 11
  %13 = getelementptr inbounds %"class.dali::optical_flow::OpticalFlowImpl", ptr %9, i32 0, i32 2
  %14 = load i64, ptr %13, align 8, !tbaa !9
  %15 = getelementptr inbounds %"class.dali::optical_flow::OpticalFlowImpl", ptr %9, i32 0, i32 3
  %16 = load i64, ptr %15, align 8, !tbaa !48
  %17 = getelementptr inbounds %"class.dali::optical_flow::OpticalFlowImpl", ptr %9, i32 0, i32 12
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %3, ptr align 8 %17, i64 96, i1 false), !tbaa.struct !49
  invoke void @_ZN4dali12optical_flow17OpticalFlowBufferC2ERP13NvOFHandle_stmm29_NV_OF_CUDA_API_FUNCTION_LIST19_NV_OF_BUFFER_USAGE20_NV_OF_BUFFER_FORMAT(ptr noundef nonnull align 8 dereferenceable(144) %11, ptr noundef nonnull align 8 dereferenceable(8) %12, i64 noundef %14, i64 noundef %16, ptr noundef byval(%struct._NV_OF_CUDA_API_FUNCTION_LIST) align 8 %3, i32 noundef 1, i32 noundef 3)
          to label %18 unwind label %71

18:                                               ; preds = %1
  call void @_ZNSt10unique_ptrIN4dali12optical_flow17OpticalFlowBufferESt14default_deleteIS2_EE5resetEPS2_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef %11) #6
  %19 = getelementptr inbounds %"class.dali::optical_flow::OpticalFlowImpl", ptr %9, i32 0, i32 16
  %20 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 144) #5
  %21 = getelementptr inbounds %"class.dali::optical_flow::OpticalFlowImpl", ptr %9, i32 0, i32 11
  %22 = getelementptr inbounds %"class.dali::optical_flow::OpticalFlowImpl", ptr %9, i32 0, i32 2
  %23 = load i64, ptr %22, align 8, !tbaa !9
  %24 = getelementptr inbounds %"class.dali::optical_flow::OpticalFlowImpl", ptr %9, i32 0, i32 3
  %25 = load i64, ptr %24, align 8, !tbaa !48
  %26 = getelementptr inbounds %"class.dali::optical_flow::OpticalFlowImpl", ptr %9, i32 0, i32 12
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %6, ptr align 8 %26, i64 96, i1 false), !tbaa.struct !49
  invoke void @_ZN4dali12optical_flow17OpticalFlowBufferC2ERP13NvOFHandle_stmm29_NV_OF_CUDA_API_FUNCTION_LIST19_NV_OF_BUFFER_USAGE20_NV_OF_BUFFER_FORMAT(ptr noundef nonnull align 8 dereferenceable(144) %20, ptr noundef nonnull align 8 dereferenceable(8) %21, i64 noundef %23, i64 noundef %25, ptr noundef byval(%struct._NV_OF_CUDA_API_FUNCTION_LIST) align 8 %6, i32 noundef 1, i32 noundef 3)
          to label %27 unwind label %75

27:                                               ; preds = %18
  call void @_ZNSt10unique_ptrIN4dali12optical_flow17OpticalFlowBufferESt14default_deleteIS2_EE5resetEPS2_(ptr noundef nonnull align 8 dereferenceable(8) %19, ptr noundef %20) #6
  %28 = getelementptr inbounds %"class.dali::optical_flow::OpticalFlowImpl", ptr %9, i32 0, i32 17
  %29 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 144) #5
  %30 = getelementptr inbounds %"class.dali::optical_flow::OpticalFlowImpl", ptr %9, i32 0, i32 11
  %31 = getelementptr inbounds %"class.dali::optical_flow::OpticalFlowImpl", ptr %9, i32 0, i32 2
  %32 = load i64, ptr %31, align 8, !tbaa !9
  %33 = getelementptr inbounds %"class.dali::optical_flow::OpticalFlowImpl", ptr %9, i32 0, i32 5
  %34 = load i32, ptr %33, align 8, !tbaa !50
  %35 = sext i32 %34 to i64
  %36 = invoke noundef i64 @_ZN4dali8div_ceilEmm(i64 noundef %32, i64 noundef %35)
          to label %37 unwind label %79

37:                                               ; preds = %27
  %38 = getelementptr inbounds %"class.dali::optical_flow::OpticalFlowImpl", ptr %9, i32 0, i32 3
  %39 = load i64, ptr %38, align 8, !tbaa !48
  %40 = getelementptr inbounds %"class.dali::optical_flow::OpticalFlowImpl", ptr %9, i32 0, i32 5
  %41 = load i32, ptr %40, align 8, !tbaa !50
  %42 = sext i32 %41 to i64
  %43 = invoke noundef i64 @_ZN4dali8div_ceilEmm(i64 noundef %39, i64 noundef %42)
          to label %44 unwind label %79

44:                                               ; preds = %37
  %45 = getelementptr inbounds %"class.dali::optical_flow::OpticalFlowImpl", ptr %9, i32 0, i32 12
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %7, ptr align 8 %45, i64 96, i1 false), !tbaa.struct !49
  invoke void @_ZN4dali12optical_flow17OpticalFlowBufferC2ERP13NvOFHandle_stmm29_NV_OF_CUDA_API_FUNCTION_LIST19_NV_OF_BUFFER_USAGE20_NV_OF_BUFFER_FORMAT(ptr noundef nonnull align 8 dereferenceable(144) %29, ptr noundef nonnull align 8 dereferenceable(8) %30, i64 noundef %36, i64 noundef %43, ptr noundef byval(%struct._NV_OF_CUDA_API_FUNCTION_LIST) align 8 %7, i32 noundef 2, i32 noundef 5)
          to label %46 unwind label %79

46:                                               ; preds = %44
  call void @_ZNSt10unique_ptrIN4dali12optical_flow17OpticalFlowBufferESt14default_deleteIS2_EE5resetEPS2_(ptr noundef nonnull align 8 dereferenceable(8) %28, ptr noundef %29) #6
  %47 = getelementptr inbounds %"class.dali::optical_flow::OpticalFlowAdapter", ptr %9, i32 0, i32 1
  %48 = getelementptr inbounds %"struct.dali::optical_flow::OpticalFlowParams", ptr %47, i32 0, i32 4
  %49 = load i8, ptr %48, align 1, !tbaa !51, !range !52, !noundef !53
  %50 = trunc i8 %49 to i1
  br i1 %50, label %51, label %87

51:                                               ; preds = %46
  %52 = getelementptr inbounds %"class.dali::optical_flow::OpticalFlowImpl", ptr %9, i32 0, i32 18
  %53 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 144) #5
  %54 = getelementptr inbounds %"class.dali::optical_flow::OpticalFlowImpl", ptr %9, i32 0, i32 11
  %55 = getelementptr inbounds %"class.dali::optical_flow::OpticalFlowImpl", ptr %9, i32 0, i32 2
  %56 = load i64, ptr %55, align 8, !tbaa !9
  %57 = getelementptr inbounds %"class.dali::optical_flow::OpticalFlowImpl", ptr %9, i32 0, i32 6
  %58 = load i32, ptr %57, align 4, !tbaa !54
  %59 = sext i32 %58 to i64
  %60 = invoke noundef i64 @_ZN4dali8div_ceilEmm(i64 noundef %56, i64 noundef %59)
          to label %61 unwind label %83

61:                                               ; preds = %51
  %62 = getelementptr inbounds %"class.dali::optical_flow::OpticalFlowImpl", ptr %9, i32 0, i32 3
  %63 = load i64, ptr %62, align 8, !tbaa !48
  %64 = getelementptr inbounds %"class.dali::optical_flow::OpticalFlowImpl", ptr %9, i32 0, i32 6
  %65 = load i32, ptr %64, align 4, !tbaa !54
  %66 = sext i32 %65 to i64
  %67 = invoke noundef i64 @_ZN4dali8div_ceilEmm(i64 noundef %63, i64 noundef %66)
          to label %68 unwind label %83

68:                                               ; preds = %61
  %69 = getelementptr inbounds %"class.dali::optical_flow::OpticalFlowImpl", ptr %9, i32 0, i32 12
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %8, ptr align 8 %69, i64 96, i1 false), !tbaa.struct !49
  invoke void @_ZN4dali12optical_flow17OpticalFlowBufferC2ERP13NvOFHandle_stmm29_NV_OF_CUDA_API_FUNCTION_LIST19_NV_OF_BUFFER_USAGE20_NV_OF_BUFFER_FORMAT(ptr noundef nonnull align 8 dereferenceable(144) %53, ptr noundef nonnull align 8 dereferenceable(8) %54, i64 noundef %60, i64 noundef %67, ptr noundef byval(%struct._NV_OF_CUDA_API_FUNCTION_LIST) align 8 %8, i32 noundef 3, i32 noundef 5)
          to label %70 unwind label %83

70:                                               ; preds = %68
  call void @_ZNSt10unique_ptrIN4dali12optical_flow17OpticalFlowBufferESt14default_deleteIS2_EE5resetEPS2_(ptr noundef nonnull align 8 dereferenceable(8) %52, ptr noundef %53) #6
  br label %87

71:                                               ; preds = %1
  %72 = landingpad { ptr, i32 }
          cleanup
  %73 = extractvalue { ptr, i32 } %72, 0
  store ptr %73, ptr %4, align 8
  %74 = extractvalue { ptr, i32 } %72, 1
  store i32 %74, ptr %5, align 4
  call void @_ZdlPvm(ptr noundef %11, i64 noundef 144) #7
  br label %88

75:                                               ; preds = %18
  %76 = landingpad { ptr, i32 }
          cleanup
  %77 = extractvalue { ptr, i32 } %76, 0
  store ptr %77, ptr %4, align 8
  %78 = extractvalue { ptr, i32 } %76, 1
  store i32 %78, ptr %5, align 4
  call void @_ZdlPvm(ptr noundef %20, i64 noundef 144) #7
  br label %88

79:                                               ; preds = %44, %37, %27
  %80 = landingpad { ptr, i32 }
          cleanup
  %81 = extractvalue { ptr, i32 } %80, 0
  store ptr %81, ptr %4, align 8
  %82 = extractvalue { ptr, i32 } %80, 1
  store i32 %82, ptr %5, align 4
  call void @_ZdlPvm(ptr noundef %29, i64 noundef 144) #7
  br label %88

83:                                               ; preds = %68, %61, %51
  %84 = landingpad { ptr, i32 }
          cleanup
  %85 = extractvalue { ptr, i32 } %84, 0
  store ptr %85, ptr %4, align 8
  %86 = extractvalue { ptr, i32 } %84, 1
  store i32 %86, ptr %5, align 4
  call void @_ZdlPvm(ptr noundef %53, i64 noundef 144) #7
  br label %88

87:                                               ; preds = %70, %46
  ret void

88:                                               ; preds = %83, %79, %75, %71
  %89 = load ptr, ptr %4, align 8
  %90 = load i32, ptr %5, align 4
  %91 = insertvalue { ptr, i32 } poison, ptr %89, 0
  %92 = insertvalue { ptr, i32 } %91, i32 %90, 1
  resume { ptr, i32 } %92
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt10unique_ptrIN4dali12optical_flow17OpticalFlowBufferESt14default_deleteIS2_EE5resetEPS2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #2 align 2

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4dali12optical_flow17OpticalFlowBufferC2ERP13NvOFHandle_stmm29_NV_OF_CUDA_API_FUNCTION_LIST19_NV_OF_BUFFER_USAGE20_NV_OF_BUFFER_FORMAT(ptr noundef nonnull align 8 dereferenceable(144), ptr noundef nonnull align 8 dereferenceable(8), i64 noundef, i64 noundef, ptr noundef byval(%struct._NV_OF_CUDA_API_FUNCTION_LIST) align 8, i32 noundef, i32 noundef) unnamed_addr #1 align 2

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN4dali8div_ceilEmm(i64 noundef, i64 noundef) #2

attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #3 = { nobuiltin allocsize(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 = { nobuiltin nounwind "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 = { builtin allocsize(0) }
attributes #6 = { nounwind }
attributes #7 = { builtin 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, !18, i64 56}
!10 = !{!"_ZTSN4dali12optical_flow15OpticalFlowImplE", !11, i64 0, !16, i64 24, !18, i64 56, !18, i64 64, !18, i64 72, !14, i64 80, !14, i64 84, !14, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !19, i64 120, !20, i64 216, !20, i64 264, !27, i64 312, !27, i64 320, !27, i64 328, !27, i64 336, !33, i64 344, !34, i64 352, !44, i64 392, !44, i64 416, !44, i64 440, !44, i64 464, !15, i64 488}
!11 = !{!"_ZTSN4dali12optical_flow18OpticalFlowAdapterINS_10ComputeGPUEEE", !12, i64 8}
!12 = !{!"_ZTSN4dali12optical_flow17OpticalFlowParamsE", !13, i64 0, !14, i64 4, !14, i64 8, !15, i64 12, !15, i64 13}
!13 = !{!"float", !7, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = !{!"bool", !7, i64 0}
!16 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !17, i64 0, !18, i64 8, !7, i64 16}
!17 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!18 = !{!"long", !7, i64 0}
!19 = !{!"_ZTS29_NV_OF_CUDA_API_FUNCTION_LIST", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88}
!20 = !{!"_ZTS18_NV_OF_INIT_PARAMS", !14, i64 0, !14, i64 4, !21, i64 8, !22, i64 12, !23, i64 16, !24, i64 20, !25, i64 24, !25, i64 28, !6, i64 32, !26, i64 40, !25, i64 44}
!21 = !{!"_ZTS30_NV_OF_OUTPUT_VECTOR_GRID_SIZE", !7, i64 0}
!22 = !{!"_ZTS28_NV_OF_HINT_VECTOR_GRID_SIZE", !7, i64 0}
!23 = !{!"_ZTS11_NV_OF_MODE", !7, i64 0}
!24 = !{!"_ZTS17_NV_OF_PERF_LEVEL", !7, i64 0}
!25 = !{!"_ZTS11_NV_OF_BOOL", !7, i64 0}
!26 = !{!"_ZTS29_NV_OF_STEREO_DISPARITY_RANGE", !7, i64 0}
!27 = !{!"_ZTSSt10unique_ptrIN4dali12optical_flow17OpticalFlowBufferESt14default_deleteIS2_EE", !28, i64 0}
!28 = !{!"_ZTSSt15__uniq_ptr_dataIN4dali12optical_flow17OpticalFlowBufferESt14default_deleteIS2_ELb1ELb1EE", !29, i64 0}
!29 = !{!"_ZTSSt15__uniq_ptr_implIN4dali12optical_flow17OpticalFlowBufferESt14default_deleteIS2_EE", !30, i64 0}
!30 = !{!"_ZTSSt5tupleIJPN4dali12optical_flow17OpticalFlowBufferESt14default_deleteIS2_EEE", !31, i64 0}
!31 = !{!"_ZTSSt11_Tuple_implILm0EJPN4dali12optical_flow17OpticalFlowBufferESt14default_deleteIS2_EEE", !32, i64 0}
!32 = !{!"_ZTSSt10_Head_baseILm0EPN4dali12optical_flow17OpticalFlowBufferELb0EE", !6, i64 0}
!33 = !{!"_ZTSN4dali13DALIImageTypeE", !7, i64 0}
!34 = !{!"_ZTSSt10unique_ptrIvSt8functionIFvPvEEE", !35, i64 0}
!35 = !{!"_ZTSSt15__uniq_ptr_dataIvSt8functionIFvPvEELb1ELb1EE", !36, i64 0}
!36 = !{!"_ZTSSt15__uniq_ptr_implIvSt8functionIFvPvEEE", !37, i64 0}
!37 = !{!"_ZTSSt5tupleIJPvSt8functionIFvS0_EEEE", !38, i64 0}
!38 = !{!"_ZTSSt11_Tuple_implILm0EJPvSt8functionIFvS0_EEEE", !39, i64 0, !43, i64 32}
!39 = !{!"_ZTSSt11_Tuple_implILm1EJSt8functionIFvPvEEEE", !40, i64 0}
!40 = !{!"_ZTSSt10_Head_baseILm1ESt8functionIFvPvEELb0EE", !41, i64 0}
!41 = !{!"_ZTSSt8functionIFvPvEE", !42, i64 0, !6, i64 24}
!42 = !{!"_ZTSSt14_Function_base", !7, i64 0, !6, i64 16}
!43 = !{!"_ZTSSt10_Head_baseILm0EPvLb0EE", !6, i64 0}
!44 = !{!"_ZTSSt6vectorIjSaIjEE", !45, i64 0}
!45 = !{!"_ZTSSt12_Vector_baseIjSaIjEE", !46, i64 0}
!46 = !{!"_ZTSNSt12_Vector_baseIjSaIjEE12_Vector_implE", !47, i64 0}
!47 = !{!"_ZTSNSt12_Vector_baseIjSaIjEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!48 = !{!10, !18, i64 64}
!49 = !{i64 0, i64 8, !5, i64 8, i64 8, !5, i64 16, i64 8, !5, i64 24, i64 8, !5, i64 32, i64 8, !5, i64 40, i64 8, !5, i64 48, i64 8, !5, i64 56, i64 8, !5, i64 64, i64 8, !5, i64 72, i64 8, !5, i64 80, i64 8, !5, i64 88, i64 8, !5}
!50 = !{!10, !14, i64 80}
!51 = !{!11, !15, i64 21}
!52 = !{i8 0, i8 2}
!53 = !{}
!54 = !{!10, !14, i64 84}


; 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._NV_OF_CUDA_API_FUNCTION_LIST = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4dali12optical_flow15OpticalFlowImpl13CreateBuffersEv(ptr noundef nonnull align 8 dereferenceable(489) %0) local_unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %2 = tail call noalias noundef nonnull dereferenceable(144) ptr @_Znwm(i64 noundef 144) #4
  %3 = getelementptr inbounds i8, ptr %0, i64 112
  %4 = getelementptr inbounds i8, ptr %0, i64 56
  %5 = load i64, ptr %4, align 8, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %0, i64 64
  %7 = load i64, ptr %6, align 8, !tbaa !47
  %8 = getelementptr inbounds i8, ptr %0, i64 120
  invoke void @_ZN4dali12optical_flow17OpticalFlowBufferC2ERP13NvOFHandle_stmm29_NV_OF_CUDA_API_FUNCTION_LIST19_NV_OF_BUFFER_USAGE20_NV_OF_BUFFER_FORMAT(ptr noundef nonnull align 8 dereferenceable(144) %2, ptr noundef nonnull align 8 dereferenceable(8) %3, i64 noundef %5, i64 noundef %7, ptr noundef nonnull byval(%struct._NV_OF_CUDA_API_FUNCTION_LIST) align 8 %8, i32 noundef 1, i32 noundef 3)
          to label %9 unwind label %44

9:                                                ; preds = %1
  %10 = getelementptr inbounds i8, ptr %0, i64 312
  tail call void @_ZNSt10unique_ptrIN4dali12optical_flow17OpticalFlowBufferESt14default_deleteIS2_EE5resetEPS2_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull %2) #5
  %11 = tail call noalias noundef nonnull dereferenceable(144) ptr @_Znwm(i64 noundef 144) #4
  %12 = load i64, ptr %4, align 8, !tbaa !5
  %13 = load i64, ptr %6, align 8, !tbaa !47
  invoke void @_ZN4dali12optical_flow17OpticalFlowBufferC2ERP13NvOFHandle_stmm29_NV_OF_CUDA_API_FUNCTION_LIST19_NV_OF_BUFFER_USAGE20_NV_OF_BUFFER_FORMAT(ptr noundef nonnull align 8 dereferenceable(144) %11, ptr noundef nonnull align 8 dereferenceable(8) %3, i64 noundef %12, i64 noundef %13, ptr noundef nonnull byval(%struct._NV_OF_CUDA_API_FUNCTION_LIST) align 8 %8, i32 noundef 1, i32 noundef 3)
          to label %14 unwind label %46

14:                                               ; preds = %9
  %15 = getelementptr inbounds i8, ptr %0, i64 320
  tail call void @_ZNSt10unique_ptrIN4dali12optical_flow17OpticalFlowBufferESt14default_deleteIS2_EE5resetEPS2_(ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull %11) #5
  %16 = tail call noalias noundef nonnull dereferenceable(144) ptr @_Znwm(i64 noundef 144) #4
  %17 = load i64, ptr %4, align 8, !tbaa !5
  %18 = getelementptr inbounds i8, ptr %0, i64 80
  %19 = load i32, ptr %18, align 8, !tbaa !48
  %20 = sext i32 %19 to i64
  %21 = tail call noundef i64 @_ZN4dali8div_ceilEmm(i64 noundef %17, i64 noundef %20)
  %22 = load i64, ptr %6, align 8, !tbaa !47
  %23 = load i32, ptr %18, align 8, !tbaa !48
  %24 = sext i32 %23 to i64
  %25 = tail call noundef i64 @_ZN4dali8div_ceilEmm(i64 noundef %22, i64 noundef %24)
  invoke void @_ZN4dali12optical_flow17OpticalFlowBufferC2ERP13NvOFHandle_stmm29_NV_OF_CUDA_API_FUNCTION_LIST19_NV_OF_BUFFER_USAGE20_NV_OF_BUFFER_FORMAT(ptr noundef nonnull align 8 dereferenceable(144) %16, ptr noundef nonnull align 8 dereferenceable(8) %3, i64 noundef %21, i64 noundef %25, ptr noundef nonnull byval(%struct._NV_OF_CUDA_API_FUNCTION_LIST) align 8 %8, i32 noundef 2, i32 noundef 5)
          to label %26 unwind label %48

26:                                               ; preds = %14
  %27 = getelementptr inbounds i8, ptr %0, i64 328
  tail call void @_ZNSt10unique_ptrIN4dali12optical_flow17OpticalFlowBufferESt14default_deleteIS2_EE5resetEPS2_(ptr noundef nonnull align 8 dereferenceable(8) %27, ptr noundef nonnull %16) #5
  %28 = getelementptr inbounds i8, ptr %0, i64 21
  %29 = load i8, ptr %28, align 1, !tbaa !49, !range !50, !noundef !51
  %30 = trunc nuw i8 %29 to i1
  br i1 %30, label %31, label %52

31:                                               ; preds = %26
  %32 = tail call noalias noundef nonnull dereferenceable(144) ptr @_Znwm(i64 noundef 144) #4
  %33 = load i64, ptr %4, align 8, !tbaa !5
  %34 = getelementptr inbounds i8, ptr %0, i64 84
  %35 = load i32, ptr %34, align 4, !tbaa !52
  %36 = sext i32 %35 to i64
  %37 = tail call noundef i64 @_ZN4dali8div_ceilEmm(i64 noundef %33, i64 noundef %36)
  %38 = load i64, ptr %6, align 8, !tbaa !47
  %39 = load i32, ptr %34, align 4, !tbaa !52
  %40 = sext i32 %39 to i64
  %41 = tail call noundef i64 @_ZN4dali8div_ceilEmm(i64 noundef %38, i64 noundef %40)
  invoke void @_ZN4dali12optical_flow17OpticalFlowBufferC2ERP13NvOFHandle_stmm29_NV_OF_CUDA_API_FUNCTION_LIST19_NV_OF_BUFFER_USAGE20_NV_OF_BUFFER_FORMAT(ptr noundef nonnull align 8 dereferenceable(144) %32, ptr noundef nonnull align 8 dereferenceable(8) %3, i64 noundef %37, i64 noundef %41, ptr noundef nonnull byval(%struct._NV_OF_CUDA_API_FUNCTION_LIST) align 8 %8, i32 noundef 3, i32 noundef 5)
          to label %42 unwind label %50

42:                                               ; preds = %31
  %43 = getelementptr inbounds i8, ptr %0, i64 336
  tail call void @_ZNSt10unique_ptrIN4dali12optical_flow17OpticalFlowBufferESt14default_deleteIS2_EE5resetEPS2_(ptr noundef nonnull align 8 dereferenceable(8) %43, ptr noundef nonnull %32) #5
  br label %52

44:                                               ; preds = %1
  %45 = landingpad { ptr, i32 }
          cleanup
  br label %53

46:                                               ; preds = %9
  %47 = landingpad { ptr, i32 }
          cleanup
  br label %53

48:                                               ; preds = %14
  %49 = landingpad { ptr, i32 }
          cleanup
  br label %53

50:                                               ; preds = %31
  %51 = landingpad { ptr, i32 }
          cleanup
  br label %53

52:                                               ; preds = %42, %26
  ret void

53:                                               ; preds = %50, %48, %46, %44
  %.sink = phi ptr [ %32, %50 ], [ %16, %48 ], [ %11, %46 ], [ %2, %44 ]
  %.pn = phi { ptr, i32 } [ %51, %50 ], [ %49, %48 ], [ %47, %46 ], [ %45, %44 ]
  tail call void @_ZdlPvm(ptr noundef nonnull %.sink, i64 noundef 144) #6
  resume { ptr, i32 } %.pn
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt10unique_ptrIN4dali12optical_flow17OpticalFlowBufferESt14default_deleteIS2_EE5resetEPS2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #1 align 2

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4dali12optical_flow17OpticalFlowBufferC2ERP13NvOFHandle_stmm29_NV_OF_CUDA_API_FUNCTION_LIST19_NV_OF_BUFFER_USAGE20_NV_OF_BUFFER_FORMAT(ptr noundef nonnull align 8 dereferenceable(144), ptr noundef nonnull align 8 dereferenceable(8), i64 noundef, i64 noundef, ptr noundef byval(%struct._NV_OF_CUDA_API_FUNCTION_LIST) align 8, i32 noundef, i32 noundef) unnamed_addr #0 align 2

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN4dali8div_ceilEmm(i64 noundef, i64 noundef) local_unnamed_addr #1

attributes #0 = { 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 #1 = { 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 #2 = { nobuiltin allocsize(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 = { nobuiltin nounwind "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 = { builtin allocsize(0) }
attributes #5 = { nounwind }
attributes #6 = { builtin 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, !17, i64 56}
!6 = !{!"_ZTSN4dali12optical_flow15OpticalFlowImplE", !7, i64 0, !14, i64 24, !17, i64 56, !17, i64 64, !17, i64 72, !12, i64 80, !12, i64 84, !12, i64 88, !16, i64 96, !16, i64 104, !16, i64 112, !18, i64 120, !19, i64 216, !19, i64 264, !26, i64 312, !26, i64 320, !26, i64 328, !26, i64 336, !32, i64 344, !33, i64 352, !43, i64 392, !43, i64 416, !43, i64 440, !43, i64 464, !13, i64 488}
!7 = !{!"_ZTSN4dali12optical_flow18OpticalFlowAdapterINS_10ComputeGPUEEE", !8, i64 8}
!8 = !{!"_ZTSN4dali12optical_flow17OpticalFlowParamsE", !9, i64 0, !12, i64 4, !12, i64 8, !13, i64 12, !13, i64 13}
!9 = !{!"float", !10, i64 0}
!10 = !{!"omnipotent char", !11, i64 0}
!11 = !{!"Simple C++ TBAA"}
!12 = !{!"int", !10, i64 0}
!13 = !{!"bool", !10, i64 0}
!14 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !15, i64 0, !17, i64 8, !10, i64 16}
!15 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !16, i64 0}
!16 = !{!"any pointer", !10, i64 0}
!17 = !{!"long", !10, i64 0}
!18 = !{!"_ZTS29_NV_OF_CUDA_API_FUNCTION_LIST", !16, i64 0, !16, i64 8, !16, i64 16, !16, i64 24, !16, i64 32, !16, i64 40, !16, i64 48, !16, i64 56, !16, i64 64, !16, i64 72, !16, i64 80, !16, i64 88}
!19 = !{!"_ZTS18_NV_OF_INIT_PARAMS", !12, i64 0, !12, i64 4, !20, i64 8, !21, i64 12, !22, i64 16, !23, i64 20, !24, i64 24, !24, i64 28, !16, i64 32, !25, i64 40, !24, i64 44}
!20 = !{!"_ZTS30_NV_OF_OUTPUT_VECTOR_GRID_SIZE", !10, i64 0}
!21 = !{!"_ZTS28_NV_OF_HINT_VECTOR_GRID_SIZE", !10, i64 0}
!22 = !{!"_ZTS11_NV_OF_MODE", !10, i64 0}
!23 = !{!"_ZTS17_NV_OF_PERF_LEVEL", !10, i64 0}
!24 = !{!"_ZTS11_NV_OF_BOOL", !10, i64 0}
!25 = !{!"_ZTS29_NV_OF_STEREO_DISPARITY_RANGE", !10, i64 0}
!26 = !{!"_ZTSSt10unique_ptrIN4dali12optical_flow17OpticalFlowBufferESt14default_deleteIS2_EE", !27, i64 0}
!27 = !{!"_ZTSSt15__uniq_ptr_dataIN4dali12optical_flow17OpticalFlowBufferESt14default_deleteIS2_ELb1ELb1EE", !28, i64 0}
!28 = !{!"_ZTSSt15__uniq_ptr_implIN4dali12optical_flow17OpticalFlowBufferESt14default_deleteIS2_EE", !29, i64 0}
!29 = !{!"_ZTSSt5tupleIJPN4dali12optical_flow17OpticalFlowBufferESt14default_deleteIS2_EEE", !30, i64 0}
!30 = !{!"_ZTSSt11_Tuple_implILm0EJPN4dali12optical_flow17OpticalFlowBufferESt14default_deleteIS2_EEE", !31, i64 0}
!31 = !{!"_ZTSSt10_Head_baseILm0EPN4dali12optical_flow17OpticalFlowBufferELb0EE", !16, i64 0}
!32 = !{!"_ZTSN4dali13DALIImageTypeE", !10, i64 0}
!33 = !{!"_ZTSSt10unique_ptrIvSt8functionIFvPvEEE", !34, i64 0}
!34 = !{!"_ZTSSt15__uniq_ptr_dataIvSt8functionIFvPvEELb1ELb1EE", !35, i64 0}
!35 = !{!"_ZTSSt15__uniq_ptr_implIvSt8functionIFvPvEEE", !36, i64 0}
!36 = !{!"_ZTSSt5tupleIJPvSt8functionIFvS0_EEEE", !37, i64 0}
!37 = !{!"_ZTSSt11_Tuple_implILm0EJPvSt8functionIFvS0_EEEE", !38, i64 0, !42, i64 32}
!38 = !{!"_ZTSSt11_Tuple_implILm1EJSt8functionIFvPvEEEE", !39, i64 0}
!39 = !{!"_ZTSSt10_Head_baseILm1ESt8functionIFvPvEELb0EE", !40, i64 0}
!40 = !{!"_ZTSSt8functionIFvPvEE", !41, i64 0, !16, i64 24}
!41 = !{!"_ZTSSt14_Function_base", !10, i64 0, !16, i64 16}
!42 = !{!"_ZTSSt10_Head_baseILm0EPvLb0EE", !16, i64 0}
!43 = !{!"_ZTSSt6vectorIjSaIjEE", !44, i64 0}
!44 = !{!"_ZTSSt12_Vector_baseIjSaIjEE", !45, i64 0}
!45 = !{!"_ZTSNSt12_Vector_baseIjSaIjEE12_Vector_implE", !46, i64 0}
!46 = !{!"_ZTSNSt12_Vector_baseIjSaIjEE17_Vector_impl_dataE", !16, i64 0, !16, i64 8, !16, i64 16}
!47 = !{!6, !17, i64 64}
!48 = !{!6, !12, i64 80}
!49 = !{!7, !13, i64 21}
!50 = !{i8 0, i8 2}
!51 = !{}
!52 = !{!6, !12, i64 84}


; Effective O3 passes: CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,MemCpyOptPass,SROAPass,SimplifyCFGPass,TailCallElimPass