; LLVM IR from PaddlePaddle/Paddle :: paddle/common/ddim.ll (ZN6common10slice_ddimERKNS_4DDimEii)

; 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.common::DDim" = type <{ %"class.common::Dim", i32, [4 x i8] }>
%"class.common::Dim" = type { %"class.common::Array" }
%"class.common::Array" = type { [9 x i64] }
%"class.common::ErrorSummary" = type { 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] }

@.str.4 = external hidden unnamed_addr constant [75 x i8], align 1
@_ZTIN6common7enforce13EnforceNotMetE = external dso_local constant { ptr, ptr, ptr }, align 8
@.str.8 = external hidden unnamed_addr constant [59 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [55 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [5 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(none)
declare i64 @llvm.expect.i64(i64, i64) #1

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

declare i32 @__gxx_personality_v0(...)

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

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

declare ptr @__cxa_allocate_exception(i64)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK6common12ErrorSummary4codeEv(ptr noundef nonnull align 8 dereferenceable(40)) #2 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6common12ErrorSummaryC2ENS_9ErrorCodeENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(40), i32 noundef, ptr noundef) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6common7enforce13EnforceNotMetC2ERKNS_12ErrorSummaryEPKci(ptr noundef nonnull align 8 dereferenceable(81), ptr noundef nonnull align 8 dereferenceable(40), ptr noundef, i32 noundef) unnamed_addr #3 align 2

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

declare void @__cxa_throw(ptr, ptr, ptr)

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

declare void @__cxa_free_exception(ptr)

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK6common4DDim4sizeEv(ptr noundef nonnull align 8 dereferenceable(76)) #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZNK6common4DDim3GetEv(ptr noundef nonnull align 8 dereferenceable(76)) #5 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6common10slice_ddimERKNS_4DDimEii(ptr dead_on_unwind noalias writable sret(%"class.common::DDim") align 8 %0, ptr noundef nonnull align 8 dereferenceable(76) %1, i32 noundef %2, i32 noundef %3) #3 personality ptr @__gxx_personality_v0 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i8, align 1
  %10 = alloca i8, align 1
  %11 = alloca i8, align 1
  %12 = alloca %"class.common::ErrorSummary", align 8
  %13 = alloca i8, align 1
  %14 = alloca %"class.std::__cxx11::basic_string", align 8
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca %"class.std::__cxx11::basic_string", align 8
  %18 = alloca %"class.std::__cxx11::basic_string", align 8
  %19 = alloca %"class.common::ErrorSummary", align 8
  %20 = alloca %"class.std::__cxx11::basic_string", align 8
  %21 = alloca i1, align 1
  store ptr %0, ptr %5, align 8
  store ptr %1, ptr %6, align 8, !tbaa !5
  store i32 %2, ptr %7, align 4, !tbaa !9
  store i32 %3, ptr %8, align 4, !tbaa !9
  br label %22

22:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #6
  %23 = load i32, ptr %7, align 4, !tbaa !9
  %24 = icmp sge i32 %23, 0
  br i1 %24, label %25, label %30

25:                                               ; preds = %22
  %26 = load i32, ptr %8, align 4, !tbaa !9
  %27 = load ptr, ptr %6, align 8, !tbaa !5
  %28 = call noundef i32 @_ZNK6common4DDim4sizeEv(ptr noundef nonnull align 8 dereferenceable(76) %27)
  %29 = icmp sle i32 %26, %28
  br label %30

30:                                               ; preds = %25, %22
  %31 = phi i1 [ false, %22 ], [ %29, %25 ]
  %32 = zext i1 %31 to i8
  store i8 %32, ptr %9, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 1, ptr %10) #6
  store i8 1, ptr %10, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 1, ptr %11) #6
  %33 = load i8, ptr %9, align 1, !tbaa !11, !range !13, !noundef !14
  %34 = trunc i8 %33 to i1
  %35 = zext i1 %34 to i32
  %36 = load i8, ptr %10, align 1, !tbaa !11, !range !13, !noundef !14
  %37 = trunc i8 %36 to i1
  %38 = zext i1 %37 to i32
  %39 = icmp eq i32 %35, %38
  %40 = zext i1 %39 to i8
  store i8 %40, ptr %11, align 1, !tbaa !11
  %41 = load i8, ptr %11, align 1, !tbaa !11, !range !13, !noundef !14
  %42 = trunc i8 %41 to i1
  %43 = xor i1 %42, true
  %44 = zext i1 %43 to i64
  %45 = call i64 @llvm.expect.i64(i64 %44, i64 0)
  %46 = icmp ne i64 %45, 0
  br i1 %46, label %47, label %101

47:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 40, ptr %12) #6
  %48 = load i32, ptr %7, align 4, !tbaa !9
  %49 = load i32, ptr %8, align 4, !tbaa !9
  %50 = load ptr, ptr %6, align 8, !tbaa !5
  %51 = call noundef i32 @_ZNK6common4DDim4sizeEv(ptr noundef nonnull align 8 dereferenceable(76) %50)
  call void @_ZN6common6errors15InvalidArgumentIJPKciiiEEENS_12ErrorSummaryEDpT_(ptr dead_on_unwind writable sret(%"class.common::ErrorSummary") align 8 %12, ptr noundef @.str.8, i32 noundef %48, i32 noundef %49, i32 noundef %51)
  call void @llvm.lifetime.start.p0(i64 1, ptr %13) #6
  store i8 1, ptr %13, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 32, ptr %14) #6
  %52 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNK6common12ErrorSummary13error_messageB5cxx11Ev(ptr noundef nonnull align 8 dereferenceable(40) %12)
          to label %53 unwind label %63

53:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 32, ptr %17) #6
  invoke void @_ZN6common7enforce7details29BinaryCompareMessageConverterILb1EE7ConvertIbEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPKcRKT_(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %17, ptr noundef @.str.10, ptr noundef nonnull align 1 dereferenceable(1) %9)
          to label %54 unwind label %67

54:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 32, ptr %18) #6
  invoke void @_ZN6common7enforce7details29BinaryCompareMessageConverterILb1EE7ConvertIbEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPKcRKT_(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %18, ptr noundef @.str.11, ptr noundef nonnull align 1 dereferenceable(1) %10)
          to label %55 unwind label %71

55:                                               ; preds = %54
  invoke void @_ZN6paddle6string7SprintfIJNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEA34_cA5_cS7_S7_EEES7_PKcDpRKT_(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %14, ptr noundef @.str.9, ptr noundef nonnull align 8 dereferenceable(32) %52, ptr noundef nonnull align 1 dereferenceable(34) @.str.10, ptr noundef nonnull align 1 dereferenceable(5) @.str.11, ptr noundef nonnull align 8 dereferenceable(32) %17, ptr noundef nonnull align 8 dereferenceable(32) %18)
          to label %56 unwind label %75

56:                                               ; preds = %55
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %18) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %18) #6
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %17) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %17) #6
  br label %57

57:                                               ; preds = %56
  store i1 true, ptr %21, align 1
  %58 = call ptr @__cxa_allocate_exception(i64 88) #6
  call void @llvm.lifetime.start.p0(i64 40, ptr %19) #6
  %59 = invoke noundef i32 @_ZNK6common12ErrorSummary4codeEv(ptr noundef nonnull align 8 dereferenceable(40) %12)
          to label %60 unwind label %81

60:                                               ; preds = %57
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2EOS4_(ptr noundef nonnull align 8 dereferenceable(32) %20, ptr noundef nonnull align 8 dereferenceable(32) %14) #6
  invoke void @_ZN6common12ErrorSummaryC2ENS_9ErrorCodeENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(40) %19, i32 noundef %59, ptr noundef %20)
          to label %61 unwind label %85

61:                                               ; preds = %60
  invoke void @_ZN6common7enforce13EnforceNotMetC2ERKNS_12ErrorSummaryEPKci(ptr noundef nonnull align 8 dereferenceable(81) %58, ptr noundef nonnull align 8 dereferenceable(40) %19, ptr noundef @.str.4, i32 noundef 150)
          to label %62 unwind label %89

62:                                               ; preds = %61
  store i1 false, ptr %21, align 1
  invoke void @__cxa_throw(ptr %58, ptr @_ZTIN6common7enforce13EnforceNotMetE, ptr @_ZN6common7enforce13EnforceNotMetD2Ev) #7
          to label %116 unwind label %89

63:                                               ; preds = %47
  %64 = landingpad { ptr, i32 }
          cleanup
  %65 = extractvalue { ptr, i32 } %64, 0
  store ptr %65, ptr %15, align 8
  %66 = extractvalue { ptr, i32 } %64, 1
  store i32 %66, ptr %16, align 4
  br label %100

67:                                               ; preds = %53
  %68 = landingpad { ptr, i32 }
          cleanup
  %69 = extractvalue { ptr, i32 } %68, 0
  store ptr %69, ptr %15, align 8
  %70 = extractvalue { ptr, i32 } %68, 1
  store i32 %70, ptr %16, align 4
  br label %80

71:                                               ; preds = %54
  %72 = landingpad { ptr, i32 }
          cleanup
  %73 = extractvalue { ptr, i32 } %72, 0
  store ptr %73, ptr %15, align 8
  %74 = extractvalue { ptr, i32 } %72, 1
  store i32 %74, ptr %16, align 4
  br label %79

75:                                               ; preds = %55
  %76 = landingpad { ptr, i32 }
          cleanup
  %77 = extractvalue { ptr, i32 } %76, 0
  store ptr %77, ptr %15, align 8
  %78 = extractvalue { ptr, i32 } %76, 1
  store i32 %78, ptr %16, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %18) #6
  br label %79

79:                                               ; preds = %75, %71
  call void @llvm.lifetime.end.p0(i64 32, ptr %18) #6
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %17) #6
  br label %80

80:                                               ; preds = %79, %67
  call void @llvm.lifetime.end.p0(i64 32, ptr %17) #6
  br label %100

81:                                               ; preds = %57
  %82 = landingpad { ptr, i32 }
          cleanup
  %83 = extractvalue { ptr, i32 } %82, 0
  store ptr %83, ptr %15, align 8
  %84 = extractvalue { ptr, i32 } %82, 1
  store i32 %84, ptr %16, align 4
  br label %94

85:                                               ; preds = %60
  %86 = landingpad { ptr, i32 }
          cleanup
  %87 = extractvalue { ptr, i32 } %86, 0
  store ptr %87, ptr %15, align 8
  %88 = extractvalue { ptr, i32 } %86, 1
  store i32 %88, ptr %16, align 4
  br label %93

89:                                               ; preds = %62, %61
  %90 = landingpad { ptr, i32 }
          cleanup
  %91 = extractvalue { ptr, i32 } %90, 0
  store ptr %91, ptr %15, align 8
  %92 = extractvalue { ptr, i32 } %90, 1
  store i32 %92, ptr %16, align 4
  call void @_ZN6common12ErrorSummaryD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %19) #6
  br label %93

93:                                               ; preds = %89, %85
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %20) #6
  br label %94

94:                                               ; preds = %93, %81
  call void @llvm.lifetime.end.p0(i64 40, ptr %19) #6
  %95 = load i1, ptr %21, align 1
  br i1 %95, label %96, label %97

96:                                               ; preds = %94
  call void @__cxa_free_exception(ptr %58) #6
  br label %97

97:                                               ; preds = %96, %94
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %14) #6
  br label %100

98:                                               ; No predecessors!
  br label %99

99:                                               ; preds = %98
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %14) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #6
  call void @_ZN6common12ErrorSummaryD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %12) #6
  call void @llvm.lifetime.end.p0(i64 40, ptr %12) #6
  br label %101

100:                                              ; preds = %97, %80, %63
  call void @llvm.lifetime.end.p0(i64 32, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #6
  call void @_ZN6common12ErrorSummaryD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %12) #6
  call void @llvm.lifetime.end.p0(i64 40, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #6
  br label %111

101:                                              ; preds = %99, %30
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #6
  br label %102

102:                                              ; preds = %101
  %103 = load ptr, ptr %6, align 8, !tbaa !5
  %104 = call noundef ptr @_ZNK6common4DDim3GetEv(ptr noundef nonnull align 8 dereferenceable(76) %103)
  %105 = load i32, ptr %7, align 4, !tbaa !9
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds i64, ptr %104, i64 %106
  %108 = load i32, ptr %8, align 4, !tbaa !9
  %109 = load i32, ptr %7, align 4, !tbaa !9
  %110 = sub nsw i32 %108, %109
  call void @_ZN6common4DDimC1EPKli(ptr noundef nonnull align 8 dereferenceable(76) %0, ptr noundef %107, i32 noundef %110)
  ret void

111:                                              ; preds = %100
  %112 = load ptr, ptr %15, align 8
  %113 = load i32, ptr %16, align 4
  %114 = insertvalue { ptr, i32 } poison, ptr %112, 0
  %115 = insertvalue { ptr, i32 } %114, i32 %113, 1
  resume { ptr, i32 } %115

116:                                              ; preds = %62
  unreachable
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6common6errors15InvalidArgumentIJPKciiiEEENS_12ErrorSummaryEDpT_(ptr dead_on_unwind noalias writable sret(%"class.common::ErrorSummary") align 8, ptr noundef, i32 noundef, i32 noundef, i32 noundef) #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6paddle6string7SprintfIJNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEA34_cA5_cS7_S7_EEES7_PKcDpRKT_(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef, ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 1 dereferenceable(34), ptr noundef nonnull align 1 dereferenceable(5), ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6common7enforce7details29BinaryCompareMessageConverterILb1EE7ConvertIbEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPKcRKT_(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) #3 align 2

declare void @_ZN6common4DDimC1EPKli(ptr, ptr, i32)

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(none) }
attributes #2 = { 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 = { 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 = { 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 #6 = { nounwind }
attributes #7 = { noreturn }

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

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


; 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.common::DDim" = type <{ %"class.common::Dim", i32, [4 x i8] }>
%"class.common::Dim" = type { %"class.common::Array" }
%"class.common::Array" = type { [9 x i64] }
%"class.common::ErrorSummary" = type { 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] }

@.str.4 = external hidden unnamed_addr constant [75 x i8], align 1
@_ZTIN6common7enforce13EnforceNotMetE = external dso_local constant { ptr, ptr, ptr }, align 8
@.str.8 = external hidden unnamed_addr constant [59 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [55 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [5 x i8], align 1

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

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

declare i32 @__gxx_personality_v0(...)

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

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

declare ptr @__cxa_allocate_exception(i64) local_unnamed_addr

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6common7enforce13EnforceNotMetC2ERKNS_12ErrorSummaryEPKci(ptr noundef nonnull align 8 dereferenceable(81), ptr noundef nonnull align 8 dereferenceable(40), ptr noundef, i32 noundef) unnamed_addr #2 align 2

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

declare void @__cxa_throw(ptr, ptr, ptr) local_unnamed_addr

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN6common12ErrorSummaryD2Ev(ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #3 align 2

declare void @__cxa_free_exception(ptr) local_unnamed_addr

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK6common4DDim4sizeEv(ptr noundef nonnull align 8 dereferenceable(76)) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZNK6common4DDim3GetEv(ptr noundef nonnull align 8 dereferenceable(76)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6common10slice_ddimERKNS_4DDimEii(ptr dead_on_unwind noalias writable sret(%"class.common::DDim") align 8 %0, ptr noundef nonnull align 8 dereferenceable(76) %1, i32 noundef %2, i32 noundef %3) local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %5 = alloca i8, align 1
  %6 = alloca i8, align 1
  %7 = alloca %"class.common::ErrorSummary", align 8
  %8 = alloca %"class.std::__cxx11::basic_string", align 8
  %9 = alloca %"class.std::__cxx11::basic_string", align 8
  %10 = alloca %"class.std::__cxx11::basic_string", align 8
  %11 = alloca %"class.common::ErrorSummary", align 8
  %12 = alloca %"class.std::__cxx11::basic_string", align 8
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %5) #5
  %13 = icmp sgt i32 %2, -1
  br i1 %13, label %14, label %.thread

.thread:                                          ; preds = %4
  store i8 0, ptr %5, align 1, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %6) #5
  store i8 1, ptr %6, align 1, !tbaa !5
  br label %18

14:                                               ; preds = %4
  %15 = tail call noundef i32 @_ZNK6common4DDim4sizeEv(ptr noundef nonnull align 8 dereferenceable(76) %1)
  %16 = icmp sge i32 %15, %3
  %17 = zext i1 %16 to i8
  store i8 %17, ptr %5, align 1, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %6) #5
  store i8 1, ptr %6, align 1, !tbaa !5
  br i1 %16, label %42, label %18, !prof !9

18:                                               ; preds = %.thread, %14
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %7) #5
  %19 = tail call noundef i32 @_ZNK6common4DDim4sizeEv(ptr noundef nonnull align 8 dereferenceable(76) %1)
  call void @_ZN6common6errors15InvalidArgumentIJPKciiiEEENS_12ErrorSummaryEDpT_(ptr dead_on_unwind nonnull writable sret(%"class.common::ErrorSummary") align 8 %7, ptr noundef nonnull @.str.8, i32 noundef %2, i32 noundef %3, i32 noundef %19)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %8) #5
  %20 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNK6common12ErrorSummary13error_messageB5cxx11Ev(ptr noundef nonnull align 8 dereferenceable(40) %7)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %9) #5
  invoke void @_ZN6common7enforce7details29BinaryCompareMessageConverterILb1EE7ConvertIbEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPKcRKT_(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %9, ptr noundef nonnull @.str.10, ptr noundef nonnull align 1 dereferenceable(1) %5)
          to label %21 unwind label %28

21:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %10) #5
  invoke void @_ZN6common7enforce7details29BinaryCompareMessageConverterILb1EE7ConvertIbEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPKcRKT_(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %10, ptr noundef nonnull @.str.11, ptr noundef nonnull align 1 dereferenceable(1) %6)
          to label %22 unwind label %30

22:                                               ; preds = %21
  invoke void @_ZN6paddle6string7SprintfIJNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEA34_cA5_cS7_S7_EEES7_PKcDpRKT_(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %8, ptr noundef nonnull @.str.9, ptr noundef nonnull align 8 dereferenceable(32) %20, ptr noundef nonnull align 1 dereferenceable(34) @.str.10, ptr noundef nonnull align 1 dereferenceable(5) @.str.11, ptr noundef nonnull align 8 dereferenceable(32) %9, ptr noundef nonnull align 8 dereferenceable(32) %10)
          to label %23 unwind label %32

23:                                               ; preds = %22
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %10) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %10) #5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %9) #5
  %24 = call ptr @__cxa_allocate_exception(i64 88) #5
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %11) #5
  %25 = call noundef i32 @_ZNK6common12ErrorSummary4codeEv(ptr noundef nonnull align 8 dereferenceable(40) %7)
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2EOS4_(ptr noundef nonnull align 8 dereferenceable(32) %12, ptr noundef nonnull align 8 dereferenceable(32) %8) #5
  invoke void @_ZN6common12ErrorSummaryC2ENS_9ErrorCodeENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(40) %11, i32 noundef %25, ptr noundef nonnull %12)
          to label %26 unwind label %.thread24

26:                                               ; preds = %23
  invoke void @_ZN6common7enforce13EnforceNotMetC2ERKNS_12ErrorSummaryEPKci(ptr noundef nonnull align 8 dereferenceable(81) %24, ptr noundef nonnull align 8 dereferenceable(40) %11, ptr noundef nonnull @.str.4, i32 noundef 150)
          to label %27 unwind label %37

27:                                               ; preds = %26
  invoke void @__cxa_throw(ptr nonnull %24, ptr nonnull @_ZTIN6common7enforce13EnforceNotMetE, ptr nonnull @_ZN6common7enforce13EnforceNotMetD2Ev) #6
          to label %47 unwind label %37

28:                                               ; preds = %18
  %29 = landingpad { ptr, i32 }
          cleanup
  br label %35

30:                                               ; preds = %21
  %31 = landingpad { ptr, i32 }
          cleanup
  br label %34

32:                                               ; preds = %22
  %33 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %10) #5
  br label %34

34:                                               ; preds = %32, %30
  %.pn = phi { ptr, i32 } [ %33, %32 ], [ %31, %30 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %10) #5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #5
  br label %35

35:                                               ; preds = %34, %28
  %.pn.pn = phi { ptr, i32 } [ %.pn, %34 ], [ %29, %28 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %9) #5
  br label %41

.thread24:                                        ; preds = %23
  %36 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %11) #5
  br label %39

37:                                               ; preds = %26, %27
  %.0 = phi i1 [ false, %27 ], [ true, %26 ]
  %38 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN6common12ErrorSummaryD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %11) #5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %11) #5
  br i1 %.0, label %39, label %40

39:                                               ; preds = %.thread24, %37
  %.pn2128 = phi { ptr, i32 } [ %36, %.thread24 ], [ %38, %37 ]
  call void @__cxa_free_exception(ptr %24) #5
  br label %40

40:                                               ; preds = %39, %37
  %.pn2127 = phi { ptr, i32 } [ %.pn2128, %39 ], [ %38, %37 ]
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #5
  br label %41

41:                                               ; preds = %40, %35
  %.pn21.pn = phi { ptr, i32 } [ %.pn2127, %40 ], [ %.pn.pn, %35 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #5
  call void @_ZN6common12ErrorSummaryD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %7) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #5
  resume { ptr, i32 } %.pn21.pn

42:                                               ; preds = %14
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #5
  %43 = tail call noundef ptr @_ZNK6common4DDim3GetEv(ptr noundef nonnull align 8 dereferenceable(76) %1)
  %44 = zext nneg i32 %2 to i64
  %45 = getelementptr inbounds i64, ptr %43, i64 %44
  %46 = sub nsw i32 %3, %2
  tail call void @_ZN6common4DDimC1EPKli(ptr noundef nonnull align 8 dereferenceable(76) %0, ptr noundef %45, i32 noundef %46)
  ret void

47:                                               ; preds = %27
  unreachable
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6common6errors15InvalidArgumentIJPKciiiEEENS_12ErrorSummaryEDpT_(ptr dead_on_unwind noalias writable sret(%"class.common::ErrorSummary") align 8, ptr noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6paddle6string7SprintfIJNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEA34_cA5_cS7_S7_EEES7_PKcDpRKT_(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef, ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 1 dereferenceable(34), ptr noundef nonnull align 1 dereferenceable(5), ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6common7enforce7details29BinaryCompareMessageConverterILb1EE7ConvertIbEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPKcRKT_(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #2 align 2

declare void @_ZN6common4DDimC1EPKli(ptr, ptr, i32) local_unnamed_addr

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"bool", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!"branch_weights", !"expected", i32 -2147483648, i32 0}


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