; LLVM IR from NervanaSystems/ngraph :: src/ngraph (validation_util)

; 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.ngraph::CoordinateDiff" = type { %"class.std::vector.5" }
%"class.std::vector.5" = type { %"struct.std::_Vector_base.6" }
%"struct.std::_Vector_base.6" = type { %"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl" }
%"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.ngraph::Dimension" = type { %"class.ngraph::Interval" }
%"class.ngraph::Interval" = type { i64, i64 }

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

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i64 } @_ZNK6ngraph12PartialShape4rankEv(ptr noundef nonnull align 8 dereferenceable(32)) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK6ngraph9Dimension9is_staticEv(ptr noundef nonnull align 8 dereferenceable(16)) #1 align 2

declare noundef i64 @_ZNK6ngraph9Dimension10get_lengthEv(ptr noundef nonnull align 8 dereferenceable(16)) #2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6ngraph20conv_default_paddingEPKNS_4NodeERKNS_12PartialShapeES5_(ptr dead_on_unwind noalias writable sret(%"class.ngraph::CoordinateDiff") align 8 %0, ptr noundef %1, ptr noundef nonnull align 8 dereferenceable(32) %2, ptr noundef nonnull align 8 dereferenceable(32) %3) #1 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i64, align 8
  %10 = alloca %"class.ngraph::Dimension", align 8
  %11 = alloca %"class.ngraph::Dimension", align 8
  %12 = alloca %"class.ngraph::Dimension", align 8
  %13 = alloca %"class.ngraph::Dimension", align 8
  %14 = alloca %"class.ngraph::Dimension", align 8
  %15 = alloca %"class.ngraph::Dimension", align 8
  store ptr %0, ptr %5, align 8
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  store ptr %3, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.start.p0(i64 16, ptr %10) #3
  %16 = load ptr, ptr %7, align 8, !tbaa !5
  %17 = call { i64, i64 } @_ZNK6ngraph12PartialShape4rankEv(ptr noundef nonnull align 8 dereferenceable(32) %16)
  %18 = getelementptr inbounds %"class.ngraph::Dimension", ptr %10, i32 0, i32 0
  %19 = getelementptr inbounds { i64, i64 }, ptr %18, i32 0, i32 0
  %20 = extractvalue { i64, i64 } %17, 0
  store i64 %20, ptr %19, align 8
  %21 = getelementptr inbounds { i64, i64 }, ptr %18, i32 0, i32 1
  %22 = extractvalue { i64, i64 } %17, 1
  store i64 %22, ptr %21, align 8
  %23 = call noundef zeroext i1 @_ZNK6ngraph9Dimension9is_staticEv(ptr noundef nonnull align 8 dereferenceable(16) %10)
  call void @llvm.lifetime.start.p0(i64 16, ptr %11) #3
  br i1 %23, label %24, label %34

24:                                               ; preds = %4
  %25 = load ptr, ptr %7, align 8, !tbaa !5
  %26 = call { i64, i64 } @_ZNK6ngraph12PartialShape4rankEv(ptr noundef nonnull align 8 dereferenceable(32) %25)
  %27 = getelementptr inbounds %"class.ngraph::Dimension", ptr %11, i32 0, i32 0
  %28 = getelementptr inbounds { i64, i64 }, ptr %27, i32 0, i32 0
  %29 = extractvalue { i64, i64 } %26, 0
  store i64 %29, ptr %28, align 8
  %30 = getelementptr inbounds { i64, i64 }, ptr %27, i32 0, i32 1
  %31 = extractvalue { i64, i64 } %26, 1
  store i64 %31, ptr %30, align 8
  %32 = call noundef i64 @_ZNK6ngraph9Dimension10get_lengthEv(ptr noundef nonnull align 8 dereferenceable(16) %11)
  %33 = icmp sge i64 %32, 2
  br label %34

34:                                               ; preds = %24, %4
  %35 = phi i1 [ false, %4 ], [ %33, %24 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #3
  br i1 %35, label %36, label %46

36:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 16, ptr %12) #3
  %37 = load ptr, ptr %7, align 8, !tbaa !5
  %38 = call { i64, i64 } @_ZNK6ngraph12PartialShape4rankEv(ptr noundef nonnull align 8 dereferenceable(32) %37)
  %39 = getelementptr inbounds %"class.ngraph::Dimension", ptr %12, i32 0, i32 0
  %40 = getelementptr inbounds { i64, i64 }, ptr %39, i32 0, i32 0
  %41 = extractvalue { i64, i64 } %38, 0
  store i64 %41, ptr %40, align 8
  %42 = getelementptr inbounds { i64, i64 }, ptr %39, i32 0, i32 1
  %43 = extractvalue { i64, i64 } %38, 1
  store i64 %43, ptr %42, align 8
  %44 = call noundef i64 @_ZNK6ngraph9Dimension10get_lengthEv(ptr noundef nonnull align 8 dereferenceable(16) %12)
  %45 = sub nsw i64 %44, 2
  store i64 %45, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #3
  br label %79

46:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 16, ptr %13) #3
  %47 = load ptr, ptr %8, align 8, !tbaa !5
  %48 = call { i64, i64 } @_ZNK6ngraph12PartialShape4rankEv(ptr noundef nonnull align 8 dereferenceable(32) %47)
  %49 = getelementptr inbounds %"class.ngraph::Dimension", ptr %13, i32 0, i32 0
  %50 = getelementptr inbounds { i64, i64 }, ptr %49, i32 0, i32 0
  %51 = extractvalue { i64, i64 } %48, 0
  store i64 %51, ptr %50, align 8
  %52 = getelementptr inbounds { i64, i64 }, ptr %49, i32 0, i32 1
  %53 = extractvalue { i64, i64 } %48, 1
  store i64 %53, ptr %52, align 8
  %54 = call noundef zeroext i1 @_ZNK6ngraph9Dimension9is_staticEv(ptr noundef nonnull align 8 dereferenceable(16) %13)
  call void @llvm.lifetime.start.p0(i64 16, ptr %14) #3
  br i1 %54, label %55, label %65

55:                                               ; preds = %46
  %56 = load ptr, ptr %8, align 8, !tbaa !5
  %57 = call { i64, i64 } @_ZNK6ngraph12PartialShape4rankEv(ptr noundef nonnull align 8 dereferenceable(32) %56)
  %58 = getelementptr inbounds %"class.ngraph::Dimension", ptr %14, i32 0, i32 0
  %59 = getelementptr inbounds { i64, i64 }, ptr %58, i32 0, i32 0
  %60 = extractvalue { i64, i64 } %57, 0
  store i64 %60, ptr %59, align 8
  %61 = getelementptr inbounds { i64, i64 }, ptr %58, i32 0, i32 1
  %62 = extractvalue { i64, i64 } %57, 1
  store i64 %62, ptr %61, align 8
  %63 = call noundef i64 @_ZNK6ngraph9Dimension10get_lengthEv(ptr noundef nonnull align 8 dereferenceable(16) %14)
  %64 = icmp sge i64 %63, 2
  br label %65

65:                                               ; preds = %55, %46
  %66 = phi i1 [ false, %46 ], [ %64, %55 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #3
  br i1 %66, label %67, label %77

67:                                               ; preds = %65
  call void @llvm.lifetime.start.p0(i64 16, ptr %15) #3
  %68 = load ptr, ptr %8, align 8, !tbaa !5
  %69 = call { i64, i64 } @_ZNK6ngraph12PartialShape4rankEv(ptr noundef nonnull align 8 dereferenceable(32) %68)
  %70 = getelementptr inbounds %"class.ngraph::Dimension", ptr %15, i32 0, i32 0
  %71 = getelementptr inbounds { i64, i64 }, ptr %70, i32 0, i32 0
  %72 = extractvalue { i64, i64 } %69, 0
  store i64 %72, ptr %71, align 8
  %73 = getelementptr inbounds { i64, i64 }, ptr %70, i32 0, i32 1
  %74 = extractvalue { i64, i64 } %69, 1
  store i64 %74, ptr %73, align 8
  %75 = call noundef i64 @_ZNK6ngraph9Dimension10get_lengthEv(ptr noundef nonnull align 8 dereferenceable(16) %15)
  %76 = sub nsw i64 %75, 2
  store i64 %76, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #3
  br label %78

77:                                               ; preds = %65
  store i64 0, ptr %9, align 8, !tbaa !9
  br label %78

78:                                               ; preds = %77, %67
  br label %79

79:                                               ; preds = %78, %36
  %80 = load i64, ptr %9, align 8, !tbaa !9
  call void @_ZN6ngraph14CoordinateDiffC1Eml(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %80, i64 noundef 0)
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  ret void
}

declare void @_ZN6ngraph14CoordinateDiffC1Eml(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, i64 noundef) unnamed_addr #2

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


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

%"class.ngraph::CoordinateDiff" = type { %"class.std::vector.5" }
%"class.std::vector.5" = type { %"struct.std::_Vector_base.6" }
%"struct.std::_Vector_base.6" = type { %"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl" }
%"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.ngraph::Dimension" = type { %"class.ngraph::Interval" }
%"class.ngraph::Interval" = type { i64, i64 }

; 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 uwtable
declare dso_local { i64, i64 } @_ZNK6ngraph12PartialShape4rankEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK6ngraph9Dimension9is_staticEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #1 align 2

declare noundef i64 @_ZNK6ngraph9Dimension10get_lengthEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6ngraph20conv_default_paddingEPKNS_4NodeERKNS_12PartialShapeES5_(ptr dead_on_unwind noalias writable sret(%"class.ngraph::CoordinateDiff") align 8 %0, ptr nocapture noundef readnone %1, ptr noundef nonnull align 8 dereferenceable(32) %2, ptr noundef nonnull align 8 dereferenceable(32) %3) local_unnamed_addr #1 {
  %5 = alloca %"class.ngraph::Dimension", align 8
  %6 = alloca %"class.ngraph::Dimension", align 8
  %7 = alloca %"class.ngraph::Dimension", align 8
  %8 = alloca %"class.ngraph::Dimension", align 8
  %9 = alloca %"class.ngraph::Dimension", align 8
  %10 = alloca %"class.ngraph::Dimension", align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #3
  %11 = tail call { i64, i64 } @_ZNK6ngraph12PartialShape4rankEv(ptr noundef nonnull align 8 dereferenceable(32) %2)
  %12 = extractvalue { i64, i64 } %11, 0
  store i64 %12, ptr %5, align 8
  %13 = getelementptr inbounds i8, ptr %5, i64 8
  %14 = extractvalue { i64, i64 } %11, 1
  store i64 %14, ptr %13, align 8
  %15 = call noundef zeroext i1 @_ZNK6ngraph9Dimension9is_staticEv(ptr noundef nonnull align 8 dereferenceable(16) %5)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #3
  br i1 %15, label %16, label %.critedge

16:                                               ; preds = %4
  %17 = call { i64, i64 } @_ZNK6ngraph12PartialShape4rankEv(ptr noundef nonnull align 8 dereferenceable(32) %2)
  %18 = extractvalue { i64, i64 } %17, 0
  store i64 %18, ptr %6, align 8
  %19 = getelementptr inbounds i8, ptr %6, i64 8
  %20 = extractvalue { i64, i64 } %17, 1
  store i64 %20, ptr %19, align 8
  %21 = call noundef i64 @_ZNK6ngraph9Dimension10get_lengthEv(ptr noundef nonnull align 8 dereferenceable(16) %6)
  %22 = icmp sgt i64 %21, 1
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #3
  br i1 %22, label %23, label %30

23:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #3
  %24 = call { i64, i64 } @_ZNK6ngraph12PartialShape4rankEv(ptr noundef nonnull align 8 dereferenceable(32) %2)
  %25 = extractvalue { i64, i64 } %24, 0
  store i64 %25, ptr %7, align 8
  %26 = getelementptr inbounds i8, ptr %7, i64 8
  %27 = extractvalue { i64, i64 } %24, 1
  store i64 %27, ptr %26, align 8
  %28 = call noundef i64 @_ZNK6ngraph9Dimension10get_lengthEv(ptr noundef nonnull align 8 dereferenceable(16) %7)
  %29 = add nsw i64 %28, -2
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #3
  br label %50

.critedge:                                        ; preds = %4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #3
  br label %30

30:                                               ; preds = %.critedge, %16
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %8) #3
  %31 = call { i64, i64 } @_ZNK6ngraph12PartialShape4rankEv(ptr noundef nonnull align 8 dereferenceable(32) %3)
  %32 = extractvalue { i64, i64 } %31, 0
  store i64 %32, ptr %8, align 8
  %33 = getelementptr inbounds i8, ptr %8, i64 8
  %34 = extractvalue { i64, i64 } %31, 1
  store i64 %34, ptr %33, align 8
  %35 = call noundef zeroext i1 @_ZNK6ngraph9Dimension9is_staticEv(ptr noundef nonnull align 8 dereferenceable(16) %8)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %9) #3
  br i1 %35, label %36, label %.critedge2

36:                                               ; preds = %30
  %37 = call { i64, i64 } @_ZNK6ngraph12PartialShape4rankEv(ptr noundef nonnull align 8 dereferenceable(32) %3)
  %38 = extractvalue { i64, i64 } %37, 0
  store i64 %38, ptr %9, align 8
  %39 = getelementptr inbounds i8, ptr %9, i64 8
  %40 = extractvalue { i64, i64 } %37, 1
  store i64 %40, ptr %39, align 8
  %41 = call noundef i64 @_ZNK6ngraph9Dimension10get_lengthEv(ptr noundef nonnull align 8 dereferenceable(16) %9)
  %42 = icmp sgt i64 %41, 1
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #3
  br i1 %42, label %43, label %50

43:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %10) #3
  %44 = call { i64, i64 } @_ZNK6ngraph12PartialShape4rankEv(ptr noundef nonnull align 8 dereferenceable(32) %3)
  %45 = extractvalue { i64, i64 } %44, 0
  store i64 %45, ptr %10, align 8
  %46 = getelementptr inbounds i8, ptr %10, i64 8
  %47 = extractvalue { i64, i64 } %44, 1
  store i64 %47, ptr %46, align 8
  %48 = call noundef i64 @_ZNK6ngraph9Dimension10get_lengthEv(ptr noundef nonnull align 8 dereferenceable(16) %10)
  %49 = add nsw i64 %48, -2
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #3
  br label %50

.critedge2:                                       ; preds = %30
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #3
  br label %50

50:                                               ; preds = %36, %.critedge2, %43, %23
  %.0 = phi i64 [ %29, %23 ], [ %49, %43 ], [ 0, %.critedge2 ], [ 0, %36 ]
  call void @_ZN6ngraph14CoordinateDiffC1Eml(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %.0, i64 noundef 0)
  ret void
}

declare void @_ZN6ngraph14CoordinateDiffC1Eml(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, i64 noundef) unnamed_addr #2

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


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