; LLVM IR from cruppstahl/upscaledb :: src/4uqi (scanvisitorfactory)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"struct.upscaledb::Db" = type { ptr, ptr, ptr, ptr, %"struct.upscaledb::DbConfig", %"struct.upscaledb::DynamicArray", %"struct.upscaledb::DynamicArray" }
%"struct.upscaledb::DbConfig" = type { i16, i32, i32, i64, i32, i64, i32, i32, %"class.std::__cxx11::basic_string" }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"struct.upscaledb::DynamicArray" = type <{ ptr, i64, i8, [7 x i8] }>
%"struct.upscaledb::SelectStatement" = type <{ i16, i8, i8, i32, %"struct.upscaledb::FunctionDesc", ptr, %"struct.upscaledb::FunctionDesc", ptr, i8, i8, [6 x i8] }>
%"struct.upscaledb::FunctionDesc" = type { i32, %"class.std::__cxx11::basic_string", %"class.std::__cxx11::basic_string" }

@.str.1 = external hidden unnamed_addr constant [85 x i8], align 1
@__FUNCTION__._ZN9upscaledb18ScanVisitorFactory11from_selectEPNS_15SelectStatementEPNS_7LocalDbE = external hidden unnamed_addr constant [12 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [39 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare noundef zeroext i1 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(32)) #1 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZN9upscaledb18ScanVisitorFactory11from_selectEPNS_15SelectStatementEPNS_7LocalDbE(ptr noundef %0, ptr noundef %1) #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  %10 = load ptr, ptr %5, align 8, !tbaa !5
  %11 = getelementptr inbounds %"struct.upscaledb::Db", ptr %10, i32 0, i32 4
  store ptr %11, ptr %6, align 8, !tbaa !5
  %12 = load ptr, ptr %4, align 8, !tbaa !5
  %13 = getelementptr inbounds %"struct.upscaledb::SelectStatement", ptr %12, i32 0, i32 6
  %14 = getelementptr inbounds %"struct.upscaledb::FunctionDesc", ptr %13, i32 0, i32 1
  %15 = call noundef zeroext i1 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(32) %14) #7
  br i1 %15, label %29, label %16

16:                                               ; preds = %2
  %17 = load ptr, ptr %4, align 8, !tbaa !5
  %18 = getelementptr inbounds %"struct.upscaledb::SelectStatement", ptr %17, i32 0, i32 7
  %19 = load ptr, ptr %18, align 8, !tbaa !9
  %20 = icmp eq ptr %19, null
  br i1 %20, label %21, label %29

21:                                               ; preds = %16
  br label %22

22:                                               ; preds = %21
  call void @_ZN9upscaledb11dbg_prepareEiPKciS1_S1_(i32 noundef 0, ptr noundef @.str.1, i32 noundef 148, ptr noundef @__FUNCTION__._ZN9upscaledb18ScanVisitorFactory11from_selectEPNS_15SelectStatementEPNS_7LocalDbE, ptr noundef null)
  %23 = load ptr, ptr %4, align 8, !tbaa !5
  %24 = getelementptr inbounds %"struct.upscaledb::SelectStatement", ptr %23, i32 0, i32 6
  %25 = getelementptr inbounds %"struct.upscaledb::FunctionDesc", ptr %24, i32 0, i32 1
  %26 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %25) #7
  call void (ptr, ...) @_ZN9upscaledb7dbg_logEPKcz(ptr noundef @.str.2, ptr noundef %26)
  br label %27

27:                                               ; preds = %22
  br label %28

28:                                               ; preds = %27
  store ptr null, ptr %3, align 8
  store i32 1, ptr %7, align 4
  br label %244

29:                                               ; preds = %16, %2
  %30 = load ptr, ptr %4, align 8, !tbaa !5
  %31 = getelementptr inbounds %"struct.upscaledb::SelectStatement", ptr %30, i32 0, i32 4
  %32 = getelementptr inbounds %"struct.upscaledb::FunctionDesc", ptr %31, i32 0, i32 2
  %33 = call noundef zeroext i1 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(32) %32) #7
  br i1 %33, label %34, label %52

34:                                               ; preds = %29
  %35 = load ptr, ptr %4, align 8, !tbaa !5
  %36 = getelementptr inbounds %"struct.upscaledb::SelectStatement", ptr %35, i32 0, i32 4
  %37 = getelementptr inbounds %"struct.upscaledb::FunctionDesc", ptr %36, i32 0, i32 1
  %38 = call noundef zeroext i1 @_ZSteqIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_(ptr noundef nonnull align 8 dereferenceable(32) %37, ptr noundef @.str.3)
  br i1 %38, label %39, label %52

39:                                               ; preds = %34
  %40 = load ptr, ptr %4, align 8, !tbaa !5
  %41 = getelementptr inbounds %"struct.upscaledb::SelectStatement", ptr %40, i32 0, i32 6
  %42 = getelementptr inbounds %"struct.upscaledb::FunctionDesc", ptr %41, i32 0, i32 1
  %43 = call noundef zeroext i1 @_ZSteqIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_(ptr noundef nonnull align 8 dereferenceable(32) %42, ptr noundef @.str.4)
  br i1 %43, label %44, label %48

44:                                               ; preds = %39
  %45 = load ptr, ptr %6, align 8, !tbaa !5
  %46 = load ptr, ptr %4, align 8, !tbaa !5
  %47 = call noundef ptr @_ZN9upscaledb25AverageScanVisitorFactory6createEPKNS_8DbConfigEPNS_15SelectStatementE(ptr noundef %45, ptr noundef %46)
  store ptr %47, ptr %3, align 8
  store i32 1, ptr %7, align 4
  br label %244

48:                                               ; preds = %39
  %49 = load ptr, ptr %6, align 8, !tbaa !5
  %50 = load ptr, ptr %4, align 8, !tbaa !5
  %51 = call noundef ptr @_ZN9upscaledb27AverageIfScanVisitorFactory6createEPKNS_8DbConfigEPNS_15SelectStatementE(ptr noundef %49, ptr noundef %50)
  store ptr %51, ptr %3, align 8
  store i32 1, ptr %7, align 4
  br label %244

52:                                               ; preds = %34, %29
  %53 = load ptr, ptr %4, align 8, !tbaa !5
  %54 = getelementptr inbounds %"struct.upscaledb::SelectStatement", ptr %53, i32 0, i32 4
  %55 = getelementptr inbounds %"struct.upscaledb::FunctionDesc", ptr %54, i32 0, i32 2
  %56 = call noundef zeroext i1 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(32) %55) #7
  br i1 %56, label %57, label %75

57:                                               ; preds = %52
  %58 = load ptr, ptr %4, align 8, !tbaa !5
  %59 = getelementptr inbounds %"struct.upscaledb::SelectStatement", ptr %58, i32 0, i32 4
  %60 = getelementptr inbounds %"struct.upscaledb::FunctionDesc", ptr %59, i32 0, i32 1
  %61 = call noundef zeroext i1 @_ZSteqIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_(ptr noundef nonnull align 8 dereferenceable(32) %60, ptr noundef @.str.5)
  br i1 %61, label %62, label %75

62:                                               ; preds = %57
  %63 = load ptr, ptr %4, align 8, !tbaa !5
  %64 = getelementptr inbounds %"struct.upscaledb::SelectStatement", ptr %63, i32 0, i32 6
  %65 = getelementptr inbounds %"struct.upscaledb::FunctionDesc", ptr %64, i32 0, i32 1
  %66 = call noundef zeroext i1 @_ZSteqIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_(ptr noundef nonnull align 8 dereferenceable(32) %65, ptr noundef @.str.4)
  br i1 %66, label %67, label %71

67:                                               ; preds = %62
  %68 = load ptr, ptr %6, align 8, !tbaa !5
  %69 = load ptr, ptr %4, align 8, !tbaa !5
  %70 = call noundef ptr @_ZN9upscaledb24BottomScanVisitorFactory6createEPKNS_8DbConfigEPNS_15SelectStatementE(ptr noundef %68, ptr noundef %69)
  store ptr %70, ptr %3, align 8
  store i32 1, ptr %7, align 4
  br label %244

71:                                               ; preds = %62
  %72 = load ptr, ptr %6, align 8, !tbaa !5
  %73 = load ptr, ptr %4, align 8, !tbaa !5
  %74 = call noundef ptr @_ZN9upscaledb26BottomIfScanVisitorFactory6createEPKNS_8DbConfigEPNS_15SelectStatementE(ptr noundef %72, ptr noundef %73)
  store ptr %74, ptr %3, align 8
  store i32 1, ptr %7, align 4
  br label %244

75:                                               ; preds = %57, %52
  %76 = load ptr, ptr %4, align 8, !tbaa !5
  %77 = getelementptr inbounds %"struct.upscaledb::SelectStatement", ptr %76, i32 0, i32 4
  %78 = getelementptr inbounds %"struct.upscaledb::FunctionDesc", ptr %77, i32 0, i32 2
  %79 = call noundef zeroext i1 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(32) %78) #7
  br i1 %79, label %80, label %98

80:                                               ; preds = %75
  %81 = load ptr, ptr %4, align 8, !tbaa !5
  %82 = getelementptr inbounds %"struct.upscaledb::SelectStatement", ptr %81, i32 0, i32 4
  %83 = getelementptr inbounds %"struct.upscaledb::FunctionDesc", ptr %82, i32 0, i32 1
  %84 = call noundef zeroext i1 @_ZSteqIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_(ptr noundef nonnull align 8 dereferenceable(32) %83, ptr noundef @.str.6)
  br i1 %84, label %85, label %98

85:                                               ; preds = %80
  %86 = load ptr, ptr %4, align 8, !tbaa !5
  %87 = getelementptr inbounds %"struct.upscaledb::SelectStatement", ptr %86, i32 0, i32 6
  %88 = getelementptr inbounds %"struct.upscaledb::FunctionDesc", ptr %87, i32 0, i32 1
  %89 = call noundef zeroext i1 @_ZSteqIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_(ptr noundef nonnull align 8 dereferenceable(32) %88, ptr noundef @.str.4)
  br i1 %89, label %90, label %94

90:                                               ; preds = %85
  %91 = load ptr, ptr %6, align 8, !tbaa !5
  %92 = load ptr, ptr %4, align 8, !tbaa !5
  %93 = call noundef ptr @_ZN9upscaledb23CountScanVisitorFactory6createEPKNS_8DbConfigEPNS_15SelectStatementE(ptr noundef %91, ptr noundef %92)
  store ptr %93, ptr %3, align 8
  store i32 1, ptr %7, align 4
  br label %244

94:                                               ; preds = %85
  %95 = load ptr, ptr %6, align 8, !tbaa !5
  %96 = load ptr, ptr %4, align 8, !tbaa !5
  %97 = call noundef ptr @_ZN9upscaledb25CountIfScanVisitorFactory6createEPKNS_8DbConfigEPNS_15SelectStatementE(ptr noundef %95, ptr noundef %96)
  store ptr %97, ptr %3, align 8
  store i32 1, ptr %7, align 4
  br label %244

98:                                               ; preds = %80, %75
  %99 = load ptr, ptr %4, align 8, !tbaa !5
  %100 = getelementptr inbounds %"struct.upscaledb::SelectStatement", ptr %99, i32 0, i32 4
  %101 = getelementptr inbounds %"struct.upscaledb::FunctionDesc", ptr %100, i32 0, i32 2
  %102 = call noundef zeroext i1 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(32) %101) #7
  br i1 %102, label %103, label %121

103:                                              ; preds = %98
  %104 = load ptr, ptr %4, align 8, !tbaa !5
  %105 = getelementptr inbounds %"struct.upscaledb::SelectStatement", ptr %104, i32 0, i32 4
  %106 = getelementptr inbounds %"struct.upscaledb::FunctionDesc", ptr %105, i32 0, i32 1
  %107 = call noundef zeroext i1 @_ZSteqIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_(ptr noundef nonnull align 8 dereferenceable(32) %106, ptr noundef @.str.7)
  br i1 %107, label %108, label %121

108:                                              ; preds = %103
  %109 = load ptr, ptr %4, align 8, !tbaa !5
  %110 = getelementptr inbounds %"struct.upscaledb::SelectStatement", ptr %109, i32 0, i32 6
  %111 = getelementptr inbounds %"struct.upscaledb::FunctionDesc", ptr %110, i32 0, i32 1
  %112 = call noundef zeroext i1 @_ZSteqIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_(ptr noundef nonnull align 8 dereferenceable(32) %111, ptr noundef @.str.4)
  br i1 %112, label %113, label %117

113:                                              ; preds = %108
  %114 = load ptr, ptr %6, align 8, !tbaa !5
  %115 = load ptr, ptr %4, align 8, !tbaa !5
  %116 = call noundef ptr @_ZN9upscaledb21MaxScanVisitorFactory6createEPKNS_8DbConfigEPNS_15SelectStatementE(ptr noundef %114, ptr noundef %115)
  store ptr %116, ptr %3, align 8
  store i32 1, ptr %7, align 4
  br label %244

117:                                              ; preds = %108
  %118 = load ptr, ptr %6, align 8, !tbaa !5
  %119 = load ptr, ptr %4, align 8, !tbaa !5
  %120 = call noundef ptr @_ZN9upscaledb23MaxIfScanVisitorFactory6createEPKNS_8DbConfigEPNS_15SelectStatementE(ptr noundef %118, ptr noundef %119)
  store ptr %120, ptr %3, align 8
  store i32 1, ptr %7, align 4
  br label %244

121:                                              ; preds = %103, %98
  %122 = load ptr, ptr %4, align 8, !tbaa !5
  %123 = getelementptr inbounds %"struct.upscaledb::SelectStatement", ptr %122, i32 0, i32 4
  %124 = getelementptr inbounds %"struct.upscaledb::FunctionDesc", ptr %123, i32 0, i32 2
  %125 = call noundef zeroext i1 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(32) %124) #7
  br i1 %125, label %126, label %144

126:                                              ; preds = %121
  %127 = load ptr, ptr %4, align 8, !tbaa !5
  %128 = getelementptr inbounds %"struct.upscaledb::SelectStatement", ptr %127, i32 0, i32 4
  %129 = getelementptr inbounds %"struct.upscaledb::FunctionDesc", ptr %128, i32 0, i32 1
  %130 = call noundef zeroext i1 @_ZSteqIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_(ptr noundef nonnull align 8 dereferenceable(32) %129, ptr noundef @.str.8)
  br i1 %130, label %131, label %144

131:                                              ; preds = %126
  %132 = load ptr, ptr %4, align 8, !tbaa !5
  %133 = getelementptr inbounds %"struct.upscaledb::SelectStatement", ptr %132, i32 0, i32 6
  %134 = getelementptr inbounds %"struct.upscaledb::FunctionDesc", ptr %133, i32 0, i32 1
  %135 = call noundef zeroext i1 @_ZSteqIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_(ptr noundef nonnull align 8 dereferenceable(32) %134, ptr noundef @.str.4)
  br i1 %135, label %136, label %140

136:                                              ; preds = %131
  %137 = load ptr, ptr %6, align 8, !tbaa !5
  %138 = load ptr, ptr %4, align 8, !tbaa !5
  %139 = call noundef ptr @_ZN9upscaledb21MinScanVisitorFactory6createEPKNS_8DbConfigEPNS_15SelectStatementE(ptr noundef %137, ptr noundef %138)
  store ptr %139, ptr %3, align 8
  store i32 1, ptr %7, align 4
  br label %244

140:                                              ; preds = %131
  %141 = load ptr, ptr %6, align 8, !tbaa !5
  %142 = load ptr, ptr %4, align 8, !tbaa !5
  %143 = call noundef ptr @_ZN9upscaledb23MinIfScanVisitorFactory6createEPKNS_8DbConfigEPNS_15SelectStatementE(ptr noundef %141, ptr noundef %142)
  store ptr %143, ptr %3, align 8
  store i32 1, ptr %7, align 4
  br label %244

144:                                              ; preds = %126, %121
  %145 = load ptr, ptr %4, align 8, !tbaa !5
  %146 = getelementptr inbounds %"struct.upscaledb::SelectStatement", ptr %145, i32 0, i32 4
  %147 = getelementptr inbounds %"struct.upscaledb::FunctionDesc", ptr %146, i32 0, i32 2
  %148 = call noundef zeroext i1 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(32) %147) #7
  br i1 %148, label %149, label %167

149:                                              ; preds = %144
  %150 = load ptr, ptr %4, align 8, !tbaa !5
  %151 = getelementptr inbounds %"struct.upscaledb::SelectStatement", ptr %150, i32 0, i32 4
  %152 = getelementptr inbounds %"struct.upscaledb::FunctionDesc", ptr %151, i32 0, i32 1
  %153 = call noundef zeroext i1 @_ZSteqIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_(ptr noundef nonnull align 8 dereferenceable(32) %152, ptr noundef @.str.9)
  br i1 %153, label %154, label %167

154:                                              ; preds = %149
  %155 = load ptr, ptr %4, align 8, !tbaa !5
  %156 = getelementptr inbounds %"struct.upscaledb::SelectStatement", ptr %155, i32 0, i32 6
  %157 = getelementptr inbounds %"struct.upscaledb::FunctionDesc", ptr %156, i32 0, i32 1
  %158 = call noundef zeroext i1 @_ZSteqIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_(ptr noundef nonnull align 8 dereferenceable(32) %157, ptr noundef @.str.4)
  br i1 %158, label %159, label %163

159:                                              ; preds = %154
  %160 = load ptr, ptr %6, align 8, !tbaa !5
  %161 = load ptr, ptr %4, align 8, !tbaa !5
  %162 = call noundef ptr @_ZN9upscaledb21SumScanVisitorFactory6createEPKNS_8DbConfigEPNS_15SelectStatementE(ptr noundef %160, ptr noundef %161)
  store ptr %162, ptr %3, align 8
  store i32 1, ptr %7, align 4
  br label %244

163:                                              ; preds = %154
  %164 = load ptr, ptr %6, align 8, !tbaa !5
  %165 = load ptr, ptr %4, align 8, !tbaa !5
  %166 = call noundef ptr @_ZN9upscaledb23SumIfScanVisitorFactory6createEPKNS_8DbConfigEPNS_15SelectStatementE(ptr noundef %164, ptr noundef %165)
  store ptr %166, ptr %3, align 8
  store i32 1, ptr %7, align 4
  br label %244

167:                                              ; preds = %149, %144
  %168 = load ptr, ptr %4, align 8, !tbaa !5
  %169 = getelementptr inbounds %"struct.upscaledb::SelectStatement", ptr %168, i32 0, i32 4
  %170 = getelementptr inbounds %"struct.upscaledb::FunctionDesc", ptr %169, i32 0, i32 2
  %171 = call noundef zeroext i1 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(32) %170) #7
  br i1 %171, label %172, label %190

172:                                              ; preds = %167
  %173 = load ptr, ptr %4, align 8, !tbaa !5
  %174 = getelementptr inbounds %"struct.upscaledb::SelectStatement", ptr %173, i32 0, i32 4
  %175 = getelementptr inbounds %"struct.upscaledb::FunctionDesc", ptr %174, i32 0, i32 1
  %176 = call noundef zeroext i1 @_ZSteqIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_(ptr noundef nonnull align 8 dereferenceable(32) %175, ptr noundef @.str.10)
  br i1 %176, label %177, label %190

177:                                              ; preds = %172
  %178 = load ptr, ptr %4, align 8, !tbaa !5
  %179 = getelementptr inbounds %"struct.upscaledb::SelectStatement", ptr %178, i32 0, i32 6
  %180 = getelementptr inbounds %"struct.upscaledb::FunctionDesc", ptr %179, i32 0, i32 1
  %181 = call noundef zeroext i1 @_ZSteqIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_(ptr noundef nonnull align 8 dereferenceable(32) %180, ptr noundef @.str.4)
  br i1 %181, label %182, label %186

182:                                              ; preds = %177
  %183 = load ptr, ptr %6, align 8, !tbaa !5
  %184 = load ptr, ptr %4, align 8, !tbaa !5
  %185 = call noundef ptr @_ZN9upscaledb21TopScanVisitorFactory6createEPKNS_8DbConfigEPNS_15SelectStatementE(ptr noundef %183, ptr noundef %184)
  store ptr %185, ptr %3, align 8
  store i32 1, ptr %7, align 4
  br label %244

186:                                              ; preds = %177
  %187 = load ptr, ptr %6, align 8, !tbaa !5
  %188 = load ptr, ptr %4, align 8, !tbaa !5
  %189 = call noundef ptr @_ZN9upscaledb23TopIfScanVisitorFactory6createEPKNS_8DbConfigEPNS_15SelectStatementE(ptr noundef %187, ptr noundef %188)
  store ptr %189, ptr %3, align 8
  store i32 1, ptr %7, align 4
  br label %244

190:                                              ; preds = %172, %167
  %191 = load ptr, ptr %4, align 8, !tbaa !5
  %192 = getelementptr inbounds %"struct.upscaledb::SelectStatement", ptr %191, i32 0, i32 4
  %193 = getelementptr inbounds %"struct.upscaledb::FunctionDesc", ptr %192, i32 0, i32 2
  %194 = call noundef zeroext i1 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(32) %193) #7
  br i1 %194, label %195, label %213

195:                                              ; preds = %190
  %196 = load ptr, ptr %4, align 8, !tbaa !5
  %197 = getelementptr inbounds %"struct.upscaledb::SelectStatement", ptr %196, i32 0, i32 4
  %198 = getelementptr inbounds %"struct.upscaledb::FunctionDesc", ptr %197, i32 0, i32 1
  %199 = call noundef zeroext i1 @_ZSteqIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_(ptr noundef nonnull align 8 dereferenceable(32) %198, ptr noundef @.str.11)
  br i1 %199, label %200, label %213

200:                                              ; preds = %195
  %201 = load ptr, ptr %4, align 8, !tbaa !5
  %202 = getelementptr inbounds %"struct.upscaledb::SelectStatement", ptr %201, i32 0, i32 6
  %203 = getelementptr inbounds %"struct.upscaledb::FunctionDesc", ptr %202, i32 0, i32 1
  %204 = call noundef zeroext i1 @_ZSteqIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_(ptr noundef nonnull align 8 dereferenceable(32) %203, ptr noundef @.str.4)
  br i1 %204, label %205, label %209

205:                                              ; preds = %200
  %206 = load ptr, ptr %6, align 8, !tbaa !5
  %207 = load ptr, ptr %4, align 8, !tbaa !5
  %208 = call noundef ptr @_ZN9upscaledb23ValueScanVisitorFactory6createEPKNS_8DbConfigEPNS_15SelectStatementE(ptr noundef %206, ptr noundef %207)
  store ptr %208, ptr %3, align 8
  store i32 1, ptr %7, align 4
  br label %244

209:                                              ; preds = %200
  %210 = load ptr, ptr %6, align 8, !tbaa !5
  %211 = load ptr, ptr %4, align 8, !tbaa !5
  %212 = call noundef ptr @_ZN9upscaledb25ValueIfScanVisitorFactory6createEPKNS_8DbConfigEPNS_15SelectStatementE(ptr noundef %210, ptr noundef %211)
  store ptr %212, ptr %3, align 8
  store i32 1, ptr %7, align 4
  br label %244

213:                                              ; preds = %195, %190
  %214 = load ptr, ptr %4, align 8, !tbaa !5
  %215 = getelementptr inbounds %"struct.upscaledb::SelectStatement", ptr %214, i32 0, i32 5
  %216 = load ptr, ptr %215, align 8, !tbaa !18
  %217 = icmp eq ptr %216, null
  br i1 %217, label %218, label %226

218:                                              ; preds = %213
  br label %219

219:                                              ; preds = %218
  call void @_ZN9upscaledb11dbg_prepareEiPKciS1_S1_(i32 noundef 0, ptr noundef @.str.1, i32 noundef 218, ptr noundef @__FUNCTION__._ZN9upscaledb18ScanVisitorFactory11from_selectEPNS_15SelectStatementEPNS_7LocalDbE, ptr noundef null)
  %220 = load ptr, ptr %4, align 8, !tbaa !5
  %221 = getelementptr inbounds %"struct.upscaledb::SelectStatement", ptr %220, i32 0, i32 4
  %222 = getelementptr inbounds %"struct.upscaledb::FunctionDesc", ptr %221, i32 0, i32 1
  %223 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %222) #7
  call void (ptr, ...) @_ZN9upscaledb7dbg_logEPKcz(ptr noundef @.str.12, ptr noundef %223)
  br label %224

224:                                              ; preds = %219
  br label %225

225:                                              ; preds = %224
  store ptr null, ptr %3, align 8
  store i32 1, ptr %7, align 4
  br label %244

226:                                              ; preds = %213
  %227 = load ptr, ptr %4, align 8, !tbaa !5
  %228 = getelementptr inbounds %"struct.upscaledb::SelectStatement", ptr %227, i32 0, i32 7
  %229 = load ptr, ptr %228, align 8, !tbaa !9
  %230 = icmp eq ptr %229, null
  br i1 %230, label %231, label %240

231:                                              ; preds = %226
  %232 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 32) #8
  %233 = load ptr, ptr %6, align 8, !tbaa !5
  %234 = load ptr, ptr %4, align 8, !tbaa !5
  invoke void @_ZN9upscaledb22PluginProxyScanVisitorC2EPKNS_8DbConfigEPNS_15SelectStatementE(ptr noundef nonnull align 8 dereferenceable(32) %232, ptr noundef %233, ptr noundef %234)
          to label %235 unwind label %236

235:                                              ; preds = %231
  store ptr %232, ptr %3, align 8
  store i32 1, ptr %7, align 4
  br label %244

236:                                              ; preds = %231
  %237 = landingpad { ptr, i32 }
          cleanup
  %238 = extractvalue { ptr, i32 } %237, 0
  store ptr %238, ptr %8, align 8
  %239 = extractvalue { ptr, i32 } %237, 1
  store i32 %239, ptr %9, align 4
  call void @_ZdlPvm(ptr noundef %232, i64 noundef 32) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  br label %246

240:                                              ; preds = %226
  %241 = load ptr, ptr %6, align 8, !tbaa !5
  %242 = load ptr, ptr %4, align 8, !tbaa !5
  %243 = call noundef ptr @_ZN9upscaledb24ScanVisitorFactoryHelper6createINS_24PluginProxyIfScanVisitorEEEPNS_11ScanVisitorEPKNS_8DbConfigEPNS_15SelectStatementE(ptr noundef %241, ptr noundef %242)
  store ptr %243, ptr %3, align 8
  store i32 1, ptr %7, align 4
  br label %244

244:                                              ; preds = %240, %235, %225, %209, %205, %186, %182, %163, %159, %140, %136, %117, %113, %94, %90, %71, %67, %48, %44, %28
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  %245 = load ptr, ptr %3, align 8
  ret ptr %245

246:                                              ; preds = %236
  %247 = load ptr, ptr %8, align 8
  %248 = load i32, ptr %9, align 4
  %249 = insertvalue { ptr, i32 } poison, ptr %247, 0
  %250 = insertvalue { ptr, i32 } %249, i32 %248, 1
  resume { ptr, i32 } %250
}

declare void @_ZN9upscaledb11dbg_prepareEiPKciS1_S1_(i32 noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef) #3

declare void @_ZN9upscaledb7dbg_logEPKcz(ptr noundef, ...) #3

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN9upscaledb25AverageScanVisitorFactory6createEPKNS_8DbConfigEPNS_15SelectStatementE(ptr noundef, ptr noundef) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN9upscaledb27AverageIfScanVisitorFactory6createEPKNS_8DbConfigEPNS_15SelectStatementE(ptr noundef, ptr noundef) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN9upscaledb24BottomScanVisitorFactory6createEPKNS_8DbConfigEPNS_15SelectStatementE(ptr noundef, ptr noundef) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN9upscaledb26BottomIfScanVisitorFactory6createEPKNS_8DbConfigEPNS_15SelectStatementE(ptr noundef, ptr noundef) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN9upscaledb23CountScanVisitorFactory6createEPKNS_8DbConfigEPNS_15SelectStatementE(ptr noundef, ptr noundef) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN9upscaledb25CountIfScanVisitorFactory6createEPKNS_8DbConfigEPNS_15SelectStatementE(ptr noundef, ptr noundef) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN9upscaledb21MaxScanVisitorFactory6createEPKNS_8DbConfigEPNS_15SelectStatementE(ptr noundef, ptr noundef) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN9upscaledb23MaxIfScanVisitorFactory6createEPKNS_8DbConfigEPNS_15SelectStatementE(ptr noundef, ptr noundef) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN9upscaledb21MinScanVisitorFactory6createEPKNS_8DbConfigEPNS_15SelectStatementE(ptr noundef, ptr noundef) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN9upscaledb23MinIfScanVisitorFactory6createEPKNS_8DbConfigEPNS_15SelectStatementE(ptr noundef, ptr noundef) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN9upscaledb21SumScanVisitorFactory6createEPKNS_8DbConfigEPNS_15SelectStatementE(ptr noundef, ptr noundef) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN9upscaledb23SumIfScanVisitorFactory6createEPKNS_8DbConfigEPNS_15SelectStatementE(ptr noundef, ptr noundef) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN9upscaledb21TopScanVisitorFactory6createEPKNS_8DbConfigEPNS_15SelectStatementE(ptr noundef, ptr noundef) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN9upscaledb23TopIfScanVisitorFactory6createEPKNS_8DbConfigEPNS_15SelectStatementE(ptr noundef, ptr noundef) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN9upscaledb23ValueScanVisitorFactory6createEPKNS_8DbConfigEPNS_15SelectStatementE(ptr noundef, ptr noundef) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN9upscaledb25ValueIfScanVisitorFactory6createEPKNS_8DbConfigEPNS_15SelectStatementE(ptr noundef, ptr noundef) #2 align 2

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN9upscaledb24ScanVisitorFactoryHelper6createINS_24PluginProxyIfScanVisitorEEEPNS_11ScanVisitorEPKNS_8DbConfigEPNS_15SelectStatementE(ptr noundef, ptr noundef) #2 align 2

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 = { "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 = { 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 #5 = { 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 #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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 160}
!10 = !{!"_ZTSN9upscaledb15SelectStatementE", !11, i64 0, !12, i64 2, !13, i64 4, !14, i64 8, !6, i64 80, !14, i64 88, !6, i64 160, !12, i64 168, !12, i64 169}
!11 = !{!"short", !7, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = !{!"_ZTSN9upscaledb12FunctionDescE", !13, i64 0, !15, i64 8, !15, i64 40}
!15 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !16, i64 0, !17, i64 8, !7, i64 16}
!16 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!17 = !{!"long", !7, i64 0}
!18 = !{!10, !6, i64 80}


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

@.str.1 = external hidden unnamed_addr constant [85 x i8], align 1
@__FUNCTION__._ZN9upscaledb18ScanVisitorFactory11from_selectEPNS_15SelectStatementEPNS_7LocalDbE = external hidden unnamed_addr constant [12 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [39 x i8], align 1

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare noundef zeroext i1 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZN9upscaledb18ScanVisitorFactory11from_selectEPNS_15SelectStatementEPNS_7LocalDbE(ptr noundef %0, ptr noundef %1) local_unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %3 = getelementptr inbounds i8, ptr %1, i64 32
  %4 = getelementptr inbounds i8, ptr %0, i64 96
  %5 = tail call noundef zeroext i1 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(32) %4) #6
  br i1 %5, label %12, label %6

6:                                                ; preds = %2
  %7 = getelementptr inbounds i8, ptr %0, i64 160
  %8 = load ptr, ptr %7, align 8, !tbaa !5
  %9 = icmp eq ptr %8, null
  br i1 %9, label %10, label %12

10:                                               ; preds = %6
  tail call void @_ZN9upscaledb11dbg_prepareEiPKciS1_S1_(i32 noundef 0, ptr noundef nonnull @.str.1, i32 noundef 148, ptr noundef nonnull @__FUNCTION__._ZN9upscaledb18ScanVisitorFactory11from_selectEPNS_15SelectStatementEPNS_7LocalDbE, ptr noundef null)
  %11 = tail call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %4) #6
  tail call void (ptr, ...) @_ZN9upscaledb7dbg_logEPKcz(ptr noundef nonnull @.str.2, ptr noundef %11)
  br label %118

12:                                               ; preds = %6, %2
  %13 = getelementptr inbounds i8, ptr %0, i64 48
  %14 = tail call noundef zeroext i1 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(32) %13) #6
  br i1 %14, label %15, label %24

15:                                               ; preds = %12
  %16 = getelementptr inbounds i8, ptr %0, i64 16
  %17 = tail call noundef zeroext i1 @_ZSteqIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_(ptr noundef nonnull align 8 dereferenceable(32) %16, ptr noundef nonnull @.str.3)
  br i1 %17, label %18, label %24

18:                                               ; preds = %15
  %19 = tail call noundef zeroext i1 @_ZSteqIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_(ptr noundef nonnull align 8 dereferenceable(32) %4, ptr noundef nonnull @.str.4)
  br i1 %19, label %20, label %22

20:                                               ; preds = %18
  %21 = tail call noundef ptr @_ZN9upscaledb25AverageScanVisitorFactory6createEPKNS_8DbConfigEPNS_15SelectStatementE(ptr noundef nonnull %3, ptr noundef %0)
  br label %118

22:                                               ; preds = %18
  %23 = tail call noundef ptr @_ZN9upscaledb27AverageIfScanVisitorFactory6createEPKNS_8DbConfigEPNS_15SelectStatementE(ptr noundef nonnull %3, ptr noundef %0)
  br label %118

24:                                               ; preds = %15, %12
  %25 = tail call noundef zeroext i1 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(32) %13) #6
  br i1 %25, label %26, label %35

26:                                               ; preds = %24
  %27 = getelementptr inbounds i8, ptr %0, i64 16
  %28 = tail call noundef zeroext i1 @_ZSteqIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_(ptr noundef nonnull align 8 dereferenceable(32) %27, ptr noundef nonnull @.str.5)
  br i1 %28, label %29, label %35

29:                                               ; preds = %26
  %30 = tail call noundef zeroext i1 @_ZSteqIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_(ptr noundef nonnull align 8 dereferenceable(32) %4, ptr noundef nonnull @.str.4)
  br i1 %30, label %31, label %33

31:                                               ; preds = %29
  %32 = tail call noundef ptr @_ZN9upscaledb24BottomScanVisitorFactory6createEPKNS_8DbConfigEPNS_15SelectStatementE(ptr noundef nonnull %3, ptr noundef %0)
  br label %118

33:                                               ; preds = %29
  %34 = tail call noundef ptr @_ZN9upscaledb26BottomIfScanVisitorFactory6createEPKNS_8DbConfigEPNS_15SelectStatementE(ptr noundef nonnull %3, ptr noundef %0)
  br label %118

35:                                               ; preds = %26, %24
  %36 = tail call noundef zeroext i1 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(32) %13) #6
  br i1 %36, label %37, label %46

37:                                               ; preds = %35
  %38 = getelementptr inbounds i8, ptr %0, i64 16
  %39 = tail call noundef zeroext i1 @_ZSteqIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_(ptr noundef nonnull align 8 dereferenceable(32) %38, ptr noundef nonnull @.str.6)
  br i1 %39, label %40, label %46

40:                                               ; preds = %37
  %41 = tail call noundef zeroext i1 @_ZSteqIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_(ptr noundef nonnull align 8 dereferenceable(32) %4, ptr noundef nonnull @.str.4)
  br i1 %41, label %42, label %44

42:                                               ; preds = %40
  %43 = tail call noundef ptr @_ZN9upscaledb23CountScanVisitorFactory6createEPKNS_8DbConfigEPNS_15SelectStatementE(ptr noundef nonnull %3, ptr noundef %0)
  br label %118

44:                                               ; preds = %40
  %45 = tail call noundef ptr @_ZN9upscaledb25CountIfScanVisitorFactory6createEPKNS_8DbConfigEPNS_15SelectStatementE(ptr noundef nonnull %3, ptr noundef %0)
  br label %118

46:                                               ; preds = %37, %35
  %47 = tail call noundef zeroext i1 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(32) %13) #6
  br i1 %47, label %48, label %57

48:                                               ; preds = %46
  %49 = getelementptr inbounds i8, ptr %0, i64 16
  %50 = tail call noundef zeroext i1 @_ZSteqIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_(ptr noundef nonnull align 8 dereferenceable(32) %49, ptr noundef nonnull @.str.7)
  br i1 %50, label %51, label %57

51:                                               ; preds = %48
  %52 = tail call noundef zeroext i1 @_ZSteqIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_(ptr noundef nonnull align 8 dereferenceable(32) %4, ptr noundef nonnull @.str.4)
  br i1 %52, label %53, label %55

53:                                               ; preds = %51
  %54 = tail call noundef ptr @_ZN9upscaledb21MaxScanVisitorFactory6createEPKNS_8DbConfigEPNS_15SelectStatementE(ptr noundef nonnull %3, ptr noundef %0)
  br label %118

55:                                               ; preds = %51
  %56 = tail call noundef ptr @_ZN9upscaledb23MaxIfScanVisitorFactory6createEPKNS_8DbConfigEPNS_15SelectStatementE(ptr noundef nonnull %3, ptr noundef %0)
  br label %118

57:                                               ; preds = %48, %46
  %58 = tail call noundef zeroext i1 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(32) %13) #6
  br i1 %58, label %59, label %68

59:                                               ; preds = %57
  %60 = getelementptr inbounds i8, ptr %0, i64 16
  %61 = tail call noundef zeroext i1 @_ZSteqIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_(ptr noundef nonnull align 8 dereferenceable(32) %60, ptr noundef nonnull @.str.8)
  br i1 %61, label %62, label %68

62:                                               ; preds = %59
  %63 = tail call noundef zeroext i1 @_ZSteqIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_(ptr noundef nonnull align 8 dereferenceable(32) %4, ptr noundef nonnull @.str.4)
  br i1 %63, label %64, label %66

64:                                               ; preds = %62
  %65 = tail call noundef ptr @_ZN9upscaledb21MinScanVisitorFactory6createEPKNS_8DbConfigEPNS_15SelectStatementE(ptr noundef nonnull %3, ptr noundef %0)
  br label %118

66:                                               ; preds = %62
  %67 = tail call noundef ptr @_ZN9upscaledb23MinIfScanVisitorFactory6createEPKNS_8DbConfigEPNS_15SelectStatementE(ptr noundef nonnull %3, ptr noundef %0)
  br label %118

68:                                               ; preds = %59, %57
  %69 = tail call noundef zeroext i1 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(32) %13) #6
  br i1 %69, label %70, label %79

70:                                               ; preds = %68
  %71 = getelementptr inbounds i8, ptr %0, i64 16
  %72 = tail call noundef zeroext i1 @_ZSteqIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_(ptr noundef nonnull align 8 dereferenceable(32) %71, ptr noundef nonnull @.str.9)
  br i1 %72, label %73, label %79

73:                                               ; preds = %70
  %74 = tail call noundef zeroext i1 @_ZSteqIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_(ptr noundef nonnull align 8 dereferenceable(32) %4, ptr noundef nonnull @.str.4)
  br i1 %74, label %75, label %77

75:                                               ; preds = %73
  %76 = tail call noundef ptr @_ZN9upscaledb21SumScanVisitorFactory6createEPKNS_8DbConfigEPNS_15SelectStatementE(ptr noundef nonnull %3, ptr noundef %0)
  br label %118

77:                                               ; preds = %73
  %78 = tail call noundef ptr @_ZN9upscaledb23SumIfScanVisitorFactory6createEPKNS_8DbConfigEPNS_15SelectStatementE(ptr noundef nonnull %3, ptr noundef %0)
  br label %118

79:                                               ; preds = %70, %68
  %80 = tail call noundef zeroext i1 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(32) %13) #6
  br i1 %80, label %81, label %90

81:                                               ; preds = %79
  %82 = getelementptr inbounds i8, ptr %0, i64 16
  %83 = tail call noundef zeroext i1 @_ZSteqIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_(ptr noundef nonnull align 8 dereferenceable(32) %82, ptr noundef nonnull @.str.10)
  br i1 %83, label %84, label %90

84:                                               ; preds = %81
  %85 = tail call noundef zeroext i1 @_ZSteqIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_(ptr noundef nonnull align 8 dereferenceable(32) %4, ptr noundef nonnull @.str.4)
  br i1 %85, label %86, label %88

86:                                               ; preds = %84
  %87 = tail call noundef ptr @_ZN9upscaledb21TopScanVisitorFactory6createEPKNS_8DbConfigEPNS_15SelectStatementE(ptr noundef nonnull %3, ptr noundef %0)
  br label %118

88:                                               ; preds = %84
  %89 = tail call noundef ptr @_ZN9upscaledb23TopIfScanVisitorFactory6createEPKNS_8DbConfigEPNS_15SelectStatementE(ptr noundef nonnull %3, ptr noundef %0)
  br label %118

90:                                               ; preds = %81, %79
  %91 = tail call noundef zeroext i1 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(32) %13) #6
  br i1 %91, label %92, label %101

92:                                               ; preds = %90
  %93 = getelementptr inbounds i8, ptr %0, i64 16
  %94 = tail call noundef zeroext i1 @_ZSteqIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_(ptr noundef nonnull align 8 dereferenceable(32) %93, ptr noundef nonnull @.str.11)
  br i1 %94, label %95, label %101

95:                                               ; preds = %92
  %96 = tail call noundef zeroext i1 @_ZSteqIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_(ptr noundef nonnull align 8 dereferenceable(32) %4, ptr noundef nonnull @.str.4)
  br i1 %96, label %97, label %99

97:                                               ; preds = %95
  %98 = tail call noundef ptr @_ZN9upscaledb23ValueScanVisitorFactory6createEPKNS_8DbConfigEPNS_15SelectStatementE(ptr noundef nonnull %3, ptr noundef %0)
  br label %118

99:                                               ; preds = %95
  %100 = tail call noundef ptr @_ZN9upscaledb25ValueIfScanVisitorFactory6createEPKNS_8DbConfigEPNS_15SelectStatementE(ptr noundef nonnull %3, ptr noundef %0)
  br label %118

101:                                              ; preds = %92, %90
  %102 = getelementptr inbounds i8, ptr %0, i64 80
  %103 = load ptr, ptr %102, align 8, !tbaa !17
  %104 = icmp eq ptr %103, null
  br i1 %104, label %105, label %108

105:                                              ; preds = %101
  tail call void @_ZN9upscaledb11dbg_prepareEiPKciS1_S1_(i32 noundef 0, ptr noundef nonnull @.str.1, i32 noundef 218, ptr noundef nonnull @__FUNCTION__._ZN9upscaledb18ScanVisitorFactory11from_selectEPNS_15SelectStatementEPNS_7LocalDbE, ptr noundef null)
  %106 = getelementptr inbounds i8, ptr %0, i64 16
  %107 = tail call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %106) #6
  tail call void (ptr, ...) @_ZN9upscaledb7dbg_logEPKcz(ptr noundef nonnull @.str.12, ptr noundef %107)
  br label %118

108:                                              ; preds = %101
  %109 = getelementptr inbounds i8, ptr %0, i64 160
  %110 = load ptr, ptr %109, align 8, !tbaa !5
  %111 = icmp eq ptr %110, null
  br i1 %111, label %112, label %116

112:                                              ; preds = %108
  %113 = tail call noalias noundef nonnull dereferenceable(32) ptr @_Znwm(i64 noundef 32) #7
  invoke void @_ZN9upscaledb22PluginProxyScanVisitorC2EPKNS_8DbConfigEPNS_15SelectStatementE(ptr noundef nonnull align 8 dereferenceable(32) %113, ptr noundef nonnull %3, ptr noundef nonnull %0)
          to label %118 unwind label %114

114:                                              ; preds = %112
  %115 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZdlPvm(ptr noundef nonnull %113, i64 noundef 32) #8
  resume { ptr, i32 } %115

116:                                              ; preds = %108
  %117 = tail call noundef ptr @_ZN9upscaledb24ScanVisitorFactoryHelper6createINS_24PluginProxyIfScanVisitorEEEPNS_11ScanVisitorEPKNS_8DbConfigEPNS_15SelectStatementE(ptr noundef nonnull %3, ptr noundef nonnull %0)
  br label %118

118:                                              ; preds = %112, %116, %105, %99, %97, %88, %86, %77, %75, %66, %64, %55, %53, %44, %42, %33, %31, %22, %20, %10
  %.0 = phi ptr [ %21, %20 ], [ %23, %22 ], [ %32, %31 ], [ %34, %33 ], [ %43, %42 ], [ %45, %44 ], [ %54, %53 ], [ %56, %55 ], [ %65, %64 ], [ %67, %66 ], [ %76, %75 ], [ %78, %77 ], [ %87, %86 ], [ %89, %88 ], [ %98, %97 ], [ %100, %99 ], [ null, %105 ], [ %117, %116 ], [ null, %10 ], [ %113, %112 ]
  ret ptr %.0
}

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

declare void @_ZN9upscaledb7dbg_logEPKcz(ptr noundef, ...) local_unnamed_addr #2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN9upscaledb25AverageScanVisitorFactory6createEPKNS_8DbConfigEPNS_15SelectStatementE(ptr noundef, ptr noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN9upscaledb27AverageIfScanVisitorFactory6createEPKNS_8DbConfigEPNS_15SelectStatementE(ptr noundef, ptr noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN9upscaledb24BottomScanVisitorFactory6createEPKNS_8DbConfigEPNS_15SelectStatementE(ptr noundef, ptr noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN9upscaledb26BottomIfScanVisitorFactory6createEPKNS_8DbConfigEPNS_15SelectStatementE(ptr noundef, ptr noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN9upscaledb23CountScanVisitorFactory6createEPKNS_8DbConfigEPNS_15SelectStatementE(ptr noundef, ptr noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN9upscaledb25CountIfScanVisitorFactory6createEPKNS_8DbConfigEPNS_15SelectStatementE(ptr noundef, ptr noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN9upscaledb21MaxScanVisitorFactory6createEPKNS_8DbConfigEPNS_15SelectStatementE(ptr noundef, ptr noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN9upscaledb23MaxIfScanVisitorFactory6createEPKNS_8DbConfigEPNS_15SelectStatementE(ptr noundef, ptr noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN9upscaledb21MinScanVisitorFactory6createEPKNS_8DbConfigEPNS_15SelectStatementE(ptr noundef, ptr noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN9upscaledb23MinIfScanVisitorFactory6createEPKNS_8DbConfigEPNS_15SelectStatementE(ptr noundef, ptr noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN9upscaledb21SumScanVisitorFactory6createEPKNS_8DbConfigEPNS_15SelectStatementE(ptr noundef, ptr noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN9upscaledb23SumIfScanVisitorFactory6createEPKNS_8DbConfigEPNS_15SelectStatementE(ptr noundef, ptr noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN9upscaledb21TopScanVisitorFactory6createEPKNS_8DbConfigEPNS_15SelectStatementE(ptr noundef, ptr noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN9upscaledb23TopIfScanVisitorFactory6createEPKNS_8DbConfigEPNS_15SelectStatementE(ptr noundef, ptr noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN9upscaledb23ValueScanVisitorFactory6createEPKNS_8DbConfigEPNS_15SelectStatementE(ptr noundef, ptr noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN9upscaledb25ValueIfScanVisitorFactory6createEPKNS_8DbConfigEPNS_15SelectStatementE(ptr noundef, ptr noundef) local_unnamed_addr #1 align 2

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN9upscaledb24ScanVisitorFactoryHelper6createINS_24PluginProxyIfScanVisitorEEEPNS_11ScanVisitorEPKNS_8DbConfigEPNS_15SelectStatementE(ptr noundef, ptr noundef) local_unnamed_addr #1 align 2

attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { inlinehint mustprogress 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 #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 = { 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 #6 = { nounwind }
attributes #7 = { builtin allocsize(0) }
attributes #8 = { 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, !15, i64 160}
!6 = !{!"_ZTSN9upscaledb15SelectStatementE", !7, i64 0, !10, i64 2, !11, i64 4, !12, i64 8, !15, i64 80, !12, i64 88, !15, i64 160, !10, i64 168, !10, i64 169}
!7 = !{!"short", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"bool", !8, i64 0}
!11 = !{!"int", !8, i64 0}
!12 = !{!"_ZTSN9upscaledb12FunctionDescE", !11, i64 0, !13, i64 8, !13, i64 40}
!13 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !14, i64 0, !16, i64 8, !8, i64 16}
!14 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !15, i64 0}
!15 = !{!"any pointer", !8, i64 0}
!16 = !{!"long", !8, i64 0}
!17 = !{!6, !15, i64 80}


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