; LLVM IR from interpretml/interpret :: shared/libebm/Tensor.ll (ZN14NAMESPACE_MAIN6Tensor4CopyERKS0_)

; 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.NAMESPACE_MAIN::Tensor" = type { i64, i64, i64, i64, ptr, i8, [1 x %"struct.NAMESPACE_MAIN::Tensor::DimensionInfo"] }
%"struct.NAMESPACE_MAIN::Tensor::DimensionInfo" = type { i64, ptr, i64 }

@.str = external hidden unnamed_addr constant [80 x i8], align 1
@g_traceLevel = external global i32, align 4
@__func__._ZN14NAMESPACE_MAIN6Tensor4CopyERKS0_ = external hidden unnamed_addr constant [5 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [38 x i8], align 1
@__PRETTY_FUNCTION__._ZN14NAMESPACE_MAIN6Tensor4CopyERKS0_ = external hidden unnamed_addr constant [54 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [44 x i8], align 1
@_ZZN14NAMESPACE_MAIN6Tensor4CopyERKS0_E13LOG__sMessage = external hidden constant [49 x i8], align 16
@.str.15 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [56 x i8], align 1

declare void @LogAssertFailure(i64 noundef, ptr noundef, ptr noundef, ptr noundef) #0

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef zeroext i1 @_ZN14NAMESPACE_MAINL15IsMultiplyErrorImEEbT_S1_(i64 noundef, i64 noundef) #2

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

declare void @InteralLogWithoutArguments(i32 noundef, ptr noundef) #0

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

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(none)
declare i64 @llvm.expect.i64(i64, i64) #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN14NAMESPACE_MAIN6Tensor13GetDimensionsEv(ptr noundef nonnull align 8 dereferenceable(72)) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN14NAMESPACE_MAIN6Tensor14SetCountSlicesEmm(ptr noundef nonnull align 8 dereferenceable(72), i64 noundef, i64 noundef) #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN14NAMESPACE_MAIN6Tensor25EnsureTensorScoreCapacityEm(ptr noundef nonnull align 8 dereferenceable(72), i64 noundef) #5 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN14NAMESPACE_MAIN6Tensor4CopyERKS0_(ptr noundef nonnull align 8 dereferenceable(72) %0, ptr noundef nonnull align 8 dereferenceable(72) %1) #5 align 2 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca i64, align 8
  %14 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %15 = load ptr, ptr %4, align 8
  %16 = getelementptr inbounds %"class.NAMESPACE_MAIN::Tensor", ptr %15, i32 0, i32 3
  %17 = load i64, ptr %16, align 8, !tbaa !9
  %18 = load ptr, ptr %5, align 8, !tbaa !5
  %19 = getelementptr inbounds %"class.NAMESPACE_MAIN::Tensor", ptr %18, i32 0, i32 3
  %20 = load i64, ptr %19, align 8, !tbaa !9
  %21 = icmp eq i64 %17, %20
  br i1 %21, label %24, label %22

22:                                               ; preds = %2
  call void @LogAssertFailure(i64 noundef 171, ptr noundef @.str, ptr noundef @__func__._ZN14NAMESPACE_MAIN6Tensor4CopyERKS0_, ptr noundef @.str.11)
  call void @__assert_fail(ptr noundef @.str.12, ptr noundef @.str, i32 noundef 171, ptr noundef @__PRETTY_FUNCTION__._ZN14NAMESPACE_MAIN6Tensor4CopyERKS0_) #7
  unreachable

23:                                               ; No predecessors!
  br label %24

24:                                               ; preds = %23, %2
  %25 = phi i1 [ true, %2 ], [ false, %23 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #8
  %26 = call noundef ptr @_ZN14NAMESPACE_MAIN6Tensor13GetDimensionsEv(ptr noundef nonnull align 8 dereferenceable(72) %15)
  store ptr %26, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #8
  %27 = load ptr, ptr %5, align 8, !tbaa !5
  %28 = call noundef ptr @_ZNK14NAMESPACE_MAIN6Tensor13GetDimensionsEv(ptr noundef nonnull align 8 dereferenceable(72) %27)
  store ptr %28, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #8
  %29 = getelementptr inbounds %"class.NAMESPACE_MAIN::Tensor", ptr %15, i32 0, i32 1
  %30 = load i64, ptr %29, align 8, !tbaa !13
  store i64 %30, ptr %9, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #8
  store i64 0, ptr %10, align 8, !tbaa !14
  br label %31

31:                                               ; preds = %95, %24
  %32 = load i64, ptr %10, align 8, !tbaa !14
  %33 = getelementptr inbounds %"class.NAMESPACE_MAIN::Tensor", ptr %15, i32 0, i32 3
  %34 = load i64, ptr %33, align 8, !tbaa !9
  %35 = icmp ult i64 %32, %34
  br i1 %35, label %37, label %36

36:                                               ; preds = %31
  store i32 2, ptr %11, align 4
  br label %98

37:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #8
  %38 = load ptr, ptr %8, align 8, !tbaa !5
  %39 = load i64, ptr %10, align 8, !tbaa !14
  %40 = getelementptr inbounds %"struct.NAMESPACE_MAIN::Tensor::DimensionInfo", ptr %38, i64 %39
  store ptr %40, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #8
  %41 = load ptr, ptr %12, align 8, !tbaa !5
  %42 = getelementptr inbounds %"struct.NAMESPACE_MAIN::Tensor::DimensionInfo", ptr %41, i32 0, i32 0
  %43 = load i64, ptr %42, align 8, !tbaa !15
  store i64 %43, ptr %13, align 8, !tbaa !14
  %44 = load i64, ptr %9, align 8, !tbaa !14
  %45 = load i64, ptr %13, align 8, !tbaa !14
  %46 = call noundef zeroext i1 @_ZN14NAMESPACE_MAINL15IsMultiplyErrorImEEbT_S1_(i64 noundef %44, i64 noundef %45) #8
  br i1 %46, label %47, label %49

47:                                               ; preds = %37
  call void @LogAssertFailure(i64 noundef 183, ptr noundef @.str, ptr noundef @__func__._ZN14NAMESPACE_MAIN6Tensor4CopyERKS0_, ptr noundef @.str.13)
  call void @__assert_fail(ptr noundef @.str.14, ptr noundef @.str, i32 noundef 183, ptr noundef @__PRETTY_FUNCTION__._ZN14NAMESPACE_MAIN6Tensor4CopyERKS0_) #7
  unreachable

48:                                               ; No predecessors!
  br label %49

49:                                               ; preds = %48, %37
  %50 = phi i1 [ true, %37 ], [ false, %48 ]
  %51 = load i64, ptr %13, align 8, !tbaa !14
  %52 = load i64, ptr %9, align 8, !tbaa !14
  %53 = mul i64 %52, %51
  store i64 %53, ptr %9, align 8, !tbaa !14
  %54 = load i64, ptr %10, align 8, !tbaa !14
  %55 = load i64, ptr %13, align 8, !tbaa !14
  %56 = call noundef i32 @_ZN14NAMESPACE_MAIN6Tensor14SetCountSlicesEmm(ptr noundef nonnull align 8 dereferenceable(72) %15, i64 noundef %54, i64 noundef %55)
  store i32 %56, ptr %6, align 4, !tbaa !17
  %57 = load i32, ptr %6, align 4, !tbaa !17
  %58 = icmp ne i32 0, %57
  %59 = xor i1 %58, true
  %60 = xor i1 %59, true
  %61 = zext i1 %60 to i64
  %62 = call i64 @llvm.expect.i64(i64 %61, i64 0)
  %63 = icmp ne i64 %62, 0
  br i1 %63, label %64, label %73

64:                                               ; preds = %49
  br label %65

65:                                               ; preds = %64
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #8
  store i32 2, ptr %14, align 4, !tbaa !17
  %66 = load i32, ptr @g_traceLevel, align 4, !tbaa !17
  %67 = icmp sle i32 2, %66
  br i1 %67, label %68, label %69

68:                                               ; preds = %65
  call void @InteralLogWithoutArguments(i32 noundef 2, ptr noundef @_ZZN14NAMESPACE_MAIN6Tensor4CopyERKS0_E13LOG__sMessage)
  br label %69

69:                                               ; preds = %68, %65
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #8
  br label %70

70:                                               ; preds = %69
  br label %71

71:                                               ; preds = %70
  %72 = load i32, ptr %6, align 4, !tbaa !17
  store i32 %72, ptr %3, align 4
  store i32 1, ptr %11, align 4
  br label %92

73:                                               ; preds = %49
  %74 = load i64, ptr %13, align 8, !tbaa !14
  %75 = sub i64 %74, 1
  %76 = call noundef zeroext i1 @_ZN14NAMESPACE_MAINL15IsMultiplyErrorImEEbT_S1_(i64 noundef 8, i64 noundef %75) #8
  br i1 %76, label %77, label %79

77:                                               ; preds = %73
  call void @LogAssertFailure(i64 noundef 191, ptr noundef @.str, ptr noundef @__func__._ZN14NAMESPACE_MAIN6Tensor4CopyERKS0_, ptr noundef @.str.15)
  call void @__assert_fail(ptr noundef @.str.16, ptr noundef @.str, i32 noundef 191, ptr noundef @__PRETTY_FUNCTION__._ZN14NAMESPACE_MAIN6Tensor4CopyERKS0_) #7
  unreachable

78:                                               ; No predecessors!
  br label %79

79:                                               ; preds = %78, %73
  %80 = phi i1 [ true, %73 ], [ false, %78 ]
  %81 = load ptr, ptr %7, align 8, !tbaa !5
  %82 = load i64, ptr %10, align 8, !tbaa !14
  %83 = getelementptr inbounds %"struct.NAMESPACE_MAIN::Tensor::DimensionInfo", ptr %81, i64 %82
  %84 = getelementptr inbounds %"struct.NAMESPACE_MAIN::Tensor::DimensionInfo", ptr %83, i32 0, i32 1
  %85 = load ptr, ptr %84, align 8, !tbaa !19
  %86 = load ptr, ptr %12, align 8, !tbaa !5
  %87 = getelementptr inbounds %"struct.NAMESPACE_MAIN::Tensor::DimensionInfo", ptr %86, i32 0, i32 1
  %88 = load ptr, ptr %87, align 8, !tbaa !19
  %89 = load i64, ptr %13, align 8, !tbaa !14
  %90 = sub i64 %89, 1
  %91 = mul i64 8, %90
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %85, ptr align 8 %88, i64 %91, i1 false)
  store i32 0, ptr %11, align 4
  br label %92

92:                                               ; preds = %79, %71
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #8
  %93 = load i32, ptr %11, align 4
  switch i32 %93, label %98 [
    i32 0, label %94
  ]

94:                                               ; preds = %92
  br label %95

95:                                               ; preds = %94
  %96 = load i64, ptr %10, align 8, !tbaa !14
  %97 = add i64 %96, 1
  store i64 %97, ptr %10, align 8, !tbaa !14
  br label %31, !llvm.loop !20

98:                                               ; preds = %92, %36
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #8
  %99 = load i32, ptr %11, align 4
  switch i32 %99, label %132 [
    i32 2, label %100
  ]

100:                                              ; preds = %98
  %101 = load i64, ptr %9, align 8, !tbaa !14
  %102 = call noundef i32 @_ZN14NAMESPACE_MAIN6Tensor25EnsureTensorScoreCapacityEm(ptr noundef nonnull align 8 dereferenceable(72) %15, i64 noundef %101)
  store i32 %102, ptr %6, align 4, !tbaa !17
  %103 = load i32, ptr %6, align 4, !tbaa !17
  %104 = icmp ne i32 0, %103
  %105 = xor i1 %104, true
  %106 = xor i1 %105, true
  %107 = zext i1 %106 to i64
  %108 = call i64 @llvm.expect.i64(i64 %107, i64 0)
  %109 = icmp ne i64 %108, 0
  br i1 %109, label %110, label %112

110:                                              ; preds = %100
  %111 = load i32, ptr %6, align 4, !tbaa !17
  store i32 %111, ptr %3, align 4
  store i32 1, ptr %11, align 4
  br label %132

112:                                              ; preds = %100
  %113 = load i64, ptr %9, align 8, !tbaa !14
  %114 = call noundef zeroext i1 @_ZN14NAMESPACE_MAINL15IsMultiplyErrorImEEbT_S1_(i64 noundef 8, i64 noundef %113) #8
  br i1 %114, label %115, label %117

115:                                              ; preds = %112
  call void @LogAssertFailure(i64 noundef 200, ptr noundef @.str, ptr noundef @__func__._ZN14NAMESPACE_MAIN6Tensor4CopyERKS0_, ptr noundef @.str.17)
  call void @__assert_fail(ptr noundef @.str.18, ptr noundef @.str, i32 noundef 200, ptr noundef @__PRETTY_FUNCTION__._ZN14NAMESPACE_MAIN6Tensor4CopyERKS0_) #7
  unreachable

116:                                              ; No predecessors!
  br label %117

117:                                              ; preds = %116, %112
  %118 = phi i1 [ true, %112 ], [ false, %116 ]
  %119 = getelementptr inbounds %"class.NAMESPACE_MAIN::Tensor", ptr %15, i32 0, i32 4
  %120 = load ptr, ptr %119, align 8, !tbaa !22
  %121 = load ptr, ptr %5, align 8, !tbaa !5
  %122 = getelementptr inbounds %"class.NAMESPACE_MAIN::Tensor", ptr %121, i32 0, i32 4
  %123 = load ptr, ptr %122, align 8, !tbaa !22
  %124 = load i64, ptr %9, align 8, !tbaa !14
  %125 = mul i64 8, %124
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %120, ptr align 8 %123, i64 %125, i1 false)
  %126 = load ptr, ptr %5, align 8, !tbaa !5
  %127 = getelementptr inbounds %"class.NAMESPACE_MAIN::Tensor", ptr %126, i32 0, i32 5
  %128 = load i8, ptr %127, align 8, !tbaa !23, !range !24, !noundef !25
  %129 = trunc i8 %128 to i1
  %130 = getelementptr inbounds %"class.NAMESPACE_MAIN::Tensor", ptr %15, i32 0, i32 5
  %131 = zext i1 %129 to i8
  store i8 %131, ptr %130, align 8, !tbaa !23
  store i32 0, ptr %3, align 4
  store i32 1, ptr %11, align 4
  br label %132

132:                                              ; preds = %117, %110, %98
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #8
  %133 = load i32, ptr %3, align 4
  ret i32 %133
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK14NAMESPACE_MAIN6Tensor13GetDimensionsEv(ptr noundef nonnull align 8 dereferenceable(72)) #2 align 2

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

attributes #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 = { noreturn 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 #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 = { nocallback nofree nosync nounwind willreturn memory(none) }
attributes #5 = { 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 #6 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #7 = { noreturn nounwind }
attributes #8 = { 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, !11, i64 24}
!10 = !{!"_ZTSN14NAMESPACE_MAIN6TensorE", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !6, i64 32, !12, i64 40, !7, i64 48}
!11 = !{!"long", !7, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{!10, !11, i64 8}
!14 = !{!11, !11, i64 0}
!15 = !{!16, !11, i64 0}
!16 = !{!"_ZTSN14NAMESPACE_MAIN6Tensor13DimensionInfoE", !11, i64 0, !6, i64 8, !11, i64 16}
!17 = !{!18, !18, i64 0}
!18 = !{!"int", !7, i64 0}
!19 = !{!16, !6, i64 8}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = !{!10, !6, i64 32}
!23 = !{!10, !12, i64 40}
!24 = !{i8 0, i8 2}
!25 = !{}


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

%"struct.NAMESPACE_MAIN::Tensor::DimensionInfo" = type { i64, ptr, i64 }

@.str = external hidden unnamed_addr constant [80 x i8], align 1
@g_traceLevel = external local_unnamed_addr global i32, align 4
@__func__._ZN14NAMESPACE_MAIN6Tensor4CopyERKS0_ = external hidden unnamed_addr constant [5 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [38 x i8], align 1
@__PRETTY_FUNCTION__._ZN14NAMESPACE_MAIN6Tensor4CopyERKS0_ = external hidden unnamed_addr constant [54 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [44 x i8], align 1
@_ZZN14NAMESPACE_MAIN6Tensor4CopyERKS0_E13LOG__sMessage = external hidden constant [49 x i8], align 16
@.str.15 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [56 x i8], align 1

declare void @LogAssertFailure(i64 noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef zeroext i1 @_ZN14NAMESPACE_MAINL15IsMultiplyErrorImEEbT_S1_(i64 noundef, i64 noundef) local_unnamed_addr #2

declare void @InteralLogWithoutArguments(i32 noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN14NAMESPACE_MAIN6Tensor13GetDimensionsEv(ptr noundef nonnull align 8 dereferenceable(72)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN14NAMESPACE_MAIN6Tensor14SetCountSlicesEmm(ptr noundef nonnull align 8 dereferenceable(72), i64 noundef, i64 noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN14NAMESPACE_MAIN6Tensor25EnsureTensorScoreCapacityEm(ptr noundef nonnull align 8 dereferenceable(72), i64 noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN14NAMESPACE_MAIN6Tensor4CopyERKS0_(ptr noundef nonnull align 8 dereferenceable(72) %0, ptr noundef nonnull align 8 dereferenceable(72) %1) local_unnamed_addr #3 align 2 {
  %3 = getelementptr inbounds i8, ptr %0, i64 24
  %4 = load i64, ptr %3, align 8, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %1, i64 24
  %6 = load i64, ptr %5, align 8, !tbaa !5
  %7 = icmp eq i64 %4, %6
  br i1 %7, label %9, label %8

8:                                                ; preds = %2
  tail call void @LogAssertFailure(i64 noundef 171, ptr noundef nonnull @.str, ptr noundef nonnull @__func__._ZN14NAMESPACE_MAIN6Tensor4CopyERKS0_, ptr noundef nonnull @.str.11)
  tail call void @__assert_fail(ptr noundef nonnull @.str.12, ptr noundef nonnull @.str, i32 noundef 171, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN14NAMESPACE_MAIN6Tensor4CopyERKS0_) #5
  unreachable

9:                                                ; preds = %2
  %10 = tail call noundef ptr @_ZN14NAMESPACE_MAIN6Tensor13GetDimensionsEv(ptr noundef nonnull align 8 dereferenceable(72) %0)
  %11 = tail call noundef ptr @_ZNK14NAMESPACE_MAIN6Tensor13GetDimensionsEv(ptr noundef nonnull align 8 dereferenceable(72) %1)
  %12 = getelementptr inbounds i8, ptr %0, i64 8
  %13 = load i64, ptr %12, align 8, !tbaa !12
  %14 = load i64, ptr %3, align 8, !tbaa !5
  %.not3848.not = icmp eq i64 %14, 0
  br i1 %.not3848.not, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %9, %30
  %.03150 = phi i64 [ %20, %30 ], [ %13, %9 ]
  %.03549 = phi i64 [ %36, %30 ], [ 0, %9 ]
  %15 = getelementptr inbounds %"struct.NAMESPACE_MAIN::Tensor::DimensionInfo", ptr %11, i64 %.03549
  %16 = load i64, ptr %15, align 8, !tbaa !13
  %17 = tail call noundef zeroext i1 @_ZN14NAMESPACE_MAINL15IsMultiplyErrorImEEbT_S1_(i64 noundef %.03150, i64 noundef %16) #6
  br i1 %17, label %18, label %19

18:                                               ; preds = %.lr.ph
  tail call void @LogAssertFailure(i64 noundef 183, ptr noundef nonnull @.str, ptr noundef nonnull @__func__._ZN14NAMESPACE_MAIN6Tensor4CopyERKS0_, ptr noundef nonnull @.str.13)
  tail call void @__assert_fail(ptr noundef nonnull @.str.14, ptr noundef nonnull @.str, i32 noundef 183, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN14NAMESPACE_MAIN6Tensor4CopyERKS0_) #5
  unreachable

19:                                               ; preds = %.lr.ph
  %20 = mul i64 %16, %.03150
  %21 = tail call noundef i32 @_ZN14NAMESPACE_MAIN6Tensor14SetCountSlicesEmm(ptr noundef nonnull align 8 dereferenceable(72) %0, i64 noundef %.03549, i64 noundef %16)
  %.not = icmp eq i32 %21, 0
  br i1 %.not, label %26, label %22, !prof !15

22:                                               ; preds = %19
  %23 = load i32, ptr @g_traceLevel, align 4, !tbaa !16
  %24 = icmp sgt i32 %23, 1
  br i1 %24, label %25, label %.thread41

25:                                               ; preds = %22
  tail call void @InteralLogWithoutArguments(i32 noundef 2, ptr noundef nonnull @_ZZN14NAMESPACE_MAIN6Tensor4CopyERKS0_E13LOG__sMessage)
  br label %.thread41

26:                                               ; preds = %19
  %27 = add i64 %16, -1
  %28 = tail call noundef zeroext i1 @_ZN14NAMESPACE_MAINL15IsMultiplyErrorImEEbT_S1_(i64 noundef 8, i64 noundef %27) #6
  br i1 %28, label %29, label %30

29:                                               ; preds = %26
  tail call void @LogAssertFailure(i64 noundef 191, ptr noundef nonnull @.str, ptr noundef nonnull @__func__._ZN14NAMESPACE_MAIN6Tensor4CopyERKS0_, ptr noundef nonnull @.str.15)
  tail call void @__assert_fail(ptr noundef nonnull @.str.16, ptr noundef nonnull @.str, i32 noundef 191, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN14NAMESPACE_MAIN6Tensor4CopyERKS0_) #5
  unreachable

30:                                               ; preds = %26
  %31 = getelementptr inbounds %"struct.NAMESPACE_MAIN::Tensor::DimensionInfo", ptr %10, i64 %.03549, i32 1
  %32 = load ptr, ptr %31, align 8, !tbaa !18
  %33 = getelementptr inbounds i8, ptr %15, i64 8
  %34 = load ptr, ptr %33, align 8, !tbaa !18
  %35 = shl i64 %27, 3
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 8 %32, ptr align 8 %34, i64 %35, i1 false)
  %36 = add nuw i64 %.03549, 1
  %37 = load i64, ptr %3, align 8, !tbaa !5
  %.not38 = icmp ult i64 %36, %37
  br i1 %.not38, label %.lr.ph, label %._crit_edge, !llvm.loop !19

._crit_edge:                                      ; preds = %30, %9
  %.031.lcssa = phi i64 [ %13, %9 ], [ %20, %30 ]
  %38 = tail call noundef i32 @_ZN14NAMESPACE_MAIN6Tensor25EnsureTensorScoreCapacityEm(ptr noundef nonnull align 8 dereferenceable(72) %0, i64 noundef %.031.lcssa)
  %.not39 = icmp eq i32 %38, 0
  br i1 %.not39, label %39, label %.thread41, !prof !15

39:                                               ; preds = %._crit_edge
  %40 = tail call noundef zeroext i1 @_ZN14NAMESPACE_MAINL15IsMultiplyErrorImEEbT_S1_(i64 noundef 8, i64 noundef %.031.lcssa) #6
  br i1 %40, label %41, label %42

41:                                               ; preds = %39
  tail call void @LogAssertFailure(i64 noundef 200, ptr noundef nonnull @.str, ptr noundef nonnull @__func__._ZN14NAMESPACE_MAIN6Tensor4CopyERKS0_, ptr noundef nonnull @.str.17)
  tail call void @__assert_fail(ptr noundef nonnull @.str.18, ptr noundef nonnull @.str, i32 noundef 200, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN14NAMESPACE_MAIN6Tensor4CopyERKS0_) #5
  unreachable

42:                                               ; preds = %39
  %43 = getelementptr inbounds i8, ptr %0, i64 32
  %44 = load ptr, ptr %43, align 8, !tbaa !21
  %45 = getelementptr inbounds i8, ptr %1, i64 32
  %46 = load ptr, ptr %45, align 8, !tbaa !21
  %47 = shl i64 %.031.lcssa, 3
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 8 %44, ptr align 8 %46, i64 %47, i1 false)
  %48 = getelementptr inbounds i8, ptr %1, i64 40
  %49 = load i8, ptr %48, align 8, !tbaa !22, !range !23, !noundef !24
  %50 = getelementptr inbounds i8, ptr %0, i64 40
  store i8 %49, ptr %50, align 8, !tbaa !22
  br label %.thread41

.thread41:                                        ; preds = %22, %25, %._crit_edge, %42
  %.3 = phi i32 [ 0, %42 ], [ %38, %._crit_edge ], [ %21, %25 ], [ %21, %22 ]
  ret i32 %.3
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK14NAMESPACE_MAIN6Tensor13GetDimensionsEv(ptr noundef nonnull align 8 dereferenceable(72)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress 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) #4

attributes #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 = { noreturn 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 #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 = { 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { noreturn nounwind }
attributes #6 = { 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, !7, i64 24}
!6 = !{!"_ZTSN14NAMESPACE_MAIN6TensorE", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !10, i64 32, !11, i64 40, !8, i64 48}
!7 = !{!"long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"bool", !8, i64 0}
!12 = !{!6, !7, i64 8}
!13 = !{!14, !7, i64 0}
!14 = !{!"_ZTSN14NAMESPACE_MAIN6Tensor13DimensionInfoE", !7, i64 0, !10, i64 8, !7, i64 16}
!15 = !{!"branch_weights", !"expected", i32 2000, i32 1}
!16 = !{!17, !17, i64 0}
!17 = !{!"int", !8, i64 0}
!18 = !{!14, !10, i64 8}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = !{!6, !10, i64 32}
!22 = !{!6, !11, i64 40}
!23 = !{i8 0, i8 2}
!24 = !{}


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