; LLVM IR from hipacc/hipacc :: lib/Runtime/OpenCL.ll (Z22hipaccCopyMemoryRegionRK14HipaccAccessorS1_i)

; 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.std::vector.18" = type { %"struct.std::_Vector_base.19" }
%"struct.std::_Vector_base.19" = type { %"struct.std::_Vector_base<_cl_command_queue *, std::allocator<_cl_command_queue *>>::_Vector_impl" }
%"struct.std::_Vector_base<_cl_command_queue *, std::allocator<_cl_command_queue *>>::_Vector_impl" = type { %"struct.std::_Vector_base<_cl_command_queue *, std::allocator<_cl_command_queue *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<_cl_command_queue *, std::allocator<_cl_command_queue *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"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] }
%"class.std::allocator" = type { i8 }
%class.HipaccAccessor = type { %struct.HipaccAccessorBase, %"class.std::shared_ptr" }
%struct.HipaccAccessorBase = type { i32, i32, i32, i32 }
%"class.std::shared_ptr" = type { %"class.std::__shared_ptr" }
%"class.std::__shared_ptr" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }

@.str.65 = external hidden unnamed_addr constant [80 x i8], align 1
@.str.120 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.122 = external hidden unnamed_addr constant [26 x i8], align 1

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

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(144) ptr @_ZN13HipaccContext11getInstanceEv() #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN13HipaccContext18get_command_queuesEv(ptr dead_on_unwind noalias writable sret(%"class.std::vector.18") align 8, ptr noundef nonnull align 8 dereferenceable(144)) #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_Z19__checkOpenCLErrorsiRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES6_i(i32 noundef, ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32), i32 noundef) #3

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNKSt19__shared_ptr_accessI21HipaccImageOpenCLBaseLN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1)) #1 align 2

declare i32 @clEnqueueCopyImage(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef) #4

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIP17_cl_command_queueSaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1 align 2

declare i32 @clFinish(ptr noundef) #4

; Function Attrs: mustprogress uwtable
define dso_local void @_Z22hipaccCopyMemoryRegionRK14HipaccAccessorS1_i(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull align 8 dereferenceable(32) %1, i32 noundef %2) #2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca [3 x i64], align 16
  %10 = alloca [3 x i64], align 16
  %11 = alloca [3 x i64], align 16
  %12 = alloca %"class.std::vector.18", align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca %"class.std::vector.18", align 8
  %16 = alloca %"class.std::__cxx11::basic_string", align 8
  %17 = alloca %"class.std::allocator", align 1
  %18 = alloca %"class.std::__cxx11::basic_string", align 8
  %19 = alloca %"class.std::allocator", align 1
  %20 = alloca [3 x i64], align 16
  %21 = alloca [3 x i64], align 16
  %22 = alloca [3 x i64], align 16
  %23 = alloca %"class.std::vector.18", align 8
  %24 = alloca %"class.std::vector.18", align 8
  %25 = alloca %"class.std::__cxx11::basic_string", align 8
  %26 = alloca %"class.std::allocator", align 1
  %27 = alloca %"class.std::__cxx11::basic_string", align 8
  %28 = alloca %"class.std::allocator", align 1
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store i32 %2, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store i32 0, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %29 = call noundef nonnull align 8 dereferenceable(144) ptr @_ZN13HipaccContext11getInstanceEv()
  store ptr %29, ptr %8, align 8, !tbaa !5
  %30 = load ptr, ptr %4, align 8, !tbaa !5
  %31 = getelementptr inbounds %class.HipaccAccessor, ptr %30, i32 0, i32 1
  %32 = call noundef ptr @_ZNKSt19__shared_ptr_accessI21HipaccImageOpenCLBaseLN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %31) #5
  %33 = load ptr, ptr %32, align 8, !tbaa !11
  %34 = getelementptr inbounds ptr, ptr %33, i64 9
  %35 = load ptr, ptr %34, align 8
  %36 = call noundef i32 %35(ptr noundef nonnull align 8 dereferenceable(8) %32)
  %37 = icmp sge i32 %36, 3
  br i1 %37, label %38, label %131

38:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 24, ptr %9) #5
  %39 = load ptr, ptr %5, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.HipaccAccessorBase, ptr %39, i32 0, i32 2
  %41 = load i32, ptr %40, align 8, !tbaa !13
  %42 = sext i32 %41 to i64
  store i64 %42, ptr %9, align 8, !tbaa !15
  %43 = getelementptr inbounds i64, ptr %9, i64 1
  %44 = load ptr, ptr %5, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.HipaccAccessorBase, ptr %44, i32 0, i32 3
  %46 = load i32, ptr %45, align 4, !tbaa !17
  %47 = sext i32 %46 to i64
  store i64 %47, ptr %43, align 8, !tbaa !15
  %48 = getelementptr inbounds i64, ptr %9, i64 2
  store i64 0, ptr %48, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 24, ptr %10) #5
  %49 = load ptr, ptr %4, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.HipaccAccessorBase, ptr %49, i32 0, i32 2
  %51 = load i32, ptr %50, align 8, !tbaa !13
  %52 = sext i32 %51 to i64
  store i64 %52, ptr %10, align 8, !tbaa !15
  %53 = getelementptr inbounds i64, ptr %10, i64 1
  %54 = load ptr, ptr %4, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.HipaccAccessorBase, ptr %54, i32 0, i32 3
  %56 = load i32, ptr %55, align 4, !tbaa !17
  %57 = sext i32 %56 to i64
  store i64 %57, ptr %53, align 8, !tbaa !15
  %58 = getelementptr inbounds i64, ptr %10, i64 2
  store i64 0, ptr %58, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 24, ptr %11) #5
  %59 = load ptr, ptr %5, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.HipaccAccessorBase, ptr %59, i32 0, i32 0
  %61 = load i32, ptr %60, align 8, !tbaa !18
  %62 = sext i32 %61 to i64
  store i64 %62, ptr %11, align 8, !tbaa !15
  %63 = getelementptr inbounds i64, ptr %11, i64 1
  %64 = load ptr, ptr %5, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.HipaccAccessorBase, ptr %64, i32 0, i32 1
  %66 = load i32, ptr %65, align 4, !tbaa !19
  %67 = sext i32 %66 to i64
  store i64 %67, ptr %63, align 8, !tbaa !15
  %68 = getelementptr inbounds i64, ptr %11, i64 2
  store i64 1, ptr %68, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 24, ptr %12) #5
  %69 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN13HipaccContext18get_command_queuesEv(ptr dead_on_unwind writable sret(%"class.std::vector.18") align 8 %12, ptr noundef nonnull align 8 dereferenceable(144) %69)
  %70 = load i32, ptr %6, align 4, !tbaa !9
  %71 = sext i32 %70 to i64
  %72 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP17_cl_command_queueSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %12, i64 noundef %71) #5
  %73 = load ptr, ptr %72, align 8, !tbaa !5
  %74 = load ptr, ptr %4, align 8, !tbaa !5
  %75 = getelementptr inbounds %class.HipaccAccessor, ptr %74, i32 0, i32 1
  %76 = call noundef ptr @_ZNKSt19__shared_ptr_accessI21HipaccImageOpenCLBaseLN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %75) #5
  %77 = load ptr, ptr %76, align 8, !tbaa !11
  %78 = getelementptr inbounds ptr, ptr %77, i64 2
  %79 = load ptr, ptr %78, align 8
  %80 = invoke noundef ptr %79(ptr noundef nonnull align 8 dereferenceable(8) %76)
          to label %81 unwind label %108

81:                                               ; preds = %38
  %82 = load ptr, ptr %5, align 8, !tbaa !5
  %83 = getelementptr inbounds %class.HipaccAccessor, ptr %82, i32 0, i32 1
  %84 = call noundef ptr @_ZNKSt19__shared_ptr_accessI21HipaccImageOpenCLBaseLN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %83) #5
  %85 = load ptr, ptr %84, align 8, !tbaa !11
  %86 = getelementptr inbounds ptr, ptr %85, i64 2
  %87 = load ptr, ptr %86, align 8
  %88 = invoke noundef ptr %87(ptr noundef nonnull align 8 dereferenceable(8) %84)
          to label %89 unwind label %108

89:                                               ; preds = %81
  %90 = getelementptr inbounds [3 x i64], ptr %10, i64 0, i64 0
  %91 = getelementptr inbounds [3 x i64], ptr %9, i64 0, i64 0
  %92 = getelementptr inbounds [3 x i64], ptr %11, i64 0, i64 0
  %93 = invoke i32 @clEnqueueCopyImage(ptr noundef %73, ptr noundef %80, ptr noundef %88, ptr noundef %90, ptr noundef %91, ptr noundef %92, i32 noundef 0, ptr noundef null, ptr noundef null)
          to label %94 unwind label %108

94:                                               ; preds = %89
  store i32 %93, ptr %7, align 4, !tbaa !9
  call void @_ZNSt6vectorIP17_cl_command_queueSaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %12) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %12) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr %15) #5
  %95 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN13HipaccContext18get_command_queuesEv(ptr dead_on_unwind writable sret(%"class.std::vector.18") align 8 %15, ptr noundef nonnull align 8 dereferenceable(144) %95)
  %96 = load i32, ptr %6, align 4, !tbaa !9
  %97 = sext i32 %96 to i64
  %98 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP17_cl_command_queueSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %15, i64 noundef %97) #5
  %99 = load ptr, ptr %98, align 8, !tbaa !5
  %100 = invoke i32 @clFinish(ptr noundef %99)
          to label %101 unwind label %112

101:                                              ; preds = %94
  %102 = load i32, ptr %7, align 4, !tbaa !9
  %103 = or i32 %102, %100
  store i32 %103, ptr %7, align 4, !tbaa !9
  call void @_ZNSt6vectorIP17_cl_command_queueSaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %15) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %15) #5
  %104 = load i32, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 32, ptr %16) #5
  call void @llvm.lifetime.start.p0(i64 1, ptr %17) #5
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %17) #5
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %16, ptr noundef @.str.120, ptr noundef nonnull align 1 dereferenceable(1) %17)
          to label %105 unwind label %116

105:                                              ; preds = %101
  call void @llvm.lifetime.start.p0(i64 32, ptr %18) #5
  call void @llvm.lifetime.start.p0(i64 1, ptr %19) #5
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %19) #5
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %18, ptr noundef @.str.65, ptr noundef nonnull align 1 dereferenceable(1) %19)
          to label %106 unwind label %120

106:                                              ; preds = %105
  invoke void @_Z19__checkOpenCLErrorsiRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES6_i(i32 noundef %104, ptr noundef nonnull align 8 dereferenceable(32) %16, ptr noundef nonnull align 8 dereferenceable(32) %18, i32 noundef 696)
          to label %107 unwind label %124

107:                                              ; preds = %106
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %18) #5
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %19) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %18) #5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %16) #5
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %17) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #5
  br label %282

108:                                              ; preds = %89, %81, %38
  %109 = landingpad { ptr, i32 }
          cleanup
  %110 = extractvalue { ptr, i32 } %109, 0
  store ptr %110, ptr %13, align 8
  %111 = extractvalue { ptr, i32 } %109, 1
  store i32 %111, ptr %14, align 4
  call void @_ZNSt6vectorIP17_cl_command_queueSaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %12) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %12) #5
  br label %130

112:                                              ; preds = %94
  %113 = landingpad { ptr, i32 }
          cleanup
  %114 = extractvalue { ptr, i32 } %113, 0
  store ptr %114, ptr %13, align 8
  %115 = extractvalue { ptr, i32 } %113, 1
  store i32 %115, ptr %14, align 4
  call void @_ZNSt6vectorIP17_cl_command_queueSaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %15) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %15) #5
  br label %130

116:                                              ; preds = %101
  %117 = landingpad { ptr, i32 }
          cleanup
  %118 = extractvalue { ptr, i32 } %117, 0
  store ptr %118, ptr %13, align 8
  %119 = extractvalue { ptr, i32 } %117, 1
  store i32 %119, ptr %14, align 4
  br label %129

120:                                              ; preds = %105
  %121 = landingpad { ptr, i32 }
          cleanup
  %122 = extractvalue { ptr, i32 } %121, 0
  store ptr %122, ptr %13, align 8
  %123 = extractvalue { ptr, i32 } %121, 1
  store i32 %123, ptr %14, align 4
  br label %128

124:                                              ; preds = %106
  %125 = landingpad { ptr, i32 }
          cleanup
  %126 = extractvalue { ptr, i32 } %125, 0
  store ptr %126, ptr %13, align 8
  %127 = extractvalue { ptr, i32 } %125, 1
  store i32 %127, ptr %14, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %18) #5
  br label %128

128:                                              ; preds = %124, %120
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %19) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %18) #5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %16) #5
  br label %129

129:                                              ; preds = %128, %116
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %17) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %16) #5
  br label %130

130:                                              ; preds = %129, %112, %108
  call void @llvm.lifetime.end.p0(i64 24, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #5
  br label %283

131:                                              ; preds = %3
  call void @llvm.lifetime.start.p0(i64 24, ptr %20) #5
  %132 = load ptr, ptr %5, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.HipaccAccessorBase, ptr %132, i32 0, i32 2
  %134 = load i32, ptr %133, align 8, !tbaa !13
  %135 = sext i32 %134 to i64
  %136 = load ptr, ptr %5, align 8, !tbaa !5
  %137 = getelementptr inbounds %class.HipaccAccessor, ptr %136, i32 0, i32 1
  %138 = call noundef ptr @_ZNKSt19__shared_ptr_accessI21HipaccImageOpenCLBaseLN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %137) #5
  %139 = load ptr, ptr %138, align 8, !tbaa !11
  %140 = getelementptr inbounds ptr, ptr %139, i64 8
  %141 = load ptr, ptr %140, align 8
  %142 = call noundef i64 %141(ptr noundef nonnull align 8 dereferenceable(8) %138)
  %143 = mul i64 %135, %142
  store i64 %143, ptr %20, align 8, !tbaa !15
  %144 = getelementptr inbounds i64, ptr %20, i64 1
  %145 = load ptr, ptr %5, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct.HipaccAccessorBase, ptr %145, i32 0, i32 3
  %147 = load i32, ptr %146, align 4, !tbaa !17
  %148 = sext i32 %147 to i64
  store i64 %148, ptr %144, align 8, !tbaa !15
  %149 = getelementptr inbounds i64, ptr %20, i64 2
  store i64 0, ptr %149, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 24, ptr %21) #5
  %150 = load ptr, ptr %4, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct.HipaccAccessorBase, ptr %150, i32 0, i32 2
  %152 = load i32, ptr %151, align 8, !tbaa !13
  %153 = sext i32 %152 to i64
  %154 = load ptr, ptr %4, align 8, !tbaa !5
  %155 = getelementptr inbounds %class.HipaccAccessor, ptr %154, i32 0, i32 1
  %156 = call noundef ptr @_ZNKSt19__shared_ptr_accessI21HipaccImageOpenCLBaseLN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %155) #5
  %157 = load ptr, ptr %156, align 8, !tbaa !11
  %158 = getelementptr inbounds ptr, ptr %157, i64 8
  %159 = load ptr, ptr %158, align 8
  %160 = call noundef i64 %159(ptr noundef nonnull align 8 dereferenceable(8) %156)
  %161 = mul i64 %153, %160
  store i64 %161, ptr %21, align 8, !tbaa !15
  %162 = getelementptr inbounds i64, ptr %21, i64 1
  %163 = load ptr, ptr %4, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct.HipaccAccessorBase, ptr %163, i32 0, i32 3
  %165 = load i32, ptr %164, align 4, !tbaa !17
  %166 = sext i32 %165 to i64
  store i64 %166, ptr %162, align 8, !tbaa !15
  %167 = getelementptr inbounds i64, ptr %21, i64 2
  store i64 0, ptr %167, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 24, ptr %22) #5
  %168 = load ptr, ptr %5, align 8, !tbaa !5
  %169 = getelementptr inbounds %struct.HipaccAccessorBase, ptr %168, i32 0, i32 0
  %170 = load i32, ptr %169, align 8, !tbaa !18
  %171 = sext i32 %170 to i64
  %172 = load ptr, ptr %5, align 8, !tbaa !5
  %173 = getelementptr inbounds %class.HipaccAccessor, ptr %172, i32 0, i32 1
  %174 = call noundef ptr @_ZNKSt19__shared_ptr_accessI21HipaccImageOpenCLBaseLN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %173) #5
  %175 = load ptr, ptr %174, align 8, !tbaa !11
  %176 = getelementptr inbounds ptr, ptr %175, i64 8
  %177 = load ptr, ptr %176, align 8
  %178 = call noundef i64 %177(ptr noundef nonnull align 8 dereferenceable(8) %174)
  %179 = mul i64 %171, %178
  store i64 %179, ptr %22, align 8, !tbaa !15
  %180 = getelementptr inbounds i64, ptr %22, i64 1
  %181 = load ptr, ptr %5, align 8, !tbaa !5
  %182 = getelementptr inbounds %struct.HipaccAccessorBase, ptr %181, i32 0, i32 1
  %183 = load i32, ptr %182, align 4, !tbaa !19
  %184 = sext i32 %183 to i64
  store i64 %184, ptr %180, align 8, !tbaa !15
  %185 = getelementptr inbounds i64, ptr %22, i64 2
  store i64 1, ptr %185, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 24, ptr %23) #5
  %186 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN13HipaccContext18get_command_queuesEv(ptr dead_on_unwind writable sret(%"class.std::vector.18") align 8 %23, ptr noundef nonnull align 8 dereferenceable(144) %186)
  %187 = load i32, ptr %6, align 4, !tbaa !9
  %188 = sext i32 %187 to i64
  %189 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP17_cl_command_queueSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %23, i64 noundef %188) #5
  %190 = load ptr, ptr %189, align 8, !tbaa !5
  %191 = load ptr, ptr %4, align 8, !tbaa !5
  %192 = getelementptr inbounds %class.HipaccAccessor, ptr %191, i32 0, i32 1
  %193 = call noundef ptr @_ZNKSt19__shared_ptr_accessI21HipaccImageOpenCLBaseLN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %192) #5
  %194 = load ptr, ptr %193, align 8, !tbaa !11
  %195 = getelementptr inbounds ptr, ptr %194, i64 2
  %196 = load ptr, ptr %195, align 8
  %197 = invoke noundef ptr %196(ptr noundef nonnull align 8 dereferenceable(8) %193)
          to label %198 unwind label %259

198:                                              ; preds = %131
  %199 = load ptr, ptr %5, align 8, !tbaa !5
  %200 = getelementptr inbounds %class.HipaccAccessor, ptr %199, i32 0, i32 1
  %201 = call noundef ptr @_ZNKSt19__shared_ptr_accessI21HipaccImageOpenCLBaseLN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %200) #5
  %202 = load ptr, ptr %201, align 8, !tbaa !11
  %203 = getelementptr inbounds ptr, ptr %202, i64 2
  %204 = load ptr, ptr %203, align 8
  %205 = invoke noundef ptr %204(ptr noundef nonnull align 8 dereferenceable(8) %201)
          to label %206 unwind label %259

206:                                              ; preds = %198
  %207 = getelementptr inbounds [3 x i64], ptr %21, i64 0, i64 0
  %208 = getelementptr inbounds [3 x i64], ptr %20, i64 0, i64 0
  %209 = getelementptr inbounds [3 x i64], ptr %22, i64 0, i64 0
  %210 = load ptr, ptr %4, align 8, !tbaa !5
  %211 = getelementptr inbounds %class.HipaccAccessor, ptr %210, i32 0, i32 1
  %212 = call noundef ptr @_ZNKSt19__shared_ptr_accessI21HipaccImageOpenCLBaseLN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %211) #5
  %213 = load ptr, ptr %212, align 8, !tbaa !11
  %214 = getelementptr inbounds ptr, ptr %213, i64 6
  %215 = load ptr, ptr %214, align 8
  %216 = invoke noundef i64 %215(ptr noundef nonnull align 8 dereferenceable(8) %212)
          to label %217 unwind label %259

217:                                              ; preds = %206
  %218 = load ptr, ptr %4, align 8, !tbaa !5
  %219 = getelementptr inbounds %class.HipaccAccessor, ptr %218, i32 0, i32 1
  %220 = call noundef ptr @_ZNKSt19__shared_ptr_accessI21HipaccImageOpenCLBaseLN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %219) #5
  %221 = load ptr, ptr %220, align 8, !tbaa !11
  %222 = getelementptr inbounds ptr, ptr %221, i64 8
  %223 = load ptr, ptr %222, align 8
  %224 = invoke noundef i64 %223(ptr noundef nonnull align 8 dereferenceable(8) %220)
          to label %225 unwind label %259

225:                                              ; preds = %217
  %226 = mul i64 %216, %224
  %227 = load ptr, ptr %5, align 8, !tbaa !5
  %228 = getelementptr inbounds %class.HipaccAccessor, ptr %227, i32 0, i32 1
  %229 = call noundef ptr @_ZNKSt19__shared_ptr_accessI21HipaccImageOpenCLBaseLN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %228) #5
  %230 = load ptr, ptr %229, align 8, !tbaa !11
  %231 = getelementptr inbounds ptr, ptr %230, i64 6
  %232 = load ptr, ptr %231, align 8
  %233 = invoke noundef i64 %232(ptr noundef nonnull align 8 dereferenceable(8) %229)
          to label %234 unwind label %259

234:                                              ; preds = %225
  %235 = load ptr, ptr %5, align 8, !tbaa !5
  %236 = getelementptr inbounds %class.HipaccAccessor, ptr %235, i32 0, i32 1
  %237 = call noundef ptr @_ZNKSt19__shared_ptr_accessI21HipaccImageOpenCLBaseLN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %236) #5
  %238 = load ptr, ptr %237, align 8, !tbaa !11
  %239 = getelementptr inbounds ptr, ptr %238, i64 8
  %240 = load ptr, ptr %239, align 8
  %241 = invoke noundef i64 %240(ptr noundef nonnull align 8 dereferenceable(8) %237)
          to label %242 unwind label %259

242:                                              ; preds = %234
  %243 = mul i64 %233, %241
  %244 = invoke i32 @clEnqueueCopyBufferRect(ptr noundef %190, ptr noundef %197, ptr noundef %205, ptr noundef %207, ptr noundef %208, ptr noundef %209, i64 noundef %226, i64 noundef 0, i64 noundef %243, i64 noundef 0, i32 noundef 0, ptr noundef null, ptr noundef null)
          to label %245 unwind label %259

245:                                              ; preds = %242
  store i32 %244, ptr %7, align 4, !tbaa !9
  call void @_ZNSt6vectorIP17_cl_command_queueSaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %23) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %23) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr %24) #5
  %246 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN13HipaccContext18get_command_queuesEv(ptr dead_on_unwind writable sret(%"class.std::vector.18") align 8 %24, ptr noundef nonnull align 8 dereferenceable(144) %246)
  %247 = load i32, ptr %6, align 4, !tbaa !9
  %248 = sext i32 %247 to i64
  %249 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP17_cl_command_queueSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %24, i64 noundef %248) #5
  %250 = load ptr, ptr %249, align 8, !tbaa !5
  %251 = invoke i32 @clFinish(ptr noundef %250)
          to label %252 unwind label %263

252:                                              ; preds = %245
  %253 = load i32, ptr %7, align 4, !tbaa !9
  %254 = or i32 %253, %251
  store i32 %254, ptr %7, align 4, !tbaa !9
  call void @_ZNSt6vectorIP17_cl_command_queueSaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %24) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %24) #5
  %255 = load i32, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 32, ptr %25) #5
  call void @llvm.lifetime.start.p0(i64 1, ptr %26) #5
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %26) #5
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %25, ptr noundef @.str.122, ptr noundef nonnull align 1 dereferenceable(1) %26)
          to label %256 unwind label %267

256:                                              ; preds = %252
  call void @llvm.lifetime.start.p0(i64 32, ptr %27) #5
  call void @llvm.lifetime.start.p0(i64 1, ptr %28) #5
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %28) #5
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %27, ptr noundef @.str.65, ptr noundef nonnull align 1 dereferenceable(1) %28)
          to label %257 unwind label %271

257:                                              ; preds = %256
  invoke void @_Z19__checkOpenCLErrorsiRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES6_i(i32 noundef %255, ptr noundef nonnull align 8 dereferenceable(32) %25, ptr noundef nonnull align 8 dereferenceable(32) %27, i32 noundef 711)
          to label %258 unwind label %275

258:                                              ; preds = %257
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %27) #5
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %28) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %28) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %27) #5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %25) #5
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %26) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %26) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %25) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %20) #5
  br label %282

259:                                              ; preds = %242, %234, %225, %217, %206, %198, %131
  %260 = landingpad { ptr, i32 }
          cleanup
  %261 = extractvalue { ptr, i32 } %260, 0
  store ptr %261, ptr %13, align 8
  %262 = extractvalue { ptr, i32 } %260, 1
  store i32 %262, ptr %14, align 4
  call void @_ZNSt6vectorIP17_cl_command_queueSaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %23) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %23) #5
  br label %281

263:                                              ; preds = %245
  %264 = landingpad { ptr, i32 }
          cleanup
  %265 = extractvalue { ptr, i32 } %264, 0
  store ptr %265, ptr %13, align 8
  %266 = extractvalue { ptr, i32 } %264, 1
  store i32 %266, ptr %14, align 4
  call void @_ZNSt6vectorIP17_cl_command_queueSaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %24) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %24) #5
  br label %281

267:                                              ; preds = %252
  %268 = landingpad { ptr, i32 }
          cleanup
  %269 = extractvalue { ptr, i32 } %268, 0
  store ptr %269, ptr %13, align 8
  %270 = extractvalue { ptr, i32 } %268, 1
  store i32 %270, ptr %14, align 4
  br label %280

271:                                              ; preds = %256
  %272 = landingpad { ptr, i32 }
          cleanup
  %273 = extractvalue { ptr, i32 } %272, 0
  store ptr %273, ptr %13, align 8
  %274 = extractvalue { ptr, i32 } %272, 1
  store i32 %274, ptr %14, align 4
  br label %279

275:                                              ; preds = %257
  %276 = landingpad { ptr, i32 }
          cleanup
  %277 = extractvalue { ptr, i32 } %276, 0
  store ptr %277, ptr %13, align 8
  %278 = extractvalue { ptr, i32 } %276, 1
  store i32 %278, ptr %14, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %27) #5
  br label %279

279:                                              ; preds = %275, %271
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %28) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %28) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %27) #5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %25) #5
  br label %280

280:                                              ; preds = %279, %267
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %26) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %26) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %25) #5
  br label %281

281:                                              ; preds = %280, %263, %259
  call void @llvm.lifetime.end.p0(i64 24, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %20) #5
  br label %283

282:                                              ; preds = %258, %107
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  ret void

283:                                              ; preds = %281, %130
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %284

284:                                              ; preds = %283
  %285 = load ptr, ptr %13, align 8
  %286 = load i32, ptr %14, align 4
  %287 = insertvalue { ptr, i32 } poison, ptr %285, 0
  %288 = insertvalue { ptr, i32 } %287, i32 %286, 1
  resume { ptr, i32 } %288
}

declare i32 @clEnqueueCopyBufferRect(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, i64 noundef, i64 noundef, i64 noundef, i64 noundef, i32 noundef, ptr noundef, ptr noundef) #4

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = { 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 = { "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 = { 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 = !{!"vtable pointer", !8, i64 0}
!13 = !{!14, !10, i64 8}
!14 = !{!"_ZTS18HipaccAccessorBase", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12}
!15 = !{!16, !16, i64 0}
!16 = !{!"long", !7, i64 0}
!17 = !{!14, !10, i64 12}
!18 = !{!14, !10, i64 0}
!19 = !{!14, !10, i64 4}


; 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.std::vector.18" = type { %"struct.std::_Vector_base.19" }
%"struct.std::_Vector_base.19" = type { %"struct.std::_Vector_base<_cl_command_queue *, std::allocator<_cl_command_queue *>>::_Vector_impl" }
%"struct.std::_Vector_base<_cl_command_queue *, std::allocator<_cl_command_queue *>>::_Vector_impl" = type { %"struct.std::_Vector_base<_cl_command_queue *, std::allocator<_cl_command_queue *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<_cl_command_queue *, std::allocator<_cl_command_queue *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"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] }
%"class.std::allocator" = type { i8 }

@.str.65 = external hidden unnamed_addr constant [80 x i8], align 1
@.str.120 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.122 = external hidden unnamed_addr constant [26 x i8], align 1

; 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 nounwind uwtable
declare void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 align 2

; 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 nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(144) ptr @_ZN13HipaccContext11getInstanceEv() local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN13HipaccContext18get_command_queuesEv(ptr dead_on_unwind noalias writable sret(%"class.std::vector.18") align 8, ptr noundef nonnull align 8 dereferenceable(144)) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_Z19__checkOpenCLErrorsiRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES6_i(i32 noundef, ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32), i32 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #1 align 2

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

declare i32 @clEnqueueCopyImage(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIP17_cl_command_queueSaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1 align 2

declare i32 @clFinish(ptr noundef) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
define dso_local void @_Z22hipaccCopyMemoryRegionRK14HipaccAccessorS1_i(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull align 8 dereferenceable(32) %1, i32 noundef %2) local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %4 = alloca [3 x i64], align 16
  %5 = alloca [3 x i64], align 16
  %6 = alloca [3 x i64], align 16
  %7 = alloca %"class.std::vector.18", align 8
  %8 = alloca %"class.std::vector.18", align 8
  %9 = alloca %"class.std::__cxx11::basic_string", align 8
  %10 = alloca %"class.std::allocator", align 1
  %11 = alloca %"class.std::__cxx11::basic_string", align 8
  %12 = alloca %"class.std::allocator", align 1
  %13 = alloca [3 x i64], align 16
  %14 = alloca [3 x i64], align 16
  %15 = alloca [3 x i64], align 16
  %16 = alloca %"class.std::vector.18", align 8
  %17 = alloca %"class.std::vector.18", align 8
  %18 = alloca %"class.std::__cxx11::basic_string", align 8
  %19 = alloca %"class.std::allocator", align 1
  %20 = alloca %"class.std::__cxx11::basic_string", align 8
  %21 = alloca %"class.std::allocator", align 1
  %22 = tail call noundef nonnull align 8 dereferenceable(144) ptr @_ZN13HipaccContext11getInstanceEv()
  %23 = getelementptr inbounds i8, ptr %0, i64 16
  %24 = tail call noundef ptr @_ZNKSt19__shared_ptr_accessI21HipaccImageOpenCLBaseLN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %23) #5
  %25 = load ptr, ptr %24, align 8, !tbaa !5
  %26 = getelementptr inbounds i8, ptr %25, i64 72
  %27 = load ptr, ptr %26, align 8
  %28 = tail call noundef i32 %27(ptr noundef nonnull align 8 dereferenceable(8) %24)
  %29 = icmp sgt i32 %28, 2
  %30 = getelementptr inbounds i8, ptr %1, i64 8
  br i1 %29, label %31, label %93

31:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #5
  %32 = load i32, ptr %30, align 8, !tbaa !8
  %33 = sext i32 %32 to i64
  store i64 %33, ptr %4, align 16, !tbaa !12
  %34 = getelementptr inbounds i8, ptr %4, i64 8
  %35 = getelementptr inbounds i8, ptr %1, i64 12
  %36 = load i32, ptr %35, align 4, !tbaa !14
  %37 = sext i32 %36 to i64
  store i64 %37, ptr %34, align 8, !tbaa !12
  %38 = getelementptr inbounds i8, ptr %4, i64 16
  store i64 0, ptr %38, align 16, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #5
  %39 = getelementptr inbounds i8, ptr %0, i64 8
  %40 = load i32, ptr %39, align 8, !tbaa !8
  %41 = sext i32 %40 to i64
  store i64 %41, ptr %5, align 16, !tbaa !12
  %42 = getelementptr inbounds i8, ptr %5, i64 8
  %43 = getelementptr inbounds i8, ptr %0, i64 12
  %44 = load i32, ptr %43, align 4, !tbaa !14
  %45 = sext i32 %44 to i64
  store i64 %45, ptr %42, align 8, !tbaa !12
  %46 = getelementptr inbounds i8, ptr %5, i64 16
  store i64 0, ptr %46, align 16, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #5
  %47 = load i32, ptr %1, align 8, !tbaa !15
  %48 = sext i32 %47 to i64
  store i64 %48, ptr %6, align 16, !tbaa !12
  %49 = getelementptr inbounds i8, ptr %6, i64 8
  %50 = getelementptr inbounds i8, ptr %1, i64 4
  %51 = load i32, ptr %50, align 4, !tbaa !16
  %52 = sext i32 %51 to i64
  store i64 %52, ptr %49, align 8, !tbaa !12
  %53 = getelementptr inbounds i8, ptr %6, i64 16
  store i64 1, ptr %53, align 16, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #5
  call void @_ZN13HipaccContext18get_command_queuesEv(ptr dead_on_unwind nonnull writable sret(%"class.std::vector.18") align 8 %7, ptr noundef nonnull align 8 dereferenceable(144) %22)
  %54 = sext i32 %2 to i64
  %55 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP17_cl_command_queueSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %54) #5
  %56 = load ptr, ptr %55, align 8, !tbaa !17
  %57 = call noundef ptr @_ZNKSt19__shared_ptr_accessI21HipaccImageOpenCLBaseLN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %23) #5
  %58 = load ptr, ptr %57, align 8, !tbaa !5
  %59 = getelementptr inbounds i8, ptr %58, i64 16
  %60 = load ptr, ptr %59, align 8
  %61 = invoke noundef ptr %60(ptr noundef nonnull align 8 dereferenceable(8) %57)
          to label %62 unwind label %80

62:                                               ; preds = %31
  %63 = getelementptr inbounds i8, ptr %1, i64 16
  %64 = call noundef ptr @_ZNKSt19__shared_ptr_accessI21HipaccImageOpenCLBaseLN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %63) #5
  %65 = load ptr, ptr %64, align 8, !tbaa !5
  %66 = getelementptr inbounds i8, ptr %65, i64 16
  %67 = load ptr, ptr %66, align 8
  %68 = invoke noundef ptr %67(ptr noundef nonnull align 8 dereferenceable(8) %64)
          to label %69 unwind label %80

69:                                               ; preds = %62
  %70 = invoke i32 @clEnqueueCopyImage(ptr noundef %56, ptr noundef %61, ptr noundef %68, ptr noundef nonnull %5, ptr noundef nonnull %4, ptr noundef nonnull %6, i32 noundef 0, ptr noundef null, ptr noundef null)
          to label %71 unwind label %80

71:                                               ; preds = %69
  call void @_ZNSt6vectorIP17_cl_command_queueSaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #5
  call void @_ZN13HipaccContext18get_command_queuesEv(ptr dead_on_unwind nonnull writable sret(%"class.std::vector.18") align 8 %8, ptr noundef nonnull align 8 dereferenceable(144) %22)
  %72 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP17_cl_command_queueSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %54) #5
  %73 = load ptr, ptr %72, align 8, !tbaa !17
  %74 = invoke i32 @clFinish(ptr noundef %73)
          to label %75 unwind label %82

75:                                               ; preds = %71
  %76 = or i32 %74, %70
  call void @_ZNSt6vectorIP17_cl_command_queueSaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %9) #5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %10) #5
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #5
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %9, ptr noundef nonnull @.str.120, ptr noundef nonnull align 1 dereferenceable(1) %10)
          to label %77 unwind label %84

77:                                               ; preds = %75
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %11) #5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %12) #5
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %12) #5
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %11, ptr noundef nonnull @.str.65, ptr noundef nonnull align 1 dereferenceable(1) %12)
          to label %78 unwind label %86

78:                                               ; preds = %77
  invoke void @_Z19__checkOpenCLErrorsiRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES6_i(i32 noundef %76, ptr noundef nonnull align 8 dereferenceable(32) %9, ptr noundef nonnull align 8 dereferenceable(32) %11, i32 noundef 696)
          to label %79 unwind label %88

79:                                               ; preds = %78
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #5
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %12) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %12) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %11) #5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #5
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %10) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %9) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #5
  br label %199

80:                                               ; preds = %69, %62, %31
  %81 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt6vectorIP17_cl_command_queueSaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #5
  br label %92

82:                                               ; preds = %71
  %83 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt6vectorIP17_cl_command_queueSaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #5
  br label %92

84:                                               ; preds = %75
  %85 = landingpad { ptr, i32 }
          cleanup
  br label %91

86:                                               ; preds = %77
  %87 = landingpad { ptr, i32 }
          cleanup
  br label %90

88:                                               ; preds = %78
  %89 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #5
  br label %90

90:                                               ; preds = %88, %86
  %.pn47 = phi { ptr, i32 } [ %89, %88 ], [ %87, %86 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %12) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %12) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %11) #5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #5
  br label %91

91:                                               ; preds = %90, %84
  %.pn47.pn = phi { ptr, i32 } [ %.pn47, %90 ], [ %85, %84 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %10) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %9) #5
  br label %92

92:                                               ; preds = %91, %82, %80
  %.pn47.pn.pn = phi { ptr, i32 } [ %.pn47.pn, %91 ], [ %83, %82 ], [ %81, %80 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #5
  br label %200

93:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %13) #5
  %94 = load i32, ptr %30, align 8, !tbaa !8
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds i8, ptr %1, i64 16
  %97 = tail call noundef ptr @_ZNKSt19__shared_ptr_accessI21HipaccImageOpenCLBaseLN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %96) #5
  %98 = load ptr, ptr %97, align 8, !tbaa !5
  %99 = getelementptr inbounds i8, ptr %98, i64 64
  %100 = load ptr, ptr %99, align 8
  %101 = tail call noundef i64 %100(ptr noundef nonnull align 8 dereferenceable(8) %97)
  %102 = mul i64 %101, %95
  store i64 %102, ptr %13, align 16, !tbaa !12
  %103 = getelementptr inbounds i8, ptr %13, i64 8
  %104 = getelementptr inbounds i8, ptr %1, i64 12
  %105 = load i32, ptr %104, align 4, !tbaa !14
  %106 = sext i32 %105 to i64
  store i64 %106, ptr %103, align 8, !tbaa !12
  %107 = getelementptr inbounds i8, ptr %13, i64 16
  store i64 0, ptr %107, align 16, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %14) #5
  %108 = getelementptr inbounds i8, ptr %0, i64 8
  %109 = load i32, ptr %108, align 8, !tbaa !8
  %110 = sext i32 %109 to i64
  %111 = tail call noundef ptr @_ZNKSt19__shared_ptr_accessI21HipaccImageOpenCLBaseLN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %23) #5
  %112 = load ptr, ptr %111, align 8, !tbaa !5
  %113 = getelementptr inbounds i8, ptr %112, i64 64
  %114 = load ptr, ptr %113, align 8
  %115 = tail call noundef i64 %114(ptr noundef nonnull align 8 dereferenceable(8) %111)
  %116 = mul i64 %115, %110
  store i64 %116, ptr %14, align 16, !tbaa !12
  %117 = getelementptr inbounds i8, ptr %14, i64 8
  %118 = getelementptr inbounds i8, ptr %0, i64 12
  %119 = load i32, ptr %118, align 4, !tbaa !14
  %120 = sext i32 %119 to i64
  store i64 %120, ptr %117, align 8, !tbaa !12
  %121 = getelementptr inbounds i8, ptr %14, i64 16
  store i64 0, ptr %121, align 16, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %15) #5
  %122 = load i32, ptr %1, align 8, !tbaa !15
  %123 = sext i32 %122 to i64
  %124 = tail call noundef ptr @_ZNKSt19__shared_ptr_accessI21HipaccImageOpenCLBaseLN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %96) #5
  %125 = load ptr, ptr %124, align 8, !tbaa !5
  %126 = getelementptr inbounds i8, ptr %125, i64 64
  %127 = load ptr, ptr %126, align 8
  %128 = tail call noundef i64 %127(ptr noundef nonnull align 8 dereferenceable(8) %124)
  %129 = mul i64 %128, %123
  store i64 %129, ptr %15, align 16, !tbaa !12
  %130 = getelementptr inbounds i8, ptr %15, i64 8
  %131 = getelementptr inbounds i8, ptr %1, i64 4
  %132 = load i32, ptr %131, align 4, !tbaa !16
  %133 = sext i32 %132 to i64
  store i64 %133, ptr %130, align 8, !tbaa !12
  %134 = getelementptr inbounds i8, ptr %15, i64 16
  store i64 1, ptr %134, align 16, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %16) #5
  call void @_ZN13HipaccContext18get_command_queuesEv(ptr dead_on_unwind nonnull writable sret(%"class.std::vector.18") align 8 %16, ptr noundef nonnull align 8 dereferenceable(144) %22)
  %135 = sext i32 %2 to i64
  %136 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP17_cl_command_queueSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %16, i64 noundef %135) #5
  %137 = load ptr, ptr %136, align 8, !tbaa !17
  %138 = call noundef ptr @_ZNKSt19__shared_ptr_accessI21HipaccImageOpenCLBaseLN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %23) #5
  %139 = load ptr, ptr %138, align 8, !tbaa !5
  %140 = getelementptr inbounds i8, ptr %139, i64 16
  %141 = load ptr, ptr %140, align 8
  %142 = invoke noundef ptr %141(ptr noundef nonnull align 8 dereferenceable(8) %138)
          to label %143 unwind label %186

143:                                              ; preds = %93
  %144 = call noundef ptr @_ZNKSt19__shared_ptr_accessI21HipaccImageOpenCLBaseLN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %96) #5
  %145 = load ptr, ptr %144, align 8, !tbaa !5
  %146 = getelementptr inbounds i8, ptr %145, i64 16
  %147 = load ptr, ptr %146, align 8
  %148 = invoke noundef ptr %147(ptr noundef nonnull align 8 dereferenceable(8) %144)
          to label %149 unwind label %186

149:                                              ; preds = %143
  %150 = call noundef ptr @_ZNKSt19__shared_ptr_accessI21HipaccImageOpenCLBaseLN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %23) #5
  %151 = load ptr, ptr %150, align 8, !tbaa !5
  %152 = getelementptr inbounds i8, ptr %151, i64 48
  %153 = load ptr, ptr %152, align 8
  %154 = invoke noundef i64 %153(ptr noundef nonnull align 8 dereferenceable(8) %150)
          to label %155 unwind label %186

155:                                              ; preds = %149
  %156 = call noundef ptr @_ZNKSt19__shared_ptr_accessI21HipaccImageOpenCLBaseLN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %23) #5
  %157 = load ptr, ptr %156, align 8, !tbaa !5
  %158 = getelementptr inbounds i8, ptr %157, i64 64
  %159 = load ptr, ptr %158, align 8
  %160 = invoke noundef i64 %159(ptr noundef nonnull align 8 dereferenceable(8) %156)
          to label %161 unwind label %186

161:                                              ; preds = %155
  %162 = mul i64 %160, %154
  %163 = call noundef ptr @_ZNKSt19__shared_ptr_accessI21HipaccImageOpenCLBaseLN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %96) #5
  %164 = load ptr, ptr %163, align 8, !tbaa !5
  %165 = getelementptr inbounds i8, ptr %164, i64 48
  %166 = load ptr, ptr %165, align 8
  %167 = invoke noundef i64 %166(ptr noundef nonnull align 8 dereferenceable(8) %163)
          to label %168 unwind label %186

168:                                              ; preds = %161
  %169 = call noundef ptr @_ZNKSt19__shared_ptr_accessI21HipaccImageOpenCLBaseLN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %96) #5
  %170 = load ptr, ptr %169, align 8, !tbaa !5
  %171 = getelementptr inbounds i8, ptr %170, i64 64
  %172 = load ptr, ptr %171, align 8
  %173 = invoke noundef i64 %172(ptr noundef nonnull align 8 dereferenceable(8) %169)
          to label %174 unwind label %186

174:                                              ; preds = %168
  %175 = mul i64 %173, %167
  %176 = invoke i32 @clEnqueueCopyBufferRect(ptr noundef %137, ptr noundef %142, ptr noundef %148, ptr noundef nonnull %14, ptr noundef nonnull %13, ptr noundef nonnull %15, i64 noundef %162, i64 noundef 0, i64 noundef %175, i64 noundef 0, i32 noundef 0, ptr noundef null, ptr noundef null)
          to label %177 unwind label %186

177:                                              ; preds = %174
  call void @_ZNSt6vectorIP17_cl_command_queueSaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %16) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %16) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %17) #5
  call void @_ZN13HipaccContext18get_command_queuesEv(ptr dead_on_unwind nonnull writable sret(%"class.std::vector.18") align 8 %17, ptr noundef nonnull align 8 dereferenceable(144) %22)
  %178 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP17_cl_command_queueSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %17, i64 noundef %135) #5
  %179 = load ptr, ptr %178, align 8, !tbaa !17
  %180 = invoke i32 @clFinish(ptr noundef %179)
          to label %181 unwind label %188

181:                                              ; preds = %177
  %182 = or i32 %180, %176
  call void @_ZNSt6vectorIP17_cl_command_queueSaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %17) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %17) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %18) #5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %19) #5
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %19) #5
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %18, ptr noundef nonnull @.str.122, ptr noundef nonnull align 1 dereferenceable(1) %19)
          to label %183 unwind label %190

183:                                              ; preds = %181
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %20) #5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %21) #5
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %21) #5
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %20, ptr noundef nonnull @.str.65, ptr noundef nonnull align 1 dereferenceable(1) %21)
          to label %184 unwind label %192

184:                                              ; preds = %183
  invoke void @_Z19__checkOpenCLErrorsiRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES6_i(i32 noundef %182, ptr noundef nonnull align 8 dereferenceable(32) %18, ptr noundef nonnull align 8 dereferenceable(32) %20, i32 noundef 711)
          to label %185 unwind label %194

185:                                              ; preds = %184
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %20) #5
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %21) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %21) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %20) #5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %18) #5
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %19) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %19) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %18) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %15) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %14) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %13) #5
  br label %199

186:                                              ; preds = %174, %168, %161, %155, %149, %143, %93
  %187 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt6vectorIP17_cl_command_queueSaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %16) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %16) #5
  br label %198

188:                                              ; preds = %177
  %189 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt6vectorIP17_cl_command_queueSaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %17) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %17) #5
  br label %198

190:                                              ; preds = %181
  %191 = landingpad { ptr, i32 }
          cleanup
  br label %197

192:                                              ; preds = %183
  %193 = landingpad { ptr, i32 }
          cleanup
  br label %196

194:                                              ; preds = %184
  %195 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %20) #5
  br label %196

196:                                              ; preds = %194, %192
  %.pn = phi { ptr, i32 } [ %195, %194 ], [ %193, %192 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %21) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %21) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %20) #5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %18) #5
  br label %197

197:                                              ; preds = %196, %190
  %.pn.pn = phi { ptr, i32 } [ %.pn, %196 ], [ %191, %190 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %19) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %19) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %18) #5
  br label %198

198:                                              ; preds = %197, %188, %186
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %197 ], [ %189, %188 ], [ %187, %186 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %15) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %14) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %13) #5
  br label %200

199:                                              ; preds = %185, %79
  ret void

200:                                              ; preds = %198, %92
  %.pn47.pn.pn.pn = phi { ptr, i32 } [ %.pn47.pn.pn, %92 ], [ %.pn.pn.pn, %198 ]
  resume { ptr, i32 } %.pn47.pn.pn.pn
}

declare i32 @clEnqueueCopyBufferRect(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, i64 noundef, i64 noundef, i64 noundef, i64 noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = { 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 = { "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 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !10, i64 8}
!9 = !{!"_ZTS18HipaccAccessorBase", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12}
!10 = !{!"int", !11, i64 0}
!11 = !{!"omnipotent char", !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"long", !11, i64 0}
!14 = !{!9, !10, i64 12}
!15 = !{!9, !10, i64 0}
!16 = !{!9, !10, i64 4}
!17 = !{!18, !18, i64 0}
!18 = !{!"any pointer", !11, i64 0}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass