; LLVM IR from cjurjiu/RubikDetector-Android :: rubikdetectorcore/src/rubikprocessor/builder (RubikProcessorBuilder)

; 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::unique_ptr.10" = type { %"struct.std::__uniq_ptr_data.11" }
%"struct.std::__uniq_ptr_data.11" = type { %"class.std::__uniq_ptr_impl.12" }
%"class.std::__uniq_ptr_impl.12" = type { %"class.std::tuple.13" }
%"class.std::tuple.13" = type { %"struct.std::_Tuple_impl.14" }
%"struct.std::_Tuple_impl.14" = type { %"struct.std::_Head_base.17" }
%"struct.std::_Head_base.17" = type { ptr }
%"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 }
%"class.std::unique_ptr.26" = type { %"struct.std::__uniq_ptr_data.27" }
%"struct.std::__uniq_ptr_data.27" = type { %"class.std::__uniq_ptr_impl.28" }
%"class.std::__uniq_ptr_impl.28" = type { %"class.std::tuple.29" }
%"class.std::tuple.29" = type { %"struct.std::_Tuple_impl.30" }
%"struct.std::_Tuple_impl.30" = type { %"struct.std::_Head_base.33" }
%"struct.std::_Head_base.33" = type { ptr }
%"class.std::unique_ptr.42" = type { %"struct.std::__uniq_ptr_data.43" }
%"struct.std::__uniq_ptr_data.43" = type { %"class.std::__uniq_ptr_impl.44" }
%"class.std::__uniq_ptr_impl.44" = type { %"class.std::tuple.45" }
%"class.std::tuple.45" = type { %"struct.std::_Tuple_impl.46" }
%"struct.std::_Tuple_impl.46" = type { %"struct.std::_Head_base.49" }
%"struct.std::_Head_base.49" = type { ptr }
%"class.rbdt::DrawConfig" = type <{ i32, i32, i8, [3 x i8] }>
%"class.rbdt::ImageProperties" = type { i32, i32, i32, i32 }
%"class.std::unique_ptr.2" = type { %"struct.std::__uniq_ptr_data.3" }
%"struct.std::__uniq_ptr_data.3" = type { %"class.std::__uniq_ptr_impl.4" }
%"class.std::__uniq_ptr_impl.4" = type { %"class.std::tuple.5" }
%"class.std::tuple.5" = type { %"struct.std::_Tuple_impl.6" }
%"struct.std::_Tuple_impl.6" = type { %"struct.std::_Head_base.9" }
%"struct.std::_Head_base.9" = type { ptr }
%"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.1" }
%"struct.std::_Head_base.1" = type { ptr }
%"class.rbdt::RubikProcessorBuilder" = type <{ i32, i32, i32, %"class.rbdt::DrawConfig", %"class.std::unique_ptr", %"class.std::unique_ptr.2", %"class.std::shared_ptr", i8, [7 x i8] }>

; 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 noundef ptr @_ZN4rbdt21RubikProcessorBuilder5buildEv(ptr noundef nonnull align 8 dereferenceable(57) %0) #1 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca %"class.std::unique_ptr.10", align 8
  %4 = alloca %"class.std::shared_ptr", align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i1, align 1
  %8 = alloca %"class.std::unique_ptr.26", align 8
  %9 = alloca %"class.std::shared_ptr", align 8
  %10 = alloca i1, align 1
  %11 = alloca %"class.std::unique_ptr.42", align 8
  %12 = alloca %"class.rbdt::DrawConfig", align 4
  %13 = alloca { i64, i8 }, align 4
  %14 = alloca ptr, align 8
  %15 = alloca %"class.rbdt::ImageProperties", align 4
  %16 = alloca %"class.std::unique_ptr.2", align 8
  %17 = alloca %"class.std::unique_ptr", align 8
  %18 = alloca %"class.std::unique_ptr.42", align 8
  %19 = alloca %"class.std::shared_ptr", align 8
  %20 = alloca i1, align 1
  store ptr %0, ptr %2, align 8, !tbaa !5
  %21 = load ptr, ptr %2, align 8
  %22 = getelementptr inbounds %"class.rbdt::RubikProcessorBuilder", ptr %21, i32 0, i32 5
  %23 = call noundef zeroext i1 @_ZSteqIN4rbdt21RubikFaceletsDetectorESt14default_deleteIS1_EEbRKSt10unique_ptrIT_T0_EDn(ptr noundef nonnull align 8 dereferenceable(8) %22, ptr null) #8
  br i1 %23, label %24, label %37

24:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #8
  %25 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 16) #9
  store i1 true, ptr %7, align 1
  %26 = getelementptr inbounds %"class.rbdt::RubikProcessorBuilder", ptr %21, i32 0, i32 6
  call void @_ZNSt10shared_ptrIN4rbdt10ImageSaverEEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(16) %4, ptr noundef nonnull align 8 dereferenceable(16) %26) #8
  invoke void @_ZN4rbdt22SimpleFaceletsDetectorC1ESt10shared_ptrINS_10ImageSaverEE(ptr noundef nonnull align 8 dereferenceable(16) %25, ptr noundef %4)
          to label %27 unwind label %30

27:                                               ; preds = %24
  store i1 false, ptr %7, align 1
  call void @_ZNSt10unique_ptrIN4rbdt22SimpleFaceletsDetectorESt14default_deleteIS1_EEC2IS3_vEEPS1_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef %25) #8
  %28 = getelementptr inbounds %"class.rbdt::RubikProcessorBuilder", ptr %21, i32 0, i32 5
  %29 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt10unique_ptrIN4rbdt21RubikFaceletsDetectorESt14default_deleteIS1_EEaSINS0_22SimpleFaceletsDetectorES2_IS6_EEENSt9enable_ifIXsr6__and_ISt6__and_IJSt14is_convertibleINS_IT_T0_E7pointerEPS1_ESt6__not_ISt8is_arrayISB_EEEESt13is_assignableIRS3_OSC_EEE5valueERS4_E4typeEOSD_(ptr noundef nonnull align 8 dereferenceable(8) %28, ptr noundef nonnull align 8 dereferenceable(8) %3) #8
  call void @_ZNSt10unique_ptrIN4rbdt22SimpleFaceletsDetectorESt14default_deleteIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %3) #8
  call void @_ZNSt12__shared_ptrIN4rbdt10ImageSaverELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %4) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #8
  br label %37

30:                                               ; preds = %24
  %31 = landingpad { ptr, i32 }
          cleanup
  %32 = extractvalue { ptr, i32 } %31, 0
  store ptr %32, ptr %5, align 8
  %33 = extractvalue { ptr, i32 } %31, 1
  store i32 %33, ptr %6, align 4
  call void @_ZNSt12__shared_ptrIN4rbdt10ImageSaverELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %4) #8
  %34 = load i1, ptr %7, align 1
  br i1 %34, label %35, label %36

35:                                               ; preds = %30
  call void @_ZdlPvm(ptr noundef %25, i64 noundef 16) #10
  br label %36

36:                                               ; preds = %35, %30
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #8
  br label %109

37:                                               ; preds = %27, %1
  %38 = getelementptr inbounds %"class.rbdt::RubikProcessorBuilder", ptr %21, i32 0, i32 4
  %39 = call noundef zeroext i1 @_ZSteqIN4rbdt18RubikColorDetectorESt14default_deleteIS1_EEbRKSt10unique_ptrIT_T0_EDn(ptr noundef nonnull align 8 dereferenceable(8) %38, ptr null) #8
  br i1 %39, label %40, label %53

40:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #8
  %41 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 16) #9
  store i1 true, ptr %10, align 1
  %42 = getelementptr inbounds %"class.rbdt::RubikProcessorBuilder", ptr %21, i32 0, i32 6
  call void @_ZNSt10shared_ptrIN4rbdt10ImageSaverEEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef nonnull align 8 dereferenceable(16) %42) #8
  invoke void @_ZN4rbdt22HistogramColorDetectorC1ESt10shared_ptrINS_10ImageSaverEE(ptr noundef nonnull align 8 dereferenceable(16) %41, ptr noundef %9)
          to label %43 unwind label %46

43:                                               ; preds = %40
  store i1 false, ptr %10, align 1
  call void @_ZNSt10unique_ptrIN4rbdt22HistogramColorDetectorESt14default_deleteIS1_EEC2IS3_vEEPS1_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef %41) #8
  %44 = getelementptr inbounds %"class.rbdt::RubikProcessorBuilder", ptr %21, i32 0, i32 4
  %45 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt10unique_ptrIN4rbdt18RubikColorDetectorESt14default_deleteIS1_EEaSINS0_22HistogramColorDetectorES2_IS6_EEENSt9enable_ifIXsr6__and_ISt6__and_IJSt14is_convertibleINS_IT_T0_E7pointerEPS1_ESt6__not_ISt8is_arrayISB_EEEESt13is_assignableIRS3_OSC_EEE5valueERS4_E4typeEOSD_(ptr noundef nonnull align 8 dereferenceable(8) %44, ptr noundef nonnull align 8 dereferenceable(8) %8) #8
  call void @_ZNSt10unique_ptrIN4rbdt22HistogramColorDetectorESt14default_deleteIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %8) #8
  call void @_ZNSt12__shared_ptrIN4rbdt10ImageSaverELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %9) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  br label %53

46:                                               ; preds = %40
  %47 = landingpad { ptr, i32 }
          cleanup
  %48 = extractvalue { ptr, i32 } %47, 0
  store ptr %48, ptr %5, align 8
  %49 = extractvalue { ptr, i32 } %47, 1
  store i32 %49, ptr %6, align 4
  call void @_ZNSt12__shared_ptrIN4rbdt10ImageSaverELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %9) #8
  %50 = load i1, ptr %10, align 1
  br i1 %50, label %51, label %52

51:                                               ; preds = %46
  call void @_ZdlPvm(ptr noundef %41, i64 noundef 16) #10
  br label %52

52:                                               ; preds = %51, %46
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  br label %109

53:                                               ; preds = %43, %37
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #8
  %54 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 24) #9
  %55 = getelementptr inbounds %"class.rbdt::RubikProcessorBuilder", ptr %21, i32 0, i32 3
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %12, ptr align 4 %55, i64 12, i1 false), !tbaa.struct !9
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %13, ptr align 4 %12, i64 12, i1 false)
  %56 = getelementptr inbounds { i64, i8 }, ptr %13, i32 0, i32 0
  %57 = load i64, ptr %56, align 4
  %58 = getelementptr inbounds { i64, i8 }, ptr %13, i32 0, i32 1
  %59 = load i8, ptr %58, align 4
  invoke void @_ZN4rbdt22FaceletsDrawControllerC1ENS_10DrawConfigE(ptr noundef nonnull align 8 dereferenceable(21) %54, i64 %57, i8 %59)
          to label %60 unwind label %87

60:                                               ; preds = %53
  call void @_ZNSt10unique_ptrIN4rbdt22FaceletsDrawControllerESt14default_deleteIS1_EEC2IS3_vEEPS1_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef %54) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #8
  %61 = invoke noalias noundef nonnull ptr @_Znwm(i64 noundef 16) #9
          to label %62 unwind label %91

62:                                               ; preds = %60
  store i1 true, ptr %20, align 1
  %63 = getelementptr inbounds %"class.rbdt::RubikProcessorBuilder", ptr %21, i32 0, i32 0
  %64 = load i32, ptr %63, align 8, !tbaa !16
  %65 = getelementptr inbounds %"class.rbdt::RubikProcessorBuilder", ptr %21, i32 0, i32 1
  %66 = load i32, ptr %65, align 4, !tbaa !35
  %67 = getelementptr inbounds %"class.rbdt::RubikProcessorBuilder", ptr %21, i32 0, i32 2
  %68 = load i32, ptr %67, align 8, !tbaa !36
  invoke void @_ZN4rbdt15ImagePropertiesC1EiiNS_14RubikProcessor11ImageFormatE(ptr noundef nonnull align 4 dereferenceable(16) %15, i32 noundef %64, i32 noundef %66, i32 noundef %68)
          to label %69 unwind label %95

69:                                               ; preds = %62
  %70 = getelementptr inbounds %"class.rbdt::RubikProcessorBuilder", ptr %21, i32 0, i32 5
  call void @_ZNSt10unique_ptrIN4rbdt21RubikFaceletsDetectorESt14default_deleteIS1_EEC2EOS4_(ptr noundef nonnull align 8 dereferenceable(8) %16, ptr noundef nonnull align 8 dereferenceable(8) %70) #8
  %71 = getelementptr inbounds %"class.rbdt::RubikProcessorBuilder", ptr %21, i32 0, i32 4
  call void @_ZNSt10unique_ptrIN4rbdt18RubikColorDetectorESt14default_deleteIS1_EEC2EOS4_(ptr noundef nonnull align 8 dereferenceable(8) %17, ptr noundef nonnull align 8 dereferenceable(8) %71) #8
  call void @_ZNSt10unique_ptrIN4rbdt22FaceletsDrawControllerESt14default_deleteIS1_EEC2EOS4_(ptr noundef nonnull align 8 dereferenceable(8) %18, ptr noundef nonnull align 8 dereferenceable(8) %11) #8
  %72 = getelementptr inbounds %"class.rbdt::RubikProcessorBuilder", ptr %21, i32 0, i32 6
  call void @_ZNSt10shared_ptrIN4rbdt10ImageSaverEEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(16) %19, ptr noundef nonnull align 8 dereferenceable(16) %72) #8
  %73 = getelementptr inbounds { i64, i64 }, ptr %15, i32 0, i32 0
  %74 = load i64, ptr %73, align 4
  %75 = getelementptr inbounds { i64, i64 }, ptr %15, i32 0, i32 1
  %76 = load i64, ptr %75, align 4
  invoke void @_ZN4rbdt14RubikProcessorC1ENS_15ImagePropertiesESt10unique_ptrINS_21RubikFaceletsDetectorESt14default_deleteIS3_EES2_INS_18RubikColorDetectorES4_IS7_EES2_INS_22FaceletsDrawControllerES4_ISA_EESt10shared_ptrINS_10ImageSaverEE(ptr noundef nonnull align 8 dereferenceable(16) %61, i64 %74, i64 %76, ptr noundef %16, ptr noundef %17, ptr noundef %18, ptr noundef %19)
          to label %77 unwind label %99

77:                                               ; preds = %69
  store i1 false, ptr %20, align 1
  call void @_ZNSt12__shared_ptrIN4rbdt10ImageSaverELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %19) #8
  call void @_ZNSt10unique_ptrIN4rbdt22FaceletsDrawControllerESt14default_deleteIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %18) #8
  call void @_ZNSt10unique_ptrIN4rbdt18RubikColorDetectorESt14default_deleteIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %17) #8
  call void @_ZNSt10unique_ptrIN4rbdt21RubikFaceletsDetectorESt14default_deleteIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %16) #8
  store ptr %61, ptr %14, align 8, !tbaa !5
  %78 = load ptr, ptr %14, align 8, !tbaa !5
  %79 = getelementptr inbounds %"class.rbdt::RubikProcessorBuilder", ptr %21, i32 0, i32 7
  %80 = load i8, ptr %79, align 8, !tbaa !37, !range !38, !noundef !39
  %81 = trunc i8 %80 to i1
  %82 = load ptr, ptr %78, align 8, !tbaa !40
  %83 = getelementptr inbounds ptr, ptr %82, i64 2
  %84 = load ptr, ptr %83, align 8
  invoke void %84(ptr noundef nonnull align 8 dereferenceable(16) %78, i1 noundef zeroext %81)
          to label %85 unwind label %91

85:                                               ; preds = %77
  %86 = load ptr, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  call void @_ZNSt10unique_ptrIN4rbdt22FaceletsDrawControllerESt14default_deleteIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %11) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #8
  ret ptr %86

87:                                               ; preds = %53
  %88 = landingpad { ptr, i32 }
          cleanup
  %89 = extractvalue { ptr, i32 } %88, 0
  store ptr %89, ptr %5, align 8
  %90 = extractvalue { ptr, i32 } %88, 1
  store i32 %90, ptr %6, align 4
  call void @_ZdlPvm(ptr noundef %54, i64 noundef 24) #10
  br label %108

91:                                               ; preds = %77, %60
  %92 = landingpad { ptr, i32 }
          cleanup
  %93 = extractvalue { ptr, i32 } %92, 0
  store ptr %93, ptr %5, align 8
  %94 = extractvalue { ptr, i32 } %92, 1
  store i32 %94, ptr %6, align 4
  br label %107

95:                                               ; preds = %62
  %96 = landingpad { ptr, i32 }
          cleanup
  %97 = extractvalue { ptr, i32 } %96, 0
  store ptr %97, ptr %5, align 8
  %98 = extractvalue { ptr, i32 } %96, 1
  store i32 %98, ptr %6, align 4
  br label %103

99:                                               ; preds = %69
  %100 = landingpad { ptr, i32 }
          cleanup
  %101 = extractvalue { ptr, i32 } %100, 0
  store ptr %101, ptr %5, align 8
  %102 = extractvalue { ptr, i32 } %100, 1
  store i32 %102, ptr %6, align 4
  call void @_ZNSt12__shared_ptrIN4rbdt10ImageSaverELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %19) #8
  call void @_ZNSt10unique_ptrIN4rbdt22FaceletsDrawControllerESt14default_deleteIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %18) #8
  call void @_ZNSt10unique_ptrIN4rbdt18RubikColorDetectorESt14default_deleteIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %17) #8
  call void @_ZNSt10unique_ptrIN4rbdt21RubikFaceletsDetectorESt14default_deleteIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %16) #8
  br label %103

103:                                              ; preds = %99, %95
  %104 = load i1, ptr %20, align 1
  br i1 %104, label %105, label %106

105:                                              ; preds = %103
  call void @_ZdlPvm(ptr noundef %61, i64 noundef 16) #10
  br label %106

106:                                              ; preds = %105, %103
  br label %107

107:                                              ; preds = %106, %91
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  call void @_ZNSt10unique_ptrIN4rbdt22FaceletsDrawControllerESt14default_deleteIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %11) #8
  br label %108

108:                                              ; preds = %107, %87
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #8
  br label %109

109:                                              ; preds = %108, %52, %36
  %110 = load ptr, ptr %5, align 8
  %111 = load i32, ptr %6, align 4
  %112 = insertvalue { ptr, i32 } poison, ptr %110, 0
  %113 = insertvalue { ptr, i32 } %112, i32 %111, 1
  resume { ptr, i32 } %113
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZSteqIN4rbdt21RubikFaceletsDetectorESt14default_deleteIS1_EEbRKSt10unique_ptrIT_T0_EDn(ptr noundef nonnull align 8 dereferenceable(8), ptr) #2

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

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

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

declare void @_ZN4rbdt22SimpleFaceletsDetectorC1ESt10shared_ptrINS_10ImageSaverEE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) unnamed_addr #6

declare i32 @__gxx_personality_v0(...)

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt12__shared_ptrIN4rbdt10ImageSaverELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #5 align 2

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZSteqIN4rbdt18RubikColorDetectorESt14default_deleteIS1_EEbRKSt10unique_ptrIT_T0_EDn(ptr noundef nonnull align 8 dereferenceable(8), ptr) #2

declare void @_ZN4rbdt22HistogramColorDetectorC1ESt10shared_ptrINS_10ImageSaverEE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) unnamed_addr #6

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

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

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

declare void @_ZN4rbdt22FaceletsDrawControllerC1ENS_10DrawConfigE(ptr noundef nonnull align 8 dereferenceable(21), i64, i8) unnamed_addr #6

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

declare void @_ZN4rbdt15ImagePropertiesC1EiiNS_14RubikProcessor11ImageFormatE(ptr noundef nonnull align 4 dereferenceable(16), i32 noundef, i32 noundef, i32 noundef) unnamed_addr #6

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

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

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

declare void @_ZN4rbdt14RubikProcessorC1ENS_15ImagePropertiesESt10unique_ptrINS_21RubikFaceletsDetectorESt14default_deleteIS3_EES2_INS_18RubikColorDetectorES4_IS7_EES2_INS_22FaceletsDrawControllerES4_ISA_EESt10shared_ptrINS_10ImageSaverEE(ptr noundef nonnull align 8 dereferenceable(16), i64, i64, ptr noundef, ptr noundef, ptr noundef, ptr noundef) unnamed_addr #6

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt10unique_ptrIN4rbdt21RubikFaceletsDetectorESt14default_deleteIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #5 align 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 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { "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 #7 = { 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 #8 = { nounwind }
attributes #9 = { builtin allocsize(0) }
attributes #10 = { 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 = !{i64 0, i64 4, !10, i64 4, i64 4, !12, i64 8, i64 1, !14}
!10 = !{!11, !11, i64 0}
!11 = !{!"_ZTSN4rbdt10DrawConfig8DrawModeE", !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = !{!15, !15, i64 0}
!15 = !{!"bool", !7, i64 0}
!16 = !{!17, !13, i64 0}
!17 = !{!"_ZTSN4rbdt21RubikProcessorBuilderE", !13, i64 0, !13, i64 4, !18, i64 8, !19, i64 12, !20, i64 24, !26, i64 32, !32, i64 40, !15, i64 56}
!18 = !{!"_ZTSN4rbdt14RubikProcessor11ImageFormatE", !7, i64 0}
!19 = !{!"_ZTSN4rbdt10DrawConfigE", !11, i64 0, !13, i64 4, !15, i64 8}
!20 = !{!"_ZTSSt10unique_ptrIN4rbdt18RubikColorDetectorESt14default_deleteIS1_EE", !21, i64 0}
!21 = !{!"_ZTSSt15__uniq_ptr_dataIN4rbdt18RubikColorDetectorESt14default_deleteIS1_ELb1ELb1EE", !22, i64 0}
!22 = !{!"_ZTSSt15__uniq_ptr_implIN4rbdt18RubikColorDetectorESt14default_deleteIS1_EE", !23, i64 0}
!23 = !{!"_ZTSSt5tupleIJPN4rbdt18RubikColorDetectorESt14default_deleteIS1_EEE", !24, i64 0}
!24 = !{!"_ZTSSt11_Tuple_implILm0EJPN4rbdt18RubikColorDetectorESt14default_deleteIS1_EEE", !25, i64 0}
!25 = !{!"_ZTSSt10_Head_baseILm0EPN4rbdt18RubikColorDetectorELb0EE", !6, i64 0}
!26 = !{!"_ZTSSt10unique_ptrIN4rbdt21RubikFaceletsDetectorESt14default_deleteIS1_EE", !27, i64 0}
!27 = !{!"_ZTSSt15__uniq_ptr_dataIN4rbdt21RubikFaceletsDetectorESt14default_deleteIS1_ELb1ELb1EE", !28, i64 0}
!28 = !{!"_ZTSSt15__uniq_ptr_implIN4rbdt21RubikFaceletsDetectorESt14default_deleteIS1_EE", !29, i64 0}
!29 = !{!"_ZTSSt5tupleIJPN4rbdt21RubikFaceletsDetectorESt14default_deleteIS1_EEE", !30, i64 0}
!30 = !{!"_ZTSSt11_Tuple_implILm0EJPN4rbdt21RubikFaceletsDetectorESt14default_deleteIS1_EEE", !31, i64 0}
!31 = !{!"_ZTSSt10_Head_baseILm0EPN4rbdt21RubikFaceletsDetectorELb0EE", !6, i64 0}
!32 = !{!"_ZTSSt10shared_ptrIN4rbdt10ImageSaverEE", !33, i64 0}
!33 = !{!"_ZTSSt12__shared_ptrIN4rbdt10ImageSaverELN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0, !34, i64 8}
!34 = !{!"_ZTSSt14__shared_countILN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0}
!35 = !{!17, !13, i64 4}
!36 = !{!17, !18, i64 8}
!37 = !{!17, !15, i64 56}
!38 = !{i8 0, i8 2}
!39 = !{}
!40 = !{!41, !41, i64 0}
!41 = !{!"vtable pointer", !8, i64 0}


; 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::unique_ptr.10" = type { %"struct.std::__uniq_ptr_data.11" }
%"struct.std::__uniq_ptr_data.11" = type { %"class.std::__uniq_ptr_impl.12" }
%"class.std::__uniq_ptr_impl.12" = type { %"class.std::tuple.13" }
%"class.std::tuple.13" = type { %"struct.std::_Tuple_impl.14" }
%"struct.std::_Tuple_impl.14" = type { %"struct.std::_Head_base.17" }
%"struct.std::_Head_base.17" = type { ptr }
%"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 }
%"class.std::unique_ptr.26" = type { %"struct.std::__uniq_ptr_data.27" }
%"struct.std::__uniq_ptr_data.27" = type { %"class.std::__uniq_ptr_impl.28" }
%"class.std::__uniq_ptr_impl.28" = type { %"class.std::tuple.29" }
%"class.std::tuple.29" = type { %"struct.std::_Tuple_impl.30" }
%"struct.std::_Tuple_impl.30" = type { %"struct.std::_Head_base.33" }
%"struct.std::_Head_base.33" = type { ptr }
%"class.std::unique_ptr.42" = type { %"struct.std::__uniq_ptr_data.43" }
%"struct.std::__uniq_ptr_data.43" = type { %"class.std::__uniq_ptr_impl.44" }
%"class.std::__uniq_ptr_impl.44" = type { %"class.std::tuple.45" }
%"class.std::tuple.45" = type { %"struct.std::_Tuple_impl.46" }
%"struct.std::_Tuple_impl.46" = type { %"struct.std::_Head_base.49" }
%"struct.std::_Head_base.49" = type { ptr }
%"class.rbdt::ImageProperties" = type { i32, i32, i32, i32 }
%"class.std::unique_ptr.2" = type { %"struct.std::__uniq_ptr_data.3" }
%"struct.std::__uniq_ptr_data.3" = type { %"class.std::__uniq_ptr_impl.4" }
%"class.std::__uniq_ptr_impl.4" = type { %"class.std::tuple.5" }
%"class.std::tuple.5" = type { %"struct.std::_Tuple_impl.6" }
%"struct.std::_Tuple_impl.6" = type { %"struct.std::_Head_base.9" }
%"struct.std::_Head_base.9" = type { ptr }
%"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.1" }
%"struct.std::_Head_base.1" = type { ptr }

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZN4rbdt21RubikProcessorBuilder5buildEv(ptr noundef nonnull align 8 dereferenceable(57) %0) local_unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"class.std::unique_ptr.10", align 8
  %3 = alloca %"class.std::shared_ptr", align 8
  %4 = alloca %"class.std::unique_ptr.26", align 8
  %5 = alloca %"class.std::shared_ptr", align 8
  %6 = alloca %"class.std::unique_ptr.42", align 8
  %7 = alloca %"class.rbdt::ImageProperties", align 8
  %8 = alloca %"class.std::unique_ptr.2", align 8
  %9 = alloca %"class.std::unique_ptr", align 8
  %10 = alloca %"class.std::unique_ptr.42", align 8
  %11 = alloca %"class.std::shared_ptr", align 8
  %12 = getelementptr inbounds i8, ptr %0, i64 32
  %13 = tail call noundef zeroext i1 @_ZSteqIN4rbdt21RubikFaceletsDetectorESt14default_deleteIS1_EEbRKSt10unique_ptrIT_T0_EDn(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr null) #7
  br i1 %13, label %14, label %21

14:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #7
  %15 = tail call noalias noundef nonnull dereferenceable(16) ptr @_Znwm(i64 noundef 16) #8
  %16 = getelementptr inbounds i8, ptr %0, i64 40
  call void @_ZNSt10shared_ptrIN4rbdt10ImageSaverEEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef nonnull align 8 dereferenceable(16) %16) #7
  invoke void @_ZN4rbdt22SimpleFaceletsDetectorC1ESt10shared_ptrINS_10ImageSaverEE(ptr noundef nonnull align 8 dereferenceable(16) %15, ptr noundef nonnull %3)
          to label %17 unwind label %19

17:                                               ; preds = %14
  call void @_ZNSt10unique_ptrIN4rbdt22SimpleFaceletsDetectorESt14default_deleteIS1_EEC2IS3_vEEPS1_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull %15) #7
  %18 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt10unique_ptrIN4rbdt21RubikFaceletsDetectorESt14default_deleteIS1_EEaSINS0_22SimpleFaceletsDetectorES2_IS6_EEENSt9enable_ifIXsr6__and_ISt6__and_IJSt14is_convertibleINS_IT_T0_E7pointerEPS1_ESt6__not_ISt8is_arrayISB_EEEESt13is_assignableIRS3_OSC_EEE5valueERS4_E4typeEOSD_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %2) #7
  call void @_ZNSt10unique_ptrIN4rbdt22SimpleFaceletsDetectorESt14default_deleteIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %2) #7
  call void @_ZNSt12__shared_ptrIN4rbdt10ImageSaverELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %3) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #7
  br label %21

19:                                               ; preds = %14
  %20 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt12__shared_ptrIN4rbdt10ImageSaverELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %3) #7
  call void @_ZdlPvm(ptr noundef nonnull %15, i64 noundef 16) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #7
  br label %66

21:                                               ; preds = %17, %1
  %22 = getelementptr inbounds i8, ptr %0, i64 24
  %23 = call noundef zeroext i1 @_ZSteqIN4rbdt18RubikColorDetectorESt14default_deleteIS1_EEbRKSt10unique_ptrIT_T0_EDn(ptr noundef nonnull align 8 dereferenceable(8) %22, ptr null) #7
  br i1 %23, label %24, label %31

24:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  %25 = call noalias noundef nonnull dereferenceable(16) ptr @_Znwm(i64 noundef 16) #8
  %26 = getelementptr inbounds i8, ptr %0, i64 40
  call void @_ZNSt10shared_ptrIN4rbdt10ImageSaverEEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 8 dereferenceable(16) %26) #7
  invoke void @_ZN4rbdt22HistogramColorDetectorC1ESt10shared_ptrINS_10ImageSaverEE(ptr noundef nonnull align 8 dereferenceable(16) %25, ptr noundef nonnull %5)
          to label %27 unwind label %29

27:                                               ; preds = %24
  call void @_ZNSt10unique_ptrIN4rbdt22HistogramColorDetectorESt14default_deleteIS1_EEC2IS3_vEEPS1_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull %25) #7
  %28 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt10unique_ptrIN4rbdt18RubikColorDetectorESt14default_deleteIS1_EEaSINS0_22HistogramColorDetectorES2_IS6_EEENSt9enable_ifIXsr6__and_ISt6__and_IJSt14is_convertibleINS_IT_T0_E7pointerEPS1_ESt6__not_ISt8is_arrayISB_EEEESt13is_assignableIRS3_OSC_EEE5valueERS4_E4typeEOSD_(ptr noundef nonnull align 8 dereferenceable(8) %22, ptr noundef nonnull align 8 dereferenceable(8) %4) #7
  call void @_ZNSt10unique_ptrIN4rbdt22HistogramColorDetectorESt14default_deleteIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %4) #7
  call void @_ZNSt12__shared_ptrIN4rbdt10ImageSaverELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %5) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  br label %31

29:                                               ; preds = %24
  %30 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt12__shared_ptrIN4rbdt10ImageSaverELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %5) #7
  call void @_ZdlPvm(ptr noundef nonnull %25, i64 noundef 16) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  br label %66

31:                                               ; preds = %27, %21
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #7
  %32 = call noalias noundef nonnull dereferenceable(24) ptr @_Znwm(i64 noundef 24) #8
  %33 = getelementptr inbounds i8, ptr %0, i64 12
  %.sroa.03.0.copyload = load i64, ptr %33, align 4
  %.sroa.24.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 20
  %.sroa.24.0.copyload = load i8, ptr %.sroa.24.0..sroa_idx, align 4, !tbaa !5
  invoke void @_ZN4rbdt22FaceletsDrawControllerC1ENS_10DrawConfigE(ptr noundef nonnull align 8 dereferenceable(21) %32, i64 %.sroa.03.0.copyload, i8 %.sroa.24.0.copyload)
          to label %34 unwind label %55

34:                                               ; preds = %31
  call void @_ZNSt10unique_ptrIN4rbdt22FaceletsDrawControllerESt14default_deleteIS1_EEC2IS3_vEEPS1_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull %32) #7
  %35 = invoke noalias noundef nonnull dereferenceable(16) ptr @_Znwm(i64 noundef 16) #8
          to label %36 unwind label %57

36:                                               ; preds = %34
  %37 = load i32, ptr %0, align 8, !tbaa !9
  %38 = getelementptr inbounds i8, ptr %0, i64 4
  %39 = load i32, ptr %38, align 4, !tbaa !31
  %40 = getelementptr inbounds i8, ptr %0, i64 8
  %41 = load i32, ptr %40, align 8, !tbaa !32
  invoke void @_ZN4rbdt15ImagePropertiesC1EiiNS_14RubikProcessor11ImageFormatE(ptr noundef nonnull align 4 dereferenceable(16) %7, i32 noundef %37, i32 noundef %39, i32 noundef %41)
          to label %42 unwind label %59

42:                                               ; preds = %36
  call void @_ZNSt10unique_ptrIN4rbdt21RubikFaceletsDetectorESt14default_deleteIS1_EEC2EOS4_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %12) #7
  call void @_ZNSt10unique_ptrIN4rbdt18RubikColorDetectorESt14default_deleteIS1_EEC2EOS4_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %22) #7
  call void @_ZNSt10unique_ptrIN4rbdt22FaceletsDrawControllerESt14default_deleteIS1_EEC2EOS4_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %6) #7
  %43 = getelementptr inbounds i8, ptr %0, i64 40
  call void @_ZNSt10shared_ptrIN4rbdt10ImageSaverEEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef nonnull align 8 dereferenceable(16) %43) #7
  %44 = load i64, ptr %7, align 8
  %45 = getelementptr inbounds i8, ptr %7, i64 8
  %46 = load i64, ptr %45, align 8
  invoke void @_ZN4rbdt14RubikProcessorC1ENS_15ImagePropertiesESt10unique_ptrINS_21RubikFaceletsDetectorESt14default_deleteIS3_EES2_INS_18RubikColorDetectorES4_IS7_EES2_INS_22FaceletsDrawControllerES4_ISA_EESt10shared_ptrINS_10ImageSaverEE(ptr noundef nonnull align 8 dereferenceable(16) %35, i64 %44, i64 %46, ptr noundef nonnull %8, ptr noundef nonnull %9, ptr noundef nonnull %10, ptr noundef nonnull %11)
          to label %47 unwind label %61

47:                                               ; preds = %42
  call void @_ZNSt12__shared_ptrIN4rbdt10ImageSaverELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %11) #7
  call void @_ZNSt10unique_ptrIN4rbdt22FaceletsDrawControllerESt14default_deleteIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %10) #7
  call void @_ZNSt10unique_ptrIN4rbdt18RubikColorDetectorESt14default_deleteIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %9) #7
  call void @_ZNSt10unique_ptrIN4rbdt21RubikFaceletsDetectorESt14default_deleteIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %8) #7
  %48 = getelementptr inbounds i8, ptr %0, i64 56
  %49 = load i8, ptr %48, align 8, !tbaa !33, !range !34, !noundef !35
  %50 = trunc nuw i8 %49 to i1
  %51 = load ptr, ptr %35, align 8, !tbaa !36
  %52 = getelementptr inbounds i8, ptr %51, i64 16
  %53 = load ptr, ptr %52, align 8
  invoke void %53(ptr noundef nonnull align 8 dereferenceable(16) %35, i1 noundef zeroext %50)
          to label %54 unwind label %57

54:                                               ; preds = %47
  call void @_ZNSt10unique_ptrIN4rbdt22FaceletsDrawControllerESt14default_deleteIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  ret ptr %35

55:                                               ; preds = %31
  %56 = landingpad { ptr, i32 }
          cleanup
  call void @_ZdlPvm(ptr noundef nonnull %32, i64 noundef 24) #9
  br label %65

57:                                               ; preds = %47, %34
  %58 = landingpad { ptr, i32 }
          cleanup
  br label %64

59:                                               ; preds = %36
  %60 = landingpad { ptr, i32 }
          cleanup
  br label %63

61:                                               ; preds = %42
  %62 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt12__shared_ptrIN4rbdt10ImageSaverELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %11) #7
  call void @_ZNSt10unique_ptrIN4rbdt22FaceletsDrawControllerESt14default_deleteIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %10) #7
  call void @_ZNSt10unique_ptrIN4rbdt18RubikColorDetectorESt14default_deleteIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %9) #7
  call void @_ZNSt10unique_ptrIN4rbdt21RubikFaceletsDetectorESt14default_deleteIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %8) #7
  br label %63

63:                                               ; preds = %59, %61
  %.pn = phi { ptr, i32 } [ %62, %61 ], [ %60, %59 ]
  call void @_ZdlPvm(ptr noundef nonnull %35, i64 noundef 16) #9
  br label %64

64:                                               ; preds = %63, %57
  %.pn15 = phi { ptr, i32 } [ %58, %57 ], [ %.pn, %63 ]
  call void @_ZNSt10unique_ptrIN4rbdt22FaceletsDrawControllerESt14default_deleteIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6) #7
  br label %65

65:                                               ; preds = %64, %55
  %.pn15.pn = phi { ptr, i32 } [ %.pn15, %64 ], [ %56, %55 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  br label %66

66:                                               ; preds = %65, %29, %19
  %.pn15.pn.pn = phi { ptr, i32 } [ %.pn15.pn, %65 ], [ %30, %29 ], [ %20, %19 ]
  resume { ptr, i32 } %.pn15.pn.pn
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZSteqIN4rbdt21RubikFaceletsDetectorESt14default_deleteIS1_EEbRKSt10unique_ptrIT_T0_EDn(ptr noundef nonnull align 8 dereferenceable(8), ptr) local_unnamed_addr #1

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

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

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

declare void @_ZN4rbdt22SimpleFaceletsDetectorC1ESt10shared_ptrINS_10ImageSaverEE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) unnamed_addr #5

declare i32 @__gxx_personality_v0(...)

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt12__shared_ptrIN4rbdt10ImageSaverELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #4 align 2

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZSteqIN4rbdt18RubikColorDetectorESt14default_deleteIS1_EEbRKSt10unique_ptrIT_T0_EDn(ptr noundef nonnull align 8 dereferenceable(8), ptr) local_unnamed_addr #1

declare void @_ZN4rbdt22HistogramColorDetectorC1ESt10shared_ptrINS_10ImageSaverEE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) unnamed_addr #5

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

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

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

declare void @_ZN4rbdt22FaceletsDrawControllerC1ENS_10DrawConfigE(ptr noundef nonnull align 8 dereferenceable(21), i64, i8) unnamed_addr #5

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

declare void @_ZN4rbdt15ImagePropertiesC1EiiNS_14RubikProcessor11ImageFormatE(ptr noundef nonnull align 4 dereferenceable(16), i32 noundef, i32 noundef, i32 noundef) unnamed_addr #5

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

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

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

declare void @_ZN4rbdt14RubikProcessorC1ENS_15ImagePropertiesESt10unique_ptrINS_21RubikFaceletsDetectorESt14default_deleteIS3_EES2_INS_18RubikColorDetectorES4_IS7_EES2_INS_22FaceletsDrawControllerES4_ISA_EESt10shared_ptrINS_10ImageSaverEE(ptr noundef nonnull align 8 dereferenceable(16), i64, i64, ptr noundef, ptr noundef, ptr noundef, ptr noundef) unnamed_addr #5

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

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

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

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 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #5 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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 #7 = { nounwind }
attributes #8 = { builtin allocsize(0) }
attributes #9 = { 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 = !{!"bool", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !11, i64 0}
!10 = !{!"_ZTSN4rbdt21RubikProcessorBuilderE", !11, i64 0, !11, i64 4, !12, i64 8, !13, i64 12, !15, i64 24, !22, i64 32, !28, i64 40, !6, i64 56}
!11 = !{!"int", !7, i64 0}
!12 = !{!"_ZTSN4rbdt14RubikProcessor11ImageFormatE", !7, i64 0}
!13 = !{!"_ZTSN4rbdt10DrawConfigE", !14, i64 0, !11, i64 4, !6, i64 8}
!14 = !{!"_ZTSN4rbdt10DrawConfig8DrawModeE", !7, i64 0}
!15 = !{!"_ZTSSt10unique_ptrIN4rbdt18RubikColorDetectorESt14default_deleteIS1_EE", !16, i64 0}
!16 = !{!"_ZTSSt15__uniq_ptr_dataIN4rbdt18RubikColorDetectorESt14default_deleteIS1_ELb1ELb1EE", !17, i64 0}
!17 = !{!"_ZTSSt15__uniq_ptr_implIN4rbdt18RubikColorDetectorESt14default_deleteIS1_EE", !18, i64 0}
!18 = !{!"_ZTSSt5tupleIJPN4rbdt18RubikColorDetectorESt14default_deleteIS1_EEE", !19, i64 0}
!19 = !{!"_ZTSSt11_Tuple_implILm0EJPN4rbdt18RubikColorDetectorESt14default_deleteIS1_EEE", !20, i64 0}
!20 = !{!"_ZTSSt10_Head_baseILm0EPN4rbdt18RubikColorDetectorELb0EE", !21, i64 0}
!21 = !{!"any pointer", !7, i64 0}
!22 = !{!"_ZTSSt10unique_ptrIN4rbdt21RubikFaceletsDetectorESt14default_deleteIS1_EE", !23, i64 0}
!23 = !{!"_ZTSSt15__uniq_ptr_dataIN4rbdt21RubikFaceletsDetectorESt14default_deleteIS1_ELb1ELb1EE", !24, i64 0}
!24 = !{!"_ZTSSt15__uniq_ptr_implIN4rbdt21RubikFaceletsDetectorESt14default_deleteIS1_EE", !25, i64 0}
!25 = !{!"_ZTSSt5tupleIJPN4rbdt21RubikFaceletsDetectorESt14default_deleteIS1_EEE", !26, i64 0}
!26 = !{!"_ZTSSt11_Tuple_implILm0EJPN4rbdt21RubikFaceletsDetectorESt14default_deleteIS1_EEE", !27, i64 0}
!27 = !{!"_ZTSSt10_Head_baseILm0EPN4rbdt21RubikFaceletsDetectorELb0EE", !21, i64 0}
!28 = !{!"_ZTSSt10shared_ptrIN4rbdt10ImageSaverEE", !29, i64 0}
!29 = !{!"_ZTSSt12__shared_ptrIN4rbdt10ImageSaverELN9__gnu_cxx12_Lock_policyE2EE", !21, i64 0, !30, i64 8}
!30 = !{!"_ZTSSt14__shared_countILN9__gnu_cxx12_Lock_policyE2EE", !21, i64 0}
!31 = !{!10, !11, i64 4}
!32 = !{!10, !12, i64 8}
!33 = !{!10, !6, i64 56}
!34 = !{i8 0, i8 2}
!35 = !{}
!36 = !{!37, !37, i64 0}
!37 = !{!"vtable pointer", !8, i64 0}


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