; LLVM IR from tangjz/acm-icpc :: codeforces/1427C.ll (Z5solvev)

; 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"

%"struct.std::pair" = type { i32, i32 }

@_ZZ5solvevE1a = external hidden global [300001 x %"struct.std::pair"], align 16
@_ZZ5solvevE3tim = external hidden global [300001 x i32], align 16
@_ZZ5solvevE2dp = external hidden global [300001 x i32], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solvev() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca %"struct.std::pair", align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca %"struct.std::pair", align 4
  %15 = alloca %"struct.std::pair", align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  %16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2, ptr noundef %1)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store i32 0, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  %17 = load i32, ptr %2, align 4, !tbaa !5
  %18 = sub nsw i32 %17, 1
  %19 = mul nsw i32 %18, 2
  store i32 %19, ptr %4, align 4, !tbaa !5
  store i32 0, ptr @_ZZ5solvevE3tim, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 1, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 1, ptr %7, align 4, !tbaa !5
  call void @_ZNSt4pairIiiEC2IiiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS3_OS4_(ptr noundef nonnull align 4 dereferenceable(8) %5, ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %20 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) @_ZZ5solvevE1a, ptr noundef nonnull align 4 dereferenceable(8) %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 1, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 0, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 -1, ptr %10, align 4, !tbaa !5
  br label %21

21:                                               ; preds = %120, %0
  %22 = load i32, ptr %8, align 4, !tbaa !5
  %23 = load i32, ptr %1, align 4, !tbaa !5
  %24 = icmp sle i32 %22, %23
  br i1 %24, label %26, label %25

25:                                               ; preds = %21
  store i32 2, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %123

26:                                               ; preds = %21
  %27 = load i32, ptr %8, align 4, !tbaa !5
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds i32, ptr @_ZZ5solvevE3tim, i64 %28
  %30 = load i32, ptr %8, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [300001 x %"struct.std::pair"], ptr @_ZZ5solvevE1a, i64 0, i64 %31
  %33 = getelementptr inbounds %"struct.std::pair", ptr %32, i32 0, i32 0
  %34 = load i32, ptr %8, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [300001 x %"struct.std::pair"], ptr @_ZZ5solvevE1a, i64 0, i64 %35
  %37 = getelementptr inbounds %"struct.std::pair", ptr %36, i32 0, i32 1
  %38 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef %29, ptr noundef %33, ptr noundef %37)
  br label %39

39:                                               ; preds = %62, %26
  %40 = load i32, ptr %9, align 4, !tbaa !5
  %41 = load i32, ptr %8, align 4, !tbaa !5
  %42 = icmp slt i32 %40, %41
  br i1 %42, label %43, label %55

43:                                               ; preds = %39
  %44 = load i32, ptr %8, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [300001 x i32], ptr @_ZZ5solvevE3tim, i64 0, i64 %45
  %47 = load i32, ptr %46, align 4, !tbaa !5
  %48 = load i32, ptr %9, align 4, !tbaa !5
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [300001 x i32], ptr @_ZZ5solvevE3tim, i64 0, i64 %49
  %51 = load i32, ptr %50, align 4, !tbaa !5
  %52 = sub nsw i32 %47, %51
  %53 = load i32, ptr %4, align 4, !tbaa !5
  %54 = icmp sge i32 %52, %53
  br label %55

55:                                               ; preds = %43, %39
  %56 = phi i1 [ false, %39 ], [ %54, %43 ]
  br i1 %56, label %57, label %65

57:                                               ; preds = %55
  %58 = load i32, ptr %9, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [300001 x i32], ptr @_ZZ5solvevE2dp, i64 0, i64 %59
  %61 = load i32, ptr %60, align 4, !tbaa !5
  call void @_Z7upd_maxRii(ptr noundef nonnull align 4 dereferenceable(4) %10, i32 noundef %61)
  br label %62

62:                                               ; preds = %57
  %63 = load i32, ptr %9, align 4, !tbaa !5
  %64 = add nsw i32 %63, 1
  store i32 %64, ptr %9, align 4, !tbaa !5
  br label %39, !llvm.loop !9

65:                                               ; preds = %55
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %66 = load i32, ptr %10, align 4, !tbaa !5
  %67 = load i32, ptr %8, align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [300001 x i32], ptr @_ZZ5solvevE2dp, i64 0, i64 %68
  store i32 %66, ptr %69, align 4, !tbaa !5
  store ptr %69, ptr %12, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  %70 = load i32, ptr %9, align 4, !tbaa !5
  store i32 %70, ptr %13, align 4, !tbaa !5
  br label %71

71:                                               ; preds = %103, %65
  %72 = load i32, ptr %13, align 4, !tbaa !5
  %73 = load i32, ptr %8, align 4, !tbaa !5
  %74 = icmp slt i32 %72, %73
  br i1 %74, label %76, label %75

75:                                               ; preds = %71
  store i32 8, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %106

76:                                               ; preds = %71
  %77 = load i32, ptr %8, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [300001 x i32], ptr @_ZZ5solvevE3tim, i64 0, i64 %78
  %80 = load i32, ptr %79, align 4, !tbaa !5
  %81 = load i32, ptr %13, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [300001 x i32], ptr @_ZZ5solvevE3tim, i64 0, i64 %82
  %84 = load i32, ptr %83, align 4, !tbaa !5
  %85 = sub nsw i32 %80, %84
  %86 = load i32, ptr %8, align 4, !tbaa !5
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [300001 x %"struct.std::pair"], ptr @_ZZ5solvevE1a, i64 0, i64 %87
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %14, ptr align 8 %88, i64 8, i1 false)
  %89 = load i32, ptr %13, align 4, !tbaa !5
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [300001 x %"struct.std::pair"], ptr @_ZZ5solvevE1a, i64 0, i64 %90
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %15, ptr align 8 %91, i64 8, i1 false)
  %92 = load i64, ptr %14, align 4
  %93 = load i64, ptr %15, align 4
  %94 = call noundef i32 @_Z4distSt4pairIiiES0_(i64 %92, i64 %93)
  %95 = icmp sge i32 %85, %94
  br i1 %95, label %96, label %102

96:                                               ; preds = %76
  %97 = load ptr, ptr %12, align 8, !tbaa !11
  %98 = load i32, ptr %13, align 4, !tbaa !5
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [300001 x i32], ptr @_ZZ5solvevE2dp, i64 0, i64 %99
  %101 = load i32, ptr %100, align 4, !tbaa !5
  call void @_Z7upd_maxRii(ptr noundef nonnull align 4 dereferenceable(4) %97, i32 noundef %101)
  br label %102

102:                                              ; preds = %96, %76
  br label %103

103:                                              ; preds = %102
  %104 = load i32, ptr %13, align 4, !tbaa !5
  %105 = add nsw i32 %104, 1
  store i32 %105, ptr %13, align 4, !tbaa !5
  br label %71, !llvm.loop !13

106:                                              ; preds = %75
  %107 = load ptr, ptr %12, align 8, !tbaa !11
  %108 = load i32, ptr %107, align 4, !tbaa !5
  %109 = icmp slt i32 %108, 0
  br i1 %109, label %110, label %115

110:                                              ; preds = %106
  %111 = load i32, ptr %8, align 4, !tbaa !5
  %112 = add nsw i32 %111, -1
  store i32 %112, ptr %8, align 4, !tbaa !5
  %113 = load i32, ptr %1, align 4, !tbaa !5
  %114 = add nsw i32 %113, -1
  store i32 %114, ptr %1, align 4, !tbaa !5
  br label %119

115:                                              ; preds = %106
  %116 = load ptr, ptr %12, align 8, !tbaa !11
  %117 = load i32, ptr %116, align 4, !tbaa !5
  %118 = add nsw i32 %117, 1
  store i32 %118, ptr %116, align 4, !tbaa !5
  call void @_Z7upd_maxRii(ptr noundef nonnull align 4 dereferenceable(4) %3, i32 noundef %118)
  br label %119

119:                                              ; preds = %115, %110
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  br label %120

120:                                              ; preds = %119
  %121 = load i32, ptr %8, align 4, !tbaa !5
  %122 = add nsw i32 %121, 1
  store i32 %122, ptr %8, align 4, !tbaa !5
  br label %21, !llvm.loop !14

123:                                              ; preds = %25
  %124 = load i32, ptr %3, align 4, !tbaa !5
  %125 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %124)
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #6
  ret void
}

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

declare i32 @__isoc99_scanf(ptr noundef, ...) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt4pairIiiEC2IiiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS3_OS4_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) #3 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_Z7upd_maxRii(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef) #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z4distSt4pairIiiES0_(i64, i64) #4

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #5

declare i32 @printf(ptr noundef, ...) #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 = { "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 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 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { nounwind }

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

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


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

%"struct.std::pair" = type { i32, i32 }

@_ZZ5solvevE1a = external hidden global [300001 x %"struct.std::pair"], align 16
@_ZZ5solvevE3tim = external hidden global [300001 x i32], align 16
@_ZZ5solvevE2dp = external hidden global [300001 x i32], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_Z5solvev() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca %"struct.std::pair", align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #4
  %8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %2, ptr noundef nonnull %1)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #4
  store i32 0, ptr %3, align 4, !tbaa !5
  %9 = load i32, ptr %2, align 4, !tbaa !5
  %10 = shl i32 %9, 1
  %11 = add i32 %10, -2
  store i32 0, ptr @_ZZ5solvevE3tim, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #4
  store i32 1, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #4
  store i32 1, ptr %6, align 4, !tbaa !5
  call void @_ZNSt4pairIiiEC2IiiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS3_OS4_(ptr noundef nonnull align 4 dereferenceable(8) %4, ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %12 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) @_ZZ5solvevE1a, ptr noundef nonnull align 4 dereferenceable(8) %4) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #4
  store i32 -1, ptr %7, align 4, !tbaa !5
  %13 = load i32, ptr %1, align 4, !tbaa !5
  %.not37 = icmp slt i32 %13, 1
  br i1 %.not37, label %._crit_edge42, label %.lr.ph41

._crit_edge42.loopexit:                           ; preds = %57
  %.pre49 = load i32, ptr %3, align 4, !tbaa !5
  br label %._crit_edge42

._crit_edge42:                                    ; preds = %._crit_edge42.loopexit, %0
  %14 = phi i32 [ %.pre49, %._crit_edge42.loopexit ], [ 0, %0 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #4
  %15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %14)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #4
  ret void

.lr.ph41:                                         ; preds = %0, %57
  %.039 = phi i32 [ %59, %57 ], [ 1, %0 ]
  %.02638 = phi i32 [ %.127.lcssa51, %57 ], [ 0, %0 ]
  %16 = sext i32 %.039 to i64
  %17 = getelementptr inbounds i32, ptr @_ZZ5solvevE3tim, i64 %16
  %18 = getelementptr inbounds [300001 x %"struct.std::pair"], ptr @_ZZ5solvevE1a, i64 0, i64 %16
  %19 = getelementptr inbounds i8, ptr %18, i64 4
  %20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %17, ptr noundef nonnull %18, ptr noundef nonnull %19)
  %21 = icmp slt i32 %.02638, %.039
  br i1 %21, label %.lr.ph.preheader, label %.critedge

.lr.ph.preheader:                                 ; preds = %.lr.ph41
  %22 = sext i32 %.02638 to i64
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %27
  %indvars.iv = phi i64 [ %22, %.lr.ph.preheader ], [ %indvars.iv.next, %27 ]
  %23 = load i32, ptr %17, align 4, !tbaa !5
  %24 = getelementptr inbounds [300001 x i32], ptr @_ZZ5solvevE3tim, i64 0, i64 %indvars.iv
  %25 = load i32, ptr %24, align 4, !tbaa !5
  %26 = sub nsw i32 %23, %25
  %.not30 = icmp slt i32 %26, %11
  br i1 %.not30, label %.critedge.loopexit, label %27

27:                                               ; preds = %.lr.ph
  %28 = getelementptr inbounds [300001 x i32], ptr @_ZZ5solvevE2dp, i64 0, i64 %indvars.iv
  %29 = load i32, ptr %28, align 4, !tbaa !5
  call void @_Z7upd_maxRii(ptr noundef nonnull align 4 dereferenceable(4) %7, i32 noundef %29)
  %indvars.iv.next = add nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %16
  br i1 %exitcond.not, label %.critedge.thread, label %.lr.ph, !llvm.loop !9

.critedge.thread:                                 ; preds = %27
  %30 = load i32, ptr %7, align 4, !tbaa !5
  %31 = getelementptr inbounds [300001 x i32], ptr @_ZZ5solvevE2dp, i64 0, i64 %16
  store i32 %30, ptr %31, align 4, !tbaa !5
  br label %._crit_edge

.critedge.loopexit:                               ; preds = %.lr.ph
  %32 = trunc nsw i64 %indvars.iv to i32
  br label %.critedge

.critedge:                                        ; preds = %.critedge.loopexit, %.lr.ph41
  %.127.lcssa = phi i32 [ %.02638, %.lr.ph41 ], [ %32, %.critedge.loopexit ]
  %33 = load i32, ptr %7, align 4, !tbaa !5
  %34 = getelementptr inbounds [300001 x i32], ptr @_ZZ5solvevE2dp, i64 0, i64 %16
  store i32 %33, ptr %34, align 4, !tbaa !5
  %35 = icmp slt i32 %.127.lcssa, %.039
  br i1 %35, label %.lr.ph36, label %._crit_edge

.lr.ph36:                                         ; preds = %.critedge
  %36 = sext i32 %.127.lcssa to i64
  br label %40

._crit_edge.loopexit:                             ; preds = %50
  %.pre = load i32, ptr %34, align 4, !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %.critedge.thread, %._crit_edge.loopexit, %.critedge
  %37 = phi ptr [ %34, %._crit_edge.loopexit ], [ %34, %.critedge ], [ %31, %.critedge.thread ]
  %.127.lcssa51 = phi i32 [ %.127.lcssa, %._crit_edge.loopexit ], [ %.127.lcssa, %.critedge ], [ %.039, %.critedge.thread ]
  %38 = phi i32 [ %.pre, %._crit_edge.loopexit ], [ %33, %.critedge ], [ %30, %.critedge.thread ]
  %39 = icmp slt i32 %38, 0
  br i1 %39, label %51, label %55

40:                                               ; preds = %.lr.ph36, %50
  %indvars.iv44 = phi i64 [ %36, %.lr.ph36 ], [ %indvars.iv.next45, %50 ]
  %41 = load i32, ptr %17, align 4, !tbaa !5
  %42 = getelementptr inbounds [300001 x i32], ptr @_ZZ5solvevE3tim, i64 0, i64 %indvars.iv44
  %43 = load i32, ptr %42, align 4, !tbaa !5
  %44 = sub nsw i32 %41, %43
  %.sroa.01.0.copyload = load i64, ptr %18, align 8
  %45 = getelementptr inbounds [300001 x %"struct.std::pair"], ptr @_ZZ5solvevE1a, i64 0, i64 %indvars.iv44
  %.sroa.0.0.copyload = load i64, ptr %45, align 8
  %46 = call noundef i32 @_Z4distSt4pairIiiES0_(i64 %.sroa.01.0.copyload, i64 %.sroa.0.0.copyload)
  %.not31 = icmp slt i32 %44, %46
  br i1 %.not31, label %50, label %47

47:                                               ; preds = %40
  %48 = getelementptr inbounds [300001 x i32], ptr @_ZZ5solvevE2dp, i64 0, i64 %indvars.iv44
  %49 = load i32, ptr %48, align 4, !tbaa !5
  call void @_Z7upd_maxRii(ptr noundef nonnull align 4 dereferenceable(4) %34, i32 noundef %49)
  br label %50

50:                                               ; preds = %40, %47
  %indvars.iv.next45 = add nsw i64 %indvars.iv44, 1
  %lftr.wideiv = trunc i64 %indvars.iv.next45 to i32
  %exitcond47.not = icmp eq i32 %.039, %lftr.wideiv
  br i1 %exitcond47.not, label %._crit_edge.loopexit, label %40, !llvm.loop !11

51:                                               ; preds = %._crit_edge
  %52 = add nsw i32 %.039, -1
  %53 = load i32, ptr %1, align 4, !tbaa !5
  %54 = add nsw i32 %53, -1
  store i32 %54, ptr %1, align 4, !tbaa !5
  br label %57

55:                                               ; preds = %._crit_edge
  %56 = add nuw nsw i32 %38, 1
  store i32 %56, ptr %37, align 4, !tbaa !5
  call void @_Z7upd_maxRii(ptr noundef nonnull align 4 dereferenceable(4) %3, i32 noundef %56)
  %.pre48 = load i32, ptr %1, align 4, !tbaa !5
  br label %57

57:                                               ; preds = %55, %51
  %58 = phi i32 [ %54, %51 ], [ %.pre48, %55 ]
  %.1 = phi i32 [ %52, %51 ], [ %.039, %55 ]
  %59 = add nsw i32 %.1, 1
  %.not.not = icmp slt i32 %.1, %58
  br i1 %.not.not, label %.lr.ph41, label %._crit_edge42.loopexit, !llvm.loop !12
}

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

; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt4pairIiiEC2IiiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS3_OS4_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #0 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_Z7upd_maxRii(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z4distSt4pairIiiES0_(i64, i64) local_unnamed_addr #3

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}


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