; LLVM IR from gigimushroom/DatabaseBackendEngine :: src/catalog/schema.ll (ZNK5cmudb6SchemaeqERKS0_)

; 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.cmudb::Column" = type { i32, i32, i32, %"class.std::__cxx11::basic_string", i8, i32 }
%"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] }

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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK5cmudb6Schema14GetColumnCountEv(ptr noundef nonnull align 8 dereferenceable(64)) #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZNK5cmudb6SchemaeqERKS0_(ptr noundef nonnull align 8 dereferenceable(64) %0, ptr noundef nonnull align 8 dereferenceable(64) %1) #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca i1, align 1
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca %"class.cmudb::Column", align 8
  %10 = alloca ptr, align 8
  %11 = alloca %"class.cmudb::Column", align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %14 = load ptr, ptr %4, align 8
  %15 = load ptr, ptr %5, align 8, !tbaa !5
  %16 = call noundef i32 @_ZNK5cmudb6Schema14GetColumnCountEv(ptr noundef nonnull align 8 dereferenceable(64) %15)
  %17 = call noundef i32 @_ZNK5cmudb6Schema14GetColumnCountEv(ptr noundef nonnull align 8 dereferenceable(64) %14)
  %18 = icmp ne i32 %16, %17
  br i1 %18, label %26, label %19

19:                                               ; preds = %2
  %20 = load ptr, ptr %5, align 8, !tbaa !5
  %21 = call noundef zeroext i1 @_ZNK5cmudb6Schema9IsInlinedEv(ptr noundef nonnull align 8 dereferenceable(64) %20)
  %22 = zext i1 %21 to i32
  %23 = call noundef zeroext i1 @_ZNK5cmudb6Schema9IsInlinedEv(ptr noundef nonnull align 8 dereferenceable(64) %14)
  %24 = zext i1 %23 to i32
  %25 = icmp ne i32 %22, %24
  br i1 %25, label %26, label %27

26:                                               ; preds = %19, %2
  store i1 false, ptr %3, align 1
  br label %63

27:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  store i32 0, ptr %6, align 4, !tbaa !9
  br label %28

28:                                               ; preds = %56, %27
  %29 = load i32, ptr %6, align 4, !tbaa !9
  %30 = load ptr, ptr %5, align 8, !tbaa !5
  %31 = call noundef i32 @_ZNK5cmudb6Schema14GetColumnCountEv(ptr noundef nonnull align 8 dereferenceable(64) %30)
  %32 = icmp slt i32 %29, %31
  br i1 %32, label %34, label %33

33:                                               ; preds = %28
  store i32 2, ptr %7, align 4
  br label %60

34:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.start.p0(i64 56, ptr %9) #4
  %35 = load ptr, ptr %5, align 8, !tbaa !5
  %36 = load i32, ptr %6, align 4, !tbaa !9
  call void @_ZNK5cmudb6Schema9GetColumnEi(ptr dead_on_unwind writable sret(%"class.cmudb::Column") align 8 %9, ptr noundef nonnull align 8 dereferenceable(64) %35, i32 noundef %36)
  store ptr %9, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.start.p0(i64 56, ptr %11) #4
  %37 = load i32, ptr %6, align 4, !tbaa !9
  invoke void @_ZNK5cmudb6Schema9GetColumnEi(ptr dead_on_unwind writable sret(%"class.cmudb::Column") align 8 %11, ptr noundef nonnull align 8 dereferenceable(64) %14, i32 noundef %37)
          to label %38 unwind label %44

38:                                               ; preds = %34
  store ptr %11, ptr %10, align 8, !tbaa !5
  %39 = load ptr, ptr %8, align 8, !tbaa !5
  %40 = load ptr, ptr %10, align 8, !tbaa !5
  %41 = invoke noundef zeroext i1 @_ZNK5cmudb6ColumnneERKS0_(ptr noundef nonnull align 8 dereferenceable(56) %39, ptr noundef nonnull align 8 dereferenceable(56) %40)
          to label %42 unwind label %48

42:                                               ; preds = %38
  br i1 %41, label %43, label %52

43:                                               ; preds = %42
  store i1 false, ptr %3, align 1
  store i32 1, ptr %7, align 4
  br label %53

44:                                               ; preds = %34
  %45 = landingpad { ptr, i32 }
          cleanup
  %46 = extractvalue { ptr, i32 } %45, 0
  store ptr %46, ptr %12, align 8
  %47 = extractvalue { ptr, i32 } %45, 1
  store i32 %47, ptr %13, align 4
  br label %59

48:                                               ; preds = %38
  %49 = landingpad { ptr, i32 }
          cleanup
  %50 = extractvalue { ptr, i32 } %49, 0
  store ptr %50, ptr %12, align 8
  %51 = extractvalue { ptr, i32 } %49, 1
  store i32 %51, ptr %13, align 4
  call void @_ZN5cmudb6ColumnD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %11) #4
  call void @llvm.lifetime.end.p0(i64 56, ptr %11) #4
  br label %59

52:                                               ; preds = %42
  store i32 0, ptr %7, align 4
  br label %53

53:                                               ; preds = %52, %43
  call void @_ZN5cmudb6ColumnD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %11) #4
  call void @llvm.lifetime.end.p0(i64 56, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @_ZN5cmudb6ColumnD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %9) #4
  call void @llvm.lifetime.end.p0(i64 56, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  %54 = load i32, ptr %7, align 4
  switch i32 %54, label %60 [
    i32 0, label %55
  ]

55:                                               ; preds = %53
  br label %56

56:                                               ; preds = %55
  %57 = load i32, ptr %6, align 4, !tbaa !9
  %58 = add nsw i32 %57, 1
  store i32 %58, ptr %6, align 4, !tbaa !9
  br label %28, !llvm.loop !11

59:                                               ; preds = %48, %44
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @_ZN5cmudb6ColumnD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %9) #4
  call void @llvm.lifetime.end.p0(i64 56, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  br label %65

60:                                               ; preds = %53, %33
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  %61 = load i32, ptr %7, align 4
  switch i32 %61, label %70 [
    i32 2, label %62
    i32 1, label %63
  ]

62:                                               ; preds = %60
  store i1 true, ptr %3, align 1
  br label %63

63:                                               ; preds = %62, %60, %26
  %64 = load i1, ptr %3, align 1
  ret i1 %64

65:                                               ; preds = %59
  %66 = load ptr, ptr %12, align 8
  %67 = load i32, ptr %13, align 4
  %68 = insertvalue { ptr, i32 } poison, ptr %66, 0
  %69 = insertvalue { ptr, i32 } %68, i32 %67, 1
  resume { ptr, i32 } %69

70:                                               ; preds = %60
  unreachable
}

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK5cmudb6Schema9GetColumnEi(ptr dead_on_unwind noalias writable sret(%"class.cmudb::Column") align 8, ptr noundef nonnull align 8 dereferenceable(64), i32 noundef) #3 align 2

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.cmudb::Column" = type { i32, i32, i32, %"class.std::__cxx11::basic_string", i8, i32 }
%"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] }

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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK5cmudb6Schema14GetColumnCountEv(ptr noundef nonnull align 8 dereferenceable(64)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZNK5cmudb6SchemaeqERKS0_(ptr noundef nonnull align 8 dereferenceable(64) %0, ptr noundef nonnull align 8 dereferenceable(64) %1) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.cmudb::Column", align 8
  %4 = alloca %"class.cmudb::Column", align 8
  %5 = tail call noundef i32 @_ZNK5cmudb6Schema14GetColumnCountEv(ptr noundef nonnull align 8 dereferenceable(64) %1)
  %6 = tail call noundef i32 @_ZNK5cmudb6Schema14GetColumnCountEv(ptr noundef nonnull align 8 dereferenceable(64) %0)
  %.not = icmp eq i32 %5, %6
  br i1 %.not, label %7, label %.loopexit

7:                                                ; preds = %2
  %8 = tail call noundef zeroext i1 @_ZNK5cmudb6Schema9IsInlinedEv(ptr noundef nonnull align 8 dereferenceable(64) %1)
  %9 = tail call noundef zeroext i1 @_ZNK5cmudb6Schema9IsInlinedEv(ptr noundef nonnull align 8 dereferenceable(64) %0)
  %10 = xor i1 %8, %9
  br i1 %10, label %.loopexit, label %.preheader

.preheader:                                       ; preds = %7
  %11 = tail call noundef i32 @_ZNK5cmudb6Schema14GetColumnCountEv(ptr noundef nonnull align 8 dereferenceable(64) %1)
  %12 = icmp slt i32 %11, 1
  br i1 %12, label %.loopexit, label %.lr.ph

13:                                               ; preds = %22
  %14 = add nuw nsw i32 %.01722, 1
  %15 = call noundef i32 @_ZNK5cmudb6Schema14GetColumnCountEv(ptr noundef nonnull align 8 dereferenceable(64) %1)
  %.not25 = icmp slt i32 %14, %15
  br i1 %.not25, label %.lr.ph, label %.loopexit.loopexit, !llvm.loop !5

.lr.ph:                                           ; preds = %.preheader, %13
  %.01722 = phi i32 [ %14, %13 ], [ 0, %.preheader ]
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %3) #4
  call void @_ZNK5cmudb6Schema9GetColumnEi(ptr dead_on_unwind nonnull writable sret(%"class.cmudb::Column") align 8 %3, ptr noundef nonnull align 8 dereferenceable(64) %1, i32 noundef %.01722)
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %4) #4
  invoke void @_ZNK5cmudb6Schema9GetColumnEi(ptr dead_on_unwind nonnull writable sret(%"class.cmudb::Column") align 8 %4, ptr noundef nonnull align 8 dereferenceable(64) %0, i32 noundef %.01722)
          to label %16 unwind label %18

16:                                               ; preds = %.lr.ph
  %17 = invoke noundef zeroext i1 @_ZNK5cmudb6ColumnneERKS0_(ptr noundef nonnull align 8 dereferenceable(56) %3, ptr noundef nonnull align 8 dereferenceable(56) %4)
          to label %22 unwind label %20

18:                                               ; preds = %.lr.ph
  %19 = landingpad { ptr, i32 }
          cleanup
  br label %23

20:                                               ; preds = %16
  %21 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN5cmudb6ColumnD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %4) #4
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %4) #4
  br label %23

22:                                               ; preds = %16
  call void @_ZN5cmudb6ColumnD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %4) #4
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %4) #4
  call void @_ZN5cmudb6ColumnD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %3) #4
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %3) #4
  br i1 %17, label %.loopexit.loopexit, label %13

23:                                               ; preds = %20, %18
  %.pn = phi { ptr, i32 } [ %21, %20 ], [ %19, %18 ]
  call void @_ZN5cmudb6ColumnD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %3) #4
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %3) #4
  resume { ptr, i32 } %.pn

.loopexit.loopexit:                               ; preds = %22, %13
  %.3.ph = xor i1 %17, true
  br label %.loopexit

.loopexit:                                        ; preds = %.loopexit.loopexit, %.preheader, %2, %7
  %.3 = phi i1 [ false, %7 ], [ false, %2 ], [ true, %.preheader ], [ %.3.ph, %.loopexit.loopexit ]
  ret i1 %.3
}

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK5cmudb6Schema9GetColumnEi(ptr dead_on_unwind noalias writable sret(%"class.cmudb::Column") align 8, ptr noundef nonnull align 8 dereferenceable(64), i32 noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK5cmudb6ColumnneERKS0_(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 8 dereferenceable(56)) local_unnamed_addr #2 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: ConstraintEliminationPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass