; LLVM IR from eyangch/competitive-programming :: USACOcontests/gold/2007.02/lilypad.ll (Z7genLocsSt4pairIxxE)

; 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.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::pair<long long, long long>, std::allocator<std::pair<long long, long long>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<long long, long long>, std::allocator<std::pair<long long, long long>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<long long, long long>, std::allocator<std::pair<long long, long long>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<long long, long long>, std::allocator<std::pair<long long, long long>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::pair" = type { i64, i64 }

@M = external dso_local global i64, align 8
@N = external dso_local global i64, align 8
@dx = external dso_local global [8 x i64], align 16
@dy = external dso_local global [8 x i64], align 16

; Function Attrs: mustprogress uwtable
define dso_local void @_Z7genLocsSt4pairIxxE(ptr dead_on_unwind noalias writable sret(%"class.std::vector") align 8 %0, i64 %1, i64 %2) #0 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca %"struct.std::pair", align 8
  %6 = alloca i1, align 1
  %7 = alloca i64, align 8
  %8 = alloca i32, align 4
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca %"struct.std::pair", align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  store ptr %0, ptr %4, align 8
  %14 = getelementptr inbounds { i64, i64 }, ptr %5, i32 0, i32 0
  store i64 %1, ptr %14, align 8
  %15 = getelementptr inbounds { i64, i64 }, ptr %5, i32 0, i32 1
  store i64 %2, ptr %15, align 8
  store i1 false, ptr %6, align 1
  call void @_ZNSt6vectorISt4pairIxxESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  store i64 0, ptr %7, align 8, !tbaa !5
  br label %16

16:                                               ; preds = %53, %3
  %17 = load i64, ptr %7, align 8, !tbaa !5
  %18 = icmp slt i64 %17, 8
  br i1 %18, label %20, label %19

19:                                               ; preds = %16
  store i32 2, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  br label %60

20:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  %21 = getelementptr inbounds %"struct.std::pair", ptr %5, i32 0, i32 0
  %22 = load i64, ptr %21, align 8, !tbaa !9
  %23 = load i64, ptr %7, align 8, !tbaa !5
  %24 = getelementptr inbounds [8 x i64], ptr @dx, i64 0, i64 %23
  %25 = load i64, ptr %24, align 8, !tbaa !5
  %26 = add nsw i64 %22, %25
  store i64 %26, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  %27 = getelementptr inbounds %"struct.std::pair", ptr %5, i32 0, i32 1
  %28 = load i64, ptr %27, align 8, !tbaa !11
  %29 = load i64, ptr %7, align 8, !tbaa !5
  %30 = getelementptr inbounds [8 x i64], ptr @dy, i64 0, i64 %29
  %31 = load i64, ptr %30, align 8, !tbaa !5
  %32 = add nsw i64 %28, %31
  store i64 %32, ptr %10, align 8, !tbaa !5
  %33 = load i64, ptr %9, align 8, !tbaa !5
  %34 = icmp slt i64 %33, 0
  br i1 %34, label %46, label %35

35:                                               ; preds = %20
  %36 = load i64, ptr %10, align 8, !tbaa !5
  %37 = icmp slt i64 %36, 0
  br i1 %37, label %46, label %38

38:                                               ; preds = %35
  %39 = load i64, ptr %9, align 8, !tbaa !5
  %40 = load i64, ptr @M, align 8, !tbaa !5
  %41 = icmp sge i64 %39, %40
  br i1 %41, label %46, label %42

42:                                               ; preds = %38
  %43 = load i64, ptr %10, align 8, !tbaa !5
  %44 = load i64, ptr @N, align 8, !tbaa !5
  %45 = icmp sge i64 %43, %44
  br i1 %45, label %46, label %47

46:                                               ; preds = %42, %38, %35, %20
  store i32 4, ptr %8, align 4
  br label %50

47:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 16, ptr %11) #3
  invoke void @_ZNSt4pairIxxEC2IRxS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10)
          to label %48 unwind label %56

48:                                               ; preds = %47
  invoke void @_ZNSt6vectorISt4pairIxxESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(16) %11)
          to label %49 unwind label %56

49:                                               ; preds = %48
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #3
  store i32 0, ptr %8, align 4
  br label %50

50:                                               ; preds = %49, %46
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  %51 = load i32, ptr %8, align 4
  switch i32 %51, label %69 [
    i32 0, label %52
    i32 4, label %53
  ]

52:                                               ; preds = %50
  br label %53

53:                                               ; preds = %52, %50
  %54 = load i64, ptr %7, align 8, !tbaa !5
  %55 = add nsw i64 %54, 1
  store i64 %55, ptr %7, align 8, !tbaa !5
  br label %16, !llvm.loop !12

56:                                               ; preds = %48, %47
  %57 = landingpad { ptr, i32 }
          cleanup
  %58 = extractvalue { ptr, i32 } %57, 0
  store ptr %58, ptr %12, align 8
  %59 = extractvalue { ptr, i32 } %57, 1
  store i32 %59, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  call void @_ZNSt6vectorISt4pairIxxESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #3
  br label %64

60:                                               ; preds = %19
  store i1 true, ptr %6, align 1
  store i32 1, ptr %8, align 4
  %61 = load i1, ptr %6, align 1
  br i1 %61, label %63, label %62

62:                                               ; preds = %60
  call void @_ZNSt6vectorISt4pairIxxESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #3
  br label %63

63:                                               ; preds = %62, %60
  ret void

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

69:                                               ; preds = %50
  unreachable
}

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorISt4pairIxxESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(16)) #0 align 2

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

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) #2

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

attributes #0 = { 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 #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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 0}
!10 = !{!"_ZTSSt4pairIxxE", !6, i64 0, !6, i64 8}
!11 = !{!10, !6, i64 8}
!12 = distinct !{!12, !13}
!13 = !{!"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.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::pair<long long, long long>, std::allocator<std::pair<long long, long long>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<long long, long long>, std::allocator<std::pair<long long, long long>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<long long, long long>, std::allocator<std::pair<long long, long long>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<long long, long long>, std::allocator<std::pair<long long, long long>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::pair" = type { i64, i64 }

@M = external dso_local local_unnamed_addr global i64, align 8
@N = external dso_local local_unnamed_addr global i64, align 8
@dx = external dso_local local_unnamed_addr global [8 x i64], align 16
@dy = external dso_local local_unnamed_addr global [8 x i64], align 16

; Function Attrs: mustprogress uwtable
define dso_local void @_Z7genLocsSt4pairIxxE(ptr dead_on_unwind noalias nonnull writable sret(%"class.std::vector") align 8 %0, i64 %1, i64 %2) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca %"struct.std::pair", align 8
  tail call void @_ZNSt6vectorISt4pairIxxESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #3
  %7 = load i64, ptr @dx, align 16, !tbaa !5
  %8 = add nsw i64 %7, %1
  store i64 %8, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #3
  %9 = load i64, ptr @dy, align 16, !tbaa !5
  %10 = add nsw i64 %9, %2
  store i64 %10, ptr %5, align 8, !tbaa !5
  %11 = icmp sgt i64 %8, -1
  %12 = icmp sgt i64 %10, -1
  %or.cond.not14 = select i1 %11, i1 %12, i1 false
  %13 = load i64, ptr @M, align 8
  %.not = icmp slt i64 %8, %13
  %or.cond10 = select i1 %or.cond.not14, i1 %.not, i1 false
  %14 = load i64, ptr @N, align 8
  %.not9 = icmp slt i64 %10, %14
  %or.cond11 = select i1 %or.cond10, i1 %.not9, i1 false
  br i1 %or.cond11, label %15, label %17

15:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #3
  call void @_ZNSt4pairIxxEC2IRxS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %6, ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5)
  invoke void @_ZNSt6vectorISt4pairIxxESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(16) %6)
          to label %16 unwind label %95

16:                                               ; preds = %15
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #3
  %.pre = load i64, ptr @M, align 8
  %.pre16 = load i64, ptr @N, align 8
  br label %17

17:                                               ; preds = %3, %16
  %18 = phi i64 [ %14, %3 ], [ %.pre16, %16 ]
  %19 = phi i64 [ %13, %3 ], [ %.pre, %16 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #3
  %20 = load i64, ptr getelementptr inbounds (i8, ptr @dx, i64 8), align 8, !tbaa !5
  %21 = add nsw i64 %20, %1
  store i64 %21, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #3
  %22 = load i64, ptr getelementptr inbounds (i8, ptr @dy, i64 8), align 8, !tbaa !5
  %23 = add nsw i64 %22, %2
  store i64 %23, ptr %5, align 8, !tbaa !5
  %24 = icmp sgt i64 %21, -1
  %25 = icmp sgt i64 %23, -1
  %or.cond.not14.1 = select i1 %24, i1 %25, i1 false
  %.not.1 = icmp slt i64 %21, %19
  %or.cond10.1 = select i1 %or.cond.not14.1, i1 %.not.1, i1 false
  %.not9.1 = icmp slt i64 %23, %18
  %or.cond11.1 = select i1 %or.cond10.1, i1 %.not9.1, i1 false
  br i1 %or.cond11.1, label %26, label %28

26:                                               ; preds = %17
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #3
  call void @_ZNSt4pairIxxEC2IRxS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %6, ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5)
  invoke void @_ZNSt6vectorISt4pairIxxESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(16) %6)
          to label %27 unwind label %95

27:                                               ; preds = %26
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #3
  %.pre17 = load i64, ptr @M, align 8
  %.pre18 = load i64, ptr @N, align 8
  br label %28

28:                                               ; preds = %27, %17
  %29 = phi i64 [ %.pre18, %27 ], [ %18, %17 ]
  %30 = phi i64 [ %.pre17, %27 ], [ %19, %17 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #3
  %31 = load i64, ptr getelementptr inbounds (i8, ptr @dx, i64 16), align 16, !tbaa !5
  %32 = add nsw i64 %31, %1
  store i64 %32, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #3
  %33 = load i64, ptr getelementptr inbounds (i8, ptr @dy, i64 16), align 16, !tbaa !5
  %34 = add nsw i64 %33, %2
  store i64 %34, ptr %5, align 8, !tbaa !5
  %35 = icmp sgt i64 %32, -1
  %36 = icmp sgt i64 %34, -1
  %or.cond.not14.2 = select i1 %35, i1 %36, i1 false
  %.not.2 = icmp slt i64 %32, %30
  %or.cond10.2 = select i1 %or.cond.not14.2, i1 %.not.2, i1 false
  %.not9.2 = icmp slt i64 %34, %29
  %or.cond11.2 = select i1 %or.cond10.2, i1 %.not9.2, i1 false
  br i1 %or.cond11.2, label %37, label %39

37:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #3
  call void @_ZNSt4pairIxxEC2IRxS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %6, ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5)
  invoke void @_ZNSt6vectorISt4pairIxxESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(16) %6)
          to label %38 unwind label %95

38:                                               ; preds = %37
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #3
  %.pre19 = load i64, ptr @M, align 8
  %.pre20 = load i64, ptr @N, align 8
  br label %39

39:                                               ; preds = %38, %28
  %40 = phi i64 [ %.pre20, %38 ], [ %29, %28 ]
  %41 = phi i64 [ %.pre19, %38 ], [ %30, %28 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #3
  %42 = load i64, ptr getelementptr inbounds (i8, ptr @dx, i64 24), align 8, !tbaa !5
  %43 = add nsw i64 %42, %1
  store i64 %43, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #3
  %44 = load i64, ptr getelementptr inbounds (i8, ptr @dy, i64 24), align 8, !tbaa !5
  %45 = add nsw i64 %44, %2
  store i64 %45, ptr %5, align 8, !tbaa !5
  %46 = icmp sgt i64 %43, -1
  %47 = icmp sgt i64 %45, -1
  %or.cond.not14.3 = select i1 %46, i1 %47, i1 false
  %.not.3 = icmp slt i64 %43, %41
  %or.cond10.3 = select i1 %or.cond.not14.3, i1 %.not.3, i1 false
  %.not9.3 = icmp slt i64 %45, %40
  %or.cond11.3 = select i1 %or.cond10.3, i1 %.not9.3, i1 false
  br i1 %or.cond11.3, label %48, label %50

48:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #3
  call void @_ZNSt4pairIxxEC2IRxS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %6, ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5)
  invoke void @_ZNSt6vectorISt4pairIxxESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(16) %6)
          to label %49 unwind label %95

49:                                               ; preds = %48
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #3
  %.pre21 = load i64, ptr @M, align 8
  %.pre22 = load i64, ptr @N, align 8
  br label %50

50:                                               ; preds = %49, %39
  %51 = phi i64 [ %.pre22, %49 ], [ %40, %39 ]
  %52 = phi i64 [ %.pre21, %49 ], [ %41, %39 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #3
  %53 = load i64, ptr getelementptr inbounds (i8, ptr @dx, i64 32), align 16, !tbaa !5
  %54 = add nsw i64 %53, %1
  store i64 %54, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #3
  %55 = load i64, ptr getelementptr inbounds (i8, ptr @dy, i64 32), align 16, !tbaa !5
  %56 = add nsw i64 %55, %2
  store i64 %56, ptr %5, align 8, !tbaa !5
  %57 = icmp sgt i64 %54, -1
  %58 = icmp sgt i64 %56, -1
  %or.cond.not14.4 = select i1 %57, i1 %58, i1 false
  %.not.4 = icmp slt i64 %54, %52
  %or.cond10.4 = select i1 %or.cond.not14.4, i1 %.not.4, i1 false
  %.not9.4 = icmp slt i64 %56, %51
  %or.cond11.4 = select i1 %or.cond10.4, i1 %.not9.4, i1 false
  br i1 %or.cond11.4, label %59, label %61

59:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #3
  call void @_ZNSt4pairIxxEC2IRxS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %6, ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5)
  invoke void @_ZNSt6vectorISt4pairIxxESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(16) %6)
          to label %60 unwind label %95

60:                                               ; preds = %59
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #3
  %.pre23 = load i64, ptr @M, align 8
  %.pre24 = load i64, ptr @N, align 8
  br label %61

61:                                               ; preds = %60, %50
  %62 = phi i64 [ %.pre24, %60 ], [ %51, %50 ]
  %63 = phi i64 [ %.pre23, %60 ], [ %52, %50 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #3
  %64 = load i64, ptr getelementptr inbounds (i8, ptr @dx, i64 40), align 8, !tbaa !5
  %65 = add nsw i64 %64, %1
  store i64 %65, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #3
  %66 = load i64, ptr getelementptr inbounds (i8, ptr @dy, i64 40), align 8, !tbaa !5
  %67 = add nsw i64 %66, %2
  store i64 %67, ptr %5, align 8, !tbaa !5
  %68 = icmp sgt i64 %65, -1
  %69 = icmp sgt i64 %67, -1
  %or.cond.not14.5 = select i1 %68, i1 %69, i1 false
  %.not.5 = icmp slt i64 %65, %63
  %or.cond10.5 = select i1 %or.cond.not14.5, i1 %.not.5, i1 false
  %.not9.5 = icmp slt i64 %67, %62
  %or.cond11.5 = select i1 %or.cond10.5, i1 %.not9.5, i1 false
  br i1 %or.cond11.5, label %70, label %72

70:                                               ; preds = %61
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #3
  call void @_ZNSt4pairIxxEC2IRxS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %6, ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5)
  invoke void @_ZNSt6vectorISt4pairIxxESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(16) %6)
          to label %71 unwind label %95

71:                                               ; preds = %70
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #3
  %.pre25 = load i64, ptr @M, align 8
  %.pre26 = load i64, ptr @N, align 8
  br label %72

72:                                               ; preds = %71, %61
  %73 = phi i64 [ %.pre26, %71 ], [ %62, %61 ]
  %74 = phi i64 [ %.pre25, %71 ], [ %63, %61 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #3
  %75 = load i64, ptr getelementptr inbounds (i8, ptr @dx, i64 48), align 16, !tbaa !5
  %76 = add nsw i64 %75, %1
  store i64 %76, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #3
  %77 = load i64, ptr getelementptr inbounds (i8, ptr @dy, i64 48), align 16, !tbaa !5
  %78 = add nsw i64 %77, %2
  store i64 %78, ptr %5, align 8, !tbaa !5
  %79 = icmp sgt i64 %76, -1
  %80 = icmp sgt i64 %78, -1
  %or.cond.not14.6 = select i1 %79, i1 %80, i1 false
  %.not.6 = icmp slt i64 %76, %74
  %or.cond10.6 = select i1 %or.cond.not14.6, i1 %.not.6, i1 false
  %.not9.6 = icmp slt i64 %78, %73
  %or.cond11.6 = select i1 %or.cond10.6, i1 %.not9.6, i1 false
  br i1 %or.cond11.6, label %81, label %83

81:                                               ; preds = %72
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #3
  call void @_ZNSt4pairIxxEC2IRxS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %6, ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5)
  invoke void @_ZNSt6vectorISt4pairIxxESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(16) %6)
          to label %82 unwind label %95

82:                                               ; preds = %81
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #3
  %.pre27 = load i64, ptr @M, align 8
  %.pre28 = load i64, ptr @N, align 8
  br label %83

83:                                               ; preds = %82, %72
  %84 = phi i64 [ %.pre28, %82 ], [ %73, %72 ]
  %85 = phi i64 [ %.pre27, %82 ], [ %74, %72 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #3
  %86 = load i64, ptr getelementptr inbounds (i8, ptr @dx, i64 56), align 8, !tbaa !5
  %87 = add nsw i64 %86, %1
  store i64 %87, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #3
  %88 = load i64, ptr getelementptr inbounds (i8, ptr @dy, i64 56), align 8, !tbaa !5
  %89 = add nsw i64 %88, %2
  store i64 %89, ptr %5, align 8, !tbaa !5
  %90 = icmp sgt i64 %87, -1
  %91 = icmp sgt i64 %89, -1
  %or.cond.not14.7 = select i1 %90, i1 %91, i1 false
  %.not.7 = icmp slt i64 %87, %85
  %or.cond10.7 = select i1 %or.cond.not14.7, i1 %.not.7, i1 false
  %.not9.7 = icmp slt i64 %89, %84
  %or.cond11.7 = select i1 %or.cond10.7, i1 %.not9.7, i1 false
  br i1 %or.cond11.7, label %92, label %94

92:                                               ; preds = %83
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #3
  call void @_ZNSt4pairIxxEC2IRxS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %6, ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5)
  invoke void @_ZNSt6vectorISt4pairIxxESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(16) %6)
          to label %93 unwind label %95

93:                                               ; preds = %92
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #3
  br label %94

94:                                               ; preds = %93, %83
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #3
  ret void

95:                                               ; preds = %92, %81, %70, %59, %48, %37, %26, %15
  %96 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #3
  call void @_ZNSt6vectorISt4pairIxxESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #3
  resume { ptr, i32 } %96
}

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorISt4pairIxxESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0 align 2

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

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) #2

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

attributes #0 = { 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 #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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,LoopRotatePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass