; LLVM IR from eyangch/competitive-programming :: Codeforces/1520/g.ll (Z3bfsxxRA2000_A2000_x)

; 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::queue" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<std::pair<long long, long long>, std::allocator<std::pair<long long, long long>>>::_Deque_impl" }
%"struct.std::_Deque_base<std::pair<long long, long long>, std::allocator<std::pair<long long, long long>>>::_Deque_impl" = type { %"struct.std::_Deque_base<std::pair<long long, long long>, std::allocator<std::pair<long long, long long>>>::_Deque_impl_data" }
%"struct.std::_Deque_base<std::pair<long long, long long>, std::allocator<std::pair<long long, long long>>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%"struct.std::pair" = type { i64, i64 }

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z3bfsxxRA2000_A2000_x(i64 noundef %0, i64 noundef %1, ptr noundef nonnull align 8 dereferenceable(32000000) %2) #0 personality ptr @__gxx_personality_v0 {
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca i32, align 4
  %9 = alloca i64, align 8
  %10 = alloca %"class.std::queue", align 8
  %11 = alloca %"struct.std::pair", align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca i64, align 8
  %17 = alloca i64, align 8
  %18 = alloca i64, align 8
  %19 = alloca %"struct.std::pair", align 8
  store i64 %0, ptr %4, align 8, !tbaa !5
  store i64 %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  store i64 0, ptr %7, align 8, !tbaa !5
  br label %20

20:                                               ; preds = %41, %3
  %21 = load i64, ptr %7, align 8, !tbaa !5
  %22 = load i64, ptr @N, align 8, !tbaa !5
  %23 = icmp slt i64 %21, %22
  br i1 %23, label %25, label %24

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

25:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  store i64 0, ptr %9, align 8, !tbaa !5
  br label %26

26:                                               ; preds = %37, %25
  %27 = load i64, ptr %9, align 8, !tbaa !5
  %28 = load i64, ptr @M, align 8, !tbaa !5
  %29 = icmp slt i64 %27, %28
  br i1 %29, label %31, label %30

30:                                               ; preds = %26
  store i32 5, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  br label %40

31:                                               ; preds = %26
  %32 = load ptr, ptr %6, align 8, !tbaa !9
  %33 = load i64, ptr %7, align 8, !tbaa !5
  %34 = getelementptr inbounds [2000 x [2000 x i64]], ptr %32, i64 0, i64 %33
  %35 = load i64, ptr %9, align 8, !tbaa !5
  %36 = getelementptr inbounds [2000 x i64], ptr %34, i64 0, i64 %35
  store i64 100000000000000000, ptr %36, align 8, !tbaa !5
  br label %37

37:                                               ; preds = %31
  %38 = load i64, ptr %9, align 8, !tbaa !5
  %39 = add nsw i64 %38, 1
  store i64 %39, ptr %9, align 8, !tbaa !5
  br label %26, !llvm.loop !11

40:                                               ; preds = %30
  br label %41

41:                                               ; preds = %40
  %42 = load i64, ptr %7, align 8, !tbaa !5
  %43 = add nsw i64 %42, 1
  store i64 %43, ptr %7, align 8, !tbaa !5
  br label %20, !llvm.loop !13

44:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 80, ptr %10) #4
  call void @_ZNSt5queueISt4pairIxxESt5dequeIS1_SaIS1_EEEC2IS4_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %10)
  call void @llvm.lifetime.start.p0(i64 16, ptr %11) #4
  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) %4, ptr noundef nonnull align 8 dereferenceable(8) %5)
          to label %45 unwind label %70

45:                                               ; preds = %44
  invoke void @_ZNSt5queueISt4pairIxxESt5dequeIS1_SaIS1_EEE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(80) %10, ptr noundef nonnull align 8 dereferenceable(16) %11)
          to label %46 unwind label %70

46:                                               ; preds = %45
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #4
  %47 = load ptr, ptr %6, align 8, !tbaa !9
  %48 = load i64, ptr %4, align 8, !tbaa !5
  %49 = getelementptr inbounds [2000 x [2000 x i64]], ptr %47, i64 0, i64 %48
  %50 = load i64, ptr %5, align 8, !tbaa !5
  %51 = getelementptr inbounds [2000 x i64], ptr %49, i64 0, i64 %50
  store i64 0, ptr %51, align 8, !tbaa !5
  br label %52

52:                                               ; preds = %153, %46
  %53 = invoke noundef zeroext i1 @_ZNKSt5queueISt4pairIxxESt5dequeIS1_SaIS1_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %10)
          to label %54 unwind label %74

54:                                               ; preds = %52
  %55 = xor i1 %53, true
  br i1 %55, label %56, label %156

56:                                               ; preds = %54
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  %57 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt5queueISt4pairIxxESt5dequeIS1_SaIS1_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %10)
          to label %58 unwind label %78

58:                                               ; preds = %56
  %59 = getelementptr inbounds %"struct.std::pair", ptr %57, i32 0, i32 0
  %60 = load i64, ptr %59, align 8, !tbaa !14
  store i64 %60, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  %61 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt5queueISt4pairIxxESt5dequeIS1_SaIS1_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %10)
          to label %62 unwind label %82

62:                                               ; preds = %58
  %63 = getelementptr inbounds %"struct.std::pair", ptr %61, i32 0, i32 1
  %64 = load i64, ptr %63, align 8, !tbaa !16
  store i64 %64, ptr %15, align 8, !tbaa !5
  invoke void @_ZNSt5queueISt4pairIxxESt5dequeIS1_SaIS1_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %10)
          to label %65 unwind label %82

65:                                               ; preds = %62
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  store i64 0, ptr %16, align 8, !tbaa !5
  br label %66

66:                                               ; preds = %146, %65
  %67 = load i64, ptr %16, align 8, !tbaa !5
  %68 = icmp slt i64 %67, 4
  br i1 %68, label %86, label %69

69:                                               ; preds = %66
  store i32 10, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  br label %153

70:                                               ; preds = %45, %44
  %71 = landingpad { ptr, i32 }
          cleanup
  %72 = extractvalue { ptr, i32 } %71, 0
  store ptr %72, ptr %12, align 8
  %73 = extractvalue { ptr, i32 } %71, 1
  store i32 %73, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #4
  br label %157

74:                                               ; preds = %52
  %75 = landingpad { ptr, i32 }
          cleanup
  %76 = extractvalue { ptr, i32 } %75, 0
  store ptr %76, ptr %12, align 8
  %77 = extractvalue { ptr, i32 } %75, 1
  store i32 %77, ptr %13, align 4
  br label %157

78:                                               ; preds = %56
  %79 = landingpad { ptr, i32 }
          cleanup
  %80 = extractvalue { ptr, i32 } %79, 0
  store ptr %80, ptr %12, align 8
  %81 = extractvalue { ptr, i32 } %79, 1
  store i32 %81, ptr %13, align 4
  br label %155

82:                                               ; preds = %62, %58
  %83 = landingpad { ptr, i32 }
          cleanup
  %84 = extractvalue { ptr, i32 } %83, 0
  store ptr %84, ptr %12, align 8
  %85 = extractvalue { ptr, i32 } %83, 1
  store i32 %85, ptr %13, align 4
  br label %154

86:                                               ; preds = %66
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  %87 = load i64, ptr %14, align 8, !tbaa !5
  %88 = load i64, ptr %16, align 8, !tbaa !5
  %89 = getelementptr inbounds [4 x i64], ptr @dx, i64 0, i64 %88
  %90 = load i64, ptr %89, align 8, !tbaa !5
  %91 = add nsw i64 %87, %90
  store i64 %91, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #4
  %92 = load i64, ptr %15, align 8, !tbaa !5
  %93 = load i64, ptr %16, align 8, !tbaa !5
  %94 = getelementptr inbounds [4 x i64], ptr @dy, i64 0, i64 %93
  %95 = load i64, ptr %94, align 8, !tbaa !5
  %96 = add nsw i64 %92, %95
  store i64 %96, ptr %18, align 8, !tbaa !5
  %97 = load i64, ptr %17, align 8, !tbaa !5
  %98 = icmp slt i64 %97, 0
  br i1 %98, label %126, label %99

99:                                               ; preds = %86
  %100 = load i64, ptr %18, align 8, !tbaa !5
  %101 = icmp slt i64 %100, 0
  br i1 %101, label %126, label %102

102:                                              ; preds = %99
  %103 = load i64, ptr %17, align 8, !tbaa !5
  %104 = load i64, ptr @N, align 8, !tbaa !5
  %105 = icmp sge i64 %103, %104
  br i1 %105, label %126, label %106

106:                                              ; preds = %102
  %107 = load i64, ptr %18, align 8, !tbaa !5
  %108 = load i64, ptr @M, align 8, !tbaa !5
  %109 = icmp sge i64 %107, %108
  br i1 %109, label %126, label %110

110:                                              ; preds = %106
  %111 = load i64, ptr %17, align 8, !tbaa !5
  %112 = getelementptr inbounds [2000 x [2000 x i64]], ptr @a, i64 0, i64 %111
  %113 = load i64, ptr %18, align 8, !tbaa !5
  %114 = getelementptr inbounds [2000 x i64], ptr %112, i64 0, i64 %113
  %115 = load i64, ptr %114, align 8, !tbaa !5
  %116 = icmp eq i64 %115, -1
  br i1 %116, label %126, label %117

117:                                              ; preds = %110
  %118 = load ptr, ptr %6, align 8, !tbaa !9
  %119 = load i64, ptr %17, align 8, !tbaa !5
  %120 = getelementptr inbounds [2000 x [2000 x i64]], ptr %118, i64 0, i64 %119
  %121 = load i64, ptr %18, align 8, !tbaa !5
  %122 = getelementptr inbounds [2000 x i64], ptr %120, i64 0, i64 %121
  %123 = load i64, ptr %122, align 8, !tbaa !5
  %124 = sitofp i64 %123 to double
  %125 = fcmp olt double %124, 1.000000e+17
  br i1 %125, label %126, label %127

126:                                              ; preds = %117, %110, %106, %102, %99, %86
  store i32 12, ptr %8, align 4
  br label %143

127:                                              ; preds = %117
  %128 = load ptr, ptr %6, align 8, !tbaa !9
  %129 = load i64, ptr %14, align 8, !tbaa !5
  %130 = getelementptr inbounds [2000 x [2000 x i64]], ptr %128, i64 0, i64 %129
  %131 = load i64, ptr %15, align 8, !tbaa !5
  %132 = getelementptr inbounds [2000 x i64], ptr %130, i64 0, i64 %131
  %133 = load i64, ptr %132, align 8, !tbaa !5
  %134 = load i64, ptr @W, align 8, !tbaa !5
  %135 = add nsw i64 %133, %134
  %136 = load ptr, ptr %6, align 8, !tbaa !9
  %137 = load i64, ptr %17, align 8, !tbaa !5
  %138 = getelementptr inbounds [2000 x [2000 x i64]], ptr %136, i64 0, i64 %137
  %139 = load i64, ptr %18, align 8, !tbaa !5
  %140 = getelementptr inbounds [2000 x i64], ptr %138, i64 0, i64 %139
  store i64 %135, ptr %140, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %19) #4
  invoke void @_ZNSt4pairIxxEC2IRxS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %19, ptr noundef nonnull align 8 dereferenceable(8) %17, ptr noundef nonnull align 8 dereferenceable(8) %18)
          to label %141 unwind label %149

141:                                              ; preds = %127
  invoke void @_ZNSt5queueISt4pairIxxESt5dequeIS1_SaIS1_EEE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(80) %10, ptr noundef nonnull align 8 dereferenceable(16) %19)
          to label %142 unwind label %149

142:                                              ; preds = %141
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #4
  store i32 0, ptr %8, align 4
  br label %143

143:                                              ; preds = %142, %126
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  %144 = load i32, ptr %8, align 4
  switch i32 %144, label %163 [
    i32 0, label %145
    i32 12, label %146
  ]

145:                                              ; preds = %143
  br label %146

146:                                              ; preds = %145, %143
  %147 = load i64, ptr %16, align 8, !tbaa !5
  %148 = add nsw i64 %147, 1
  store i64 %148, ptr %16, align 8, !tbaa !5
  br label %66, !llvm.loop !17

149:                                              ; preds = %141, %127
  %150 = landingpad { ptr, i32 }
          cleanup
  %151 = extractvalue { ptr, i32 } %150, 0
  store ptr %151, ptr %12, align 8
  %152 = extractvalue { ptr, i32 } %150, 1
  store i32 %152, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  br label %154

153:                                              ; preds = %69
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  br label %52, !llvm.loop !18

154:                                              ; preds = %149, %82
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  br label %155

155:                                              ; preds = %154, %78
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  br label %157

156:                                              ; preds = %54
  call void @_ZNSt5queueISt4pairIxxESt5dequeIS1_SaIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %10) #4
  call void @llvm.lifetime.end.p0(i64 80, ptr %10) #4
  ret void

157:                                              ; preds = %155, %74, %70
  call void @_ZNSt5queueISt4pairIxxESt5dequeIS1_SaIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %10) #4
  call void @llvm.lifetime.end.p0(i64 80, ptr %10) #4
  br label %158

158:                                              ; preds = %157
  %159 = load ptr, ptr %12, align 8
  %160 = load i32, ptr %13, align 4
  %161 = insertvalue { ptr, i32 } poison, ptr %159, 0
  %162 = insertvalue { ptr, i32 } %161, i32 %160, 1
  resume { ptr, i32 } %162

163:                                              ; preds = %143
  unreachable
}

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5queueISt4pairIxxESt5dequeIS1_SaIS1_EEEC2IS4_vEEv(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5queueISt4pairIxxESt5dequeIS1_SaIS1_EEE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(80), 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 #2 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt5queueISt4pairIxxESt5dequeIS1_SaIS1_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80)) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt5queueISt4pairIxxESt5dequeIS1_SaIS1_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80)) #2 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt5queueISt4pairIxxESt5dequeIS1_SaIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #3 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = { 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, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = !{!15, !6, i64 0}
!15 = !{!"_ZTSSt4pairIxxE", !6, i64 0, !6, i64 8}
!16 = !{!15, !6, i64 8}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}


; 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::queue" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<std::pair<long long, long long>, std::allocator<std::pair<long long, long long>>>::_Deque_impl" }
%"struct.std::_Deque_base<std::pair<long long, long long>, std::allocator<std::pair<long long, long long>>>::_Deque_impl" = type { %"struct.std::_Deque_base<std::pair<long long, long long>, std::allocator<std::pair<long long, long long>>>::_Deque_impl_data" }
%"struct.std::_Deque_base<std::pair<long long, long long>, std::allocator<std::pair<long long, long long>>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%"struct.std::pair" = type { i64, i64 }

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z3bfsxxRA2000_A2000_x(i64 noundef %0, i64 noundef %1, ptr nocapture noundef nonnull align 8 dereferenceable(32000000) %2) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca %"class.std::queue", align 8
  %7 = alloca %"struct.std::pair", align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca %"struct.std::pair", align 8
  store i64 %0, ptr %4, align 8, !tbaa !5
  store i64 %1, ptr %5, align 8, !tbaa !5
  %11 = load i64, ptr @N, align 8, !tbaa !5
  %12 = icmp sgt i64 %11, 0
  %13 = load i64, ptr @M, align 8
  %14 = icmp sgt i64 %13, 0
  %or.cond = select i1 %12, i1 %14, i1 false
  br i1 %or.cond, label %.preheader, label %._crit_edge36

.preheader:                                       ; preds = %3, %._crit_edge
  %15 = phi i64 [ %18, %._crit_edge ], [ %11, %3 ]
  %16 = phi i64 [ %19, %._crit_edge ], [ %13, %3 ]
  %.02135 = phi i64 [ %20, %._crit_edge ], [ 0, %3 ]
  %17 = icmp sgt i64 %16, 0
  br i1 %17, label %.lr.ph, label %._crit_edge

._crit_edge36:                                    ; preds = %._crit_edge, %3
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %6) #4
  call void @_ZNSt5queueISt4pairIxxESt5dequeIS1_SaIS1_EEEC2IS4_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %6)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #4
  call void @_ZNSt4pairIxxEC2IRxS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %7, ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5)
  invoke void @_ZNSt5queueISt4pairIxxESt5dequeIS1_SaIS1_EEE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(80) %6, ptr noundef nonnull align 8 dereferenceable(16) %7)
          to label %26 unwind label %45

._crit_edge.loopexit:                             ; preds = %.lr.ph
  %.pre = load i64, ptr @N, align 8, !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader
  %18 = phi i64 [ %.pre, %._crit_edge.loopexit ], [ %15, %.preheader ]
  %19 = phi i64 [ %24, %._crit_edge.loopexit ], [ %16, %.preheader ]
  %20 = add nuw nsw i64 %.02135, 1
  %21 = icmp slt i64 %20, %18
  br i1 %21, label %.preheader, label %._crit_edge36, !llvm.loop !9

.lr.ph:                                           ; preds = %.preheader, %.lr.ph
  %.02434 = phi i64 [ %23, %.lr.ph ], [ 0, %.preheader ]
  %22 = getelementptr inbounds [2000 x [2000 x i64]], ptr %2, i64 0, i64 %.02135, i64 %.02434
  store i64 100000000000000000, ptr %22, align 8, !tbaa !5
  %23 = add nuw nsw i64 %.02434, 1
  %24 = load i64, ptr @M, align 8, !tbaa !5
  %25 = icmp slt i64 %23, %24
  br i1 %25, label %.lr.ph, label %._crit_edge.loopexit, !llvm.loop !12

26:                                               ; preds = %._crit_edge36
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #4
  %27 = load i64, ptr %4, align 8, !tbaa !5
  %28 = load i64, ptr %5, align 8, !tbaa !5
  %29 = getelementptr inbounds [2000 x [2000 x i64]], ptr %2, i64 0, i64 %27, i64 %28
  store i64 0, ptr %29, align 8, !tbaa !5
  %30 = call noundef zeroext i1 @_ZNKSt5queueISt4pairIxxESt5dequeIS1_SaIS1_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %6)
  br i1 %30, label %._crit_edge40, label %.lr.ph39

.lr.ph39:                                         ; preds = %26, %.loopexit
  %31 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt5queueISt4pairIxxESt5dequeIS1_SaIS1_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %6)
  %32 = load i64, ptr %31, align 8, !tbaa !13
  %33 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt5queueISt4pairIxxESt5dequeIS1_SaIS1_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %6)
  %34 = getelementptr inbounds i8, ptr %33, i64 8
  %35 = load i64, ptr %34, align 8, !tbaa !15
  call void @_ZNSt5queueISt4pairIxxESt5dequeIS1_SaIS1_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %6)
  %36 = getelementptr inbounds [2000 x [2000 x i64]], ptr %2, i64 0, i64 %32, i64 %35
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #4
  %37 = load i64, ptr @dx, align 16, !tbaa !5
  %38 = add nsw i64 %37, %32
  store i64 %38, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #4
  %39 = load i64, ptr @dy, align 16, !tbaa !5
  %40 = add nsw i64 %39, %35
  store i64 %40, ptr %9, align 8, !tbaa !5
  %41 = icmp sgt i64 %38, -1
  %42 = icmp sgt i64 %40, -1
  %or.cond.not33 = select i1 %41, i1 %42, i1 false
  %43 = load i64, ptr @N, align 8
  %.not = icmp slt i64 %38, %43
  %or.cond29 = select i1 %or.cond.not33, i1 %.not, i1 false
  %44 = load i64, ptr @M, align 8
  %.not27 = icmp slt i64 %40, %44
  %or.cond30 = select i1 %or.cond29, i1 %.not27, i1 false
  br i1 %or.cond30, label %47, label %61

45:                                               ; preds = %._crit_edge36
  %46 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #4
  br label %133

47:                                               ; preds = %.lr.ph39
  %48 = getelementptr inbounds [2000 x [2000 x i64]], ptr @a, i64 0, i64 %38, i64 %40
  %49 = load i64, ptr %48, align 8, !tbaa !5
  %50 = icmp eq i64 %49, -1
  br i1 %50, label %61, label %51

51:                                               ; preds = %47
  %52 = getelementptr inbounds [2000 x [2000 x i64]], ptr %2, i64 0, i64 %38, i64 %40
  %53 = load i64, ptr %52, align 8, !tbaa !5
  %54 = sitofp i64 %53 to double
  %55 = fcmp olt double %54, 1.000000e+17
  br i1 %55, label %61, label %56

56:                                               ; preds = %51
  %57 = load i64, ptr %36, align 8, !tbaa !5
  %58 = load i64, ptr @W, align 8, !tbaa !5
  %59 = add nsw i64 %58, %57
  store i64 %59, ptr %52, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %10) #4
  call void @_ZNSt4pairIxxEC2IRxS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9)
  invoke void @_ZNSt5queueISt4pairIxxESt5dequeIS1_SaIS1_EEE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(80) %6, ptr noundef nonnull align 8 dereferenceable(16) %10)
          to label %60 unwind label %131

60:                                               ; preds = %56
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #4
  %.pre42 = load i64, ptr @N, align 8
  %.pre43 = load i64, ptr @M, align 8
  br label %61

61:                                               ; preds = %.lr.ph39, %47, %51, %60
  %62 = phi i64 [ %44, %.lr.ph39 ], [ %44, %47 ], [ %44, %51 ], [ %.pre43, %60 ]
  %63 = phi i64 [ %43, %.lr.ph39 ], [ %43, %47 ], [ %43, %51 ], [ %.pre42, %60 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #4
  %64 = load i64, ptr getelementptr inbounds (i8, ptr @dx, i64 8), align 8, !tbaa !5
  %65 = add nsw i64 %64, %32
  store i64 %65, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #4
  %66 = load i64, ptr getelementptr inbounds (i8, ptr @dy, i64 8), align 8, !tbaa !5
  %67 = add nsw i64 %66, %35
  store i64 %67, ptr %9, align 8, !tbaa !5
  %68 = icmp sgt i64 %65, -1
  %69 = icmp sgt i64 %67, -1
  %or.cond.not33.1 = select i1 %68, i1 %69, i1 false
  %.not.1 = icmp slt i64 %65, %63
  %or.cond29.1 = select i1 %or.cond.not33.1, i1 %.not.1, i1 false
  %.not27.1 = icmp slt i64 %67, %62
  %or.cond30.1 = select i1 %or.cond29.1, i1 %.not27.1, i1 false
  br i1 %or.cond30.1, label %70, label %84

70:                                               ; preds = %61
  %71 = getelementptr inbounds [2000 x [2000 x i64]], ptr @a, i64 0, i64 %65, i64 %67
  %72 = load i64, ptr %71, align 8, !tbaa !5
  %73 = icmp eq i64 %72, -1
  br i1 %73, label %84, label %74

74:                                               ; preds = %70
  %75 = getelementptr inbounds [2000 x [2000 x i64]], ptr %2, i64 0, i64 %65, i64 %67
  %76 = load i64, ptr %75, align 8, !tbaa !5
  %77 = sitofp i64 %76 to double
  %78 = fcmp olt double %77, 1.000000e+17
  br i1 %78, label %84, label %79

79:                                               ; preds = %74
  %80 = load i64, ptr %36, align 8, !tbaa !5
  %81 = load i64, ptr @W, align 8, !tbaa !5
  %82 = add nsw i64 %81, %80
  store i64 %82, ptr %75, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %10) #4
  call void @_ZNSt4pairIxxEC2IRxS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9)
  invoke void @_ZNSt5queueISt4pairIxxESt5dequeIS1_SaIS1_EEE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(80) %6, ptr noundef nonnull align 8 dereferenceable(16) %10)
          to label %83 unwind label %131

83:                                               ; preds = %79
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #4
  %.pre44 = load i64, ptr @N, align 8
  %.pre45 = load i64, ptr @M, align 8
  br label %84

84:                                               ; preds = %83, %74, %70, %61
  %85 = phi i64 [ %.pre45, %83 ], [ %62, %74 ], [ %62, %70 ], [ %62, %61 ]
  %86 = phi i64 [ %.pre44, %83 ], [ %63, %74 ], [ %63, %70 ], [ %63, %61 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #4
  %87 = load i64, ptr getelementptr inbounds (i8, ptr @dx, i64 16), align 16, !tbaa !5
  %88 = add nsw i64 %87, %32
  store i64 %88, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #4
  %89 = load i64, ptr getelementptr inbounds (i8, ptr @dy, i64 16), align 16, !tbaa !5
  %90 = add nsw i64 %89, %35
  store i64 %90, ptr %9, align 8, !tbaa !5
  %91 = icmp sgt i64 %88, -1
  %92 = icmp sgt i64 %90, -1
  %or.cond.not33.2 = select i1 %91, i1 %92, i1 false
  %.not.2 = icmp slt i64 %88, %86
  %or.cond29.2 = select i1 %or.cond.not33.2, i1 %.not.2, i1 false
  %.not27.2 = icmp slt i64 %90, %85
  %or.cond30.2 = select i1 %or.cond29.2, i1 %.not27.2, i1 false
  br i1 %or.cond30.2, label %93, label %107

93:                                               ; preds = %84
  %94 = getelementptr inbounds [2000 x [2000 x i64]], ptr @a, i64 0, i64 %88, i64 %90
  %95 = load i64, ptr %94, align 8, !tbaa !5
  %96 = icmp eq i64 %95, -1
  br i1 %96, label %107, label %97

97:                                               ; preds = %93
  %98 = getelementptr inbounds [2000 x [2000 x i64]], ptr %2, i64 0, i64 %88, i64 %90
  %99 = load i64, ptr %98, align 8, !tbaa !5
  %100 = sitofp i64 %99 to double
  %101 = fcmp olt double %100, 1.000000e+17
  br i1 %101, label %107, label %102

102:                                              ; preds = %97
  %103 = load i64, ptr %36, align 8, !tbaa !5
  %104 = load i64, ptr @W, align 8, !tbaa !5
  %105 = add nsw i64 %104, %103
  store i64 %105, ptr %98, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %10) #4
  call void @_ZNSt4pairIxxEC2IRxS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9)
  invoke void @_ZNSt5queueISt4pairIxxESt5dequeIS1_SaIS1_EEE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(80) %6, ptr noundef nonnull align 8 dereferenceable(16) %10)
          to label %106 unwind label %131

106:                                              ; preds = %102
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #4
  %.pre46 = load i64, ptr @N, align 8
  %.pre47 = load i64, ptr @M, align 8
  br label %107

107:                                              ; preds = %106, %97, %93, %84
  %108 = phi i64 [ %.pre47, %106 ], [ %85, %97 ], [ %85, %93 ], [ %85, %84 ]
  %109 = phi i64 [ %.pre46, %106 ], [ %86, %97 ], [ %86, %93 ], [ %86, %84 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #4
  %110 = load i64, ptr getelementptr inbounds (i8, ptr @dx, i64 24), align 8, !tbaa !5
  %111 = add nsw i64 %110, %32
  store i64 %111, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #4
  %112 = load i64, ptr getelementptr inbounds (i8, ptr @dy, i64 24), align 8, !tbaa !5
  %113 = add nsw i64 %112, %35
  store i64 %113, ptr %9, align 8, !tbaa !5
  %114 = icmp sgt i64 %111, -1
  %115 = icmp sgt i64 %113, -1
  %or.cond.not33.3 = select i1 %114, i1 %115, i1 false
  %.not.3 = icmp slt i64 %111, %109
  %or.cond29.3 = select i1 %or.cond.not33.3, i1 %.not.3, i1 false
  %.not27.3 = icmp slt i64 %113, %108
  %or.cond30.3 = select i1 %or.cond29.3, i1 %.not27.3, i1 false
  br i1 %or.cond30.3, label %116, label %.loopexit

116:                                              ; preds = %107
  %117 = getelementptr inbounds [2000 x [2000 x i64]], ptr @a, i64 0, i64 %111, i64 %113
  %118 = load i64, ptr %117, align 8, !tbaa !5
  %119 = icmp eq i64 %118, -1
  br i1 %119, label %.loopexit, label %120

120:                                              ; preds = %116
  %121 = getelementptr inbounds [2000 x [2000 x i64]], ptr %2, i64 0, i64 %111, i64 %113
  %122 = load i64, ptr %121, align 8, !tbaa !5
  %123 = sitofp i64 %122 to double
  %124 = fcmp olt double %123, 1.000000e+17
  br i1 %124, label %.loopexit, label %125

125:                                              ; preds = %120
  %126 = load i64, ptr %36, align 8, !tbaa !5
  %127 = load i64, ptr @W, align 8, !tbaa !5
  %128 = add nsw i64 %127, %126
  store i64 %128, ptr %121, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %10) #4
  call void @_ZNSt4pairIxxEC2IRxS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9)
  invoke void @_ZNSt5queueISt4pairIxxESt5dequeIS1_SaIS1_EEE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(80) %6, ptr noundef nonnull align 8 dereferenceable(16) %10)
          to label %129 unwind label %131

129:                                              ; preds = %125
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #4
  br label %.loopexit

.loopexit:                                        ; preds = %129, %120, %116, %107
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #4
  %130 = call noundef zeroext i1 @_ZNKSt5queueISt4pairIxxESt5dequeIS1_SaIS1_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %6)
  br i1 %130, label %._crit_edge40, label %.lr.ph39, !llvm.loop !16

131:                                              ; preds = %125, %102, %79, %56
  %132 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #4
  br label %133

._crit_edge40:                                    ; preds = %.loopexit, %26
  call void @_ZNSt5queueISt4pairIxxESt5dequeIS1_SaIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %6) #4
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %6) #4
  ret void

133:                                              ; preds = %131, %45
  %.pn = phi { ptr, i32 } [ %132, %131 ], [ %46, %45 ]
  call void @_ZNSt5queueISt4pairIxxESt5dequeIS1_SaIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %6) #4
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %6) #4
  resume { ptr, i32 } %.pn
}

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5queueISt4pairIxxESt5dequeIS1_SaIS1_EEEC2IS4_vEEv(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5queueISt4pairIxxESt5dequeIS1_SaIS1_EEE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(80), 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 #2 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt5queueISt4pairIxxESt5dequeIS1_SaIS1_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt5queueISt4pairIxxESt5dequeIS1_SaIS1_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt5queueISt4pairIxxESt5dequeIS1_SaIS1_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt5queueISt4pairIxxESt5dequeIS1_SaIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #3 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = { 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 = distinct !{!9, !10, !11}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.unswitch.partial.disable"}
!12 = distinct !{!12, !10}
!13 = !{!14, !6, i64 0}
!14 = !{!"_ZTSSt4pairIxxE", !6, i64 0, !6, i64 8}
!15 = !{!14, !6, i64 8}
!16 = distinct !{!16, !10}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimpleLoopUnswitchPass,SimplifyCFGPass