; LLVM IR from lzyrapx/Competitive-Programming :: ACdream (1082（模拟+make_pair）)

; 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 }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }

@sum = external dso_local global [1234 x [1234 x i32]], align 16
@ask = external dso_local global [1234 x %"struct.std::pair"], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, 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 i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca %"struct.std::pair", align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  %21 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %6)
  br label %22

22:                                               ; preds = %169, %0
  %23 = load i32, ptr %6, align 4, !tbaa !5
  %24 = add nsw i32 %23, -1
  store i32 %24, ptr %6, align 4, !tbaa !5
  %25 = icmp ne i32 %23, 0
  br i1 %25, label %26, label %170

26:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  %27 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %8)
  %28 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %27, ptr noundef nonnull align 4 dereferenceable(4) %7)
  call void @llvm.memset.p0.i64(ptr align 16 @sum, i8 0, i64 6091024, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 1, ptr %9, align 4, !tbaa !5
  br label %29

29:                                               ; preds = %81, %26
  %30 = load i32, ptr %9, align 4, !tbaa !5
  %31 = load i32, ptr %7, align 4, !tbaa !5
  %32 = icmp sle i32 %30, %31
  br i1 %32, label %34, label %33

33:                                               ; preds = %29
  store i32 4, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %84

34:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 1, ptr %11, align 4, !tbaa !5
  br label %35

35:                                               ; preds = %77, %34
  %36 = load i32, ptr %11, align 4, !tbaa !5
  %37 = load i32, ptr %8, align 4, !tbaa !5
  %38 = icmp sle i32 %36, %37
  br i1 %38, label %40, label %39

39:                                               ; preds = %35
  store i32 7, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %80

40:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  %41 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %12)
  %42 = load i32, ptr %12, align 4, !tbaa !5
  %43 = load i32, ptr %9, align 4, !tbaa !5
  %44 = sub nsw i32 %43, 1
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [1234 x [1234 x i32]], ptr @sum, i64 0, i64 %45
  %47 = load i32, ptr %11, align 4, !tbaa !5
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [1234 x i32], ptr %46, i64 0, i64 %48
  %50 = load i32, ptr %49, align 4, !tbaa !5
  %51 = add nsw i32 %42, %50
  %52 = load i32, ptr %9, align 4, !tbaa !5
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [1234 x [1234 x i32]], ptr @sum, i64 0, i64 %53
  %55 = load i32, ptr %11, align 4, !tbaa !5
  %56 = sub nsw i32 %55, 1
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds [1234 x i32], ptr %54, i64 0, i64 %57
  %59 = load i32, ptr %58, align 4, !tbaa !5
  %60 = add nsw i32 %51, %59
  %61 = load i32, ptr %9, align 4, !tbaa !5
  %62 = sub nsw i32 %61, 1
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [1234 x [1234 x i32]], ptr @sum, i64 0, i64 %63
  %65 = load i32, ptr %11, align 4, !tbaa !5
  %66 = sub nsw i32 %65, 1
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [1234 x i32], ptr %64, i64 0, i64 %67
  %69 = load i32, ptr %68, align 4, !tbaa !5
  %70 = sub nsw i32 %60, %69
  %71 = load i32, ptr %9, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [1234 x [1234 x i32]], ptr @sum, i64 0, i64 %72
  %74 = load i32, ptr %11, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [1234 x i32], ptr %73, i64 0, i64 %75
  store i32 %70, ptr %76, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %77

77:                                               ; preds = %40
  %78 = load i32, ptr %11, align 4, !tbaa !5
  %79 = add nsw i32 %78, 1
  store i32 %79, ptr %11, align 4, !tbaa !5
  br label %35, !llvm.loop !9

80:                                               ; preds = %39
  br label %81

81:                                               ; preds = %80
  %82 = load i32, ptr %9, align 4, !tbaa !5
  %83 = add nsw i32 %82, 1
  store i32 %83, ptr %9, align 4, !tbaa !5
  br label %29, !llvm.loop !11

84:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  %85 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %13)
  br label %86

86:                                               ; preds = %166, %84
  %87 = load i32, ptr %13, align 4, !tbaa !5
  %88 = add nsw i32 %87, -1
  store i32 %88, ptr %13, align 4, !tbaa !5
  %89 = icmp ne i32 %87, 0
  br i1 %89, label %90, label %169

90:                                               ; preds = %86
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  %91 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %14)
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  store i32 0, ptr %17, align 4, !tbaa !5
  br label %92

92:                                               ; preds = %105, %90
  %93 = load i32, ptr %17, align 4, !tbaa !5
  %94 = load i32, ptr %14, align 4, !tbaa !5
  %95 = icmp slt i32 %93, %94
  br i1 %95, label %97, label %96

96:                                               ; preds = %92
  store i32 12, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  br label %108

97:                                               ; preds = %92
  %98 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %16)
  %99 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %98, ptr noundef nonnull align 4 dereferenceable(4) %15)
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  %100 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %15, ptr noundef nonnull align 4 dereferenceable(4) %16)
  store i64 %100, ptr %18, align 4
  %101 = load i32, ptr %17, align 4, !tbaa !5
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [1234 x %"struct.std::pair"], ptr @ask, i64 0, i64 %102
  %104 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %103, ptr noundef nonnull align 4 dereferenceable(8) %18) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  br label %105

105:                                              ; preds = %97
  %106 = load i32, ptr %17, align 4, !tbaa !5
  %107 = add nsw i32 %106, 1
  store i32 %107, ptr %17, align 4, !tbaa !5
  br label %92, !llvm.loop !12

108:                                              ; preds = %96
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  store i32 0, ptr %19, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #6
  store i32 0, ptr %20, align 4, !tbaa !5
  br label %109

109:                                              ; preds = %163, %108
  %110 = load i32, ptr %20, align 4, !tbaa !5
  %111 = load i32, ptr %14, align 4, !tbaa !5
  %112 = icmp slt i32 %110, %111
  br i1 %112, label %114, label %113

113:                                              ; preds = %109
  store i32 15, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  br label %166

114:                                              ; preds = %109
  %115 = load i32, ptr %20, align 4, !tbaa !5
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds [1234 x %"struct.std::pair"], ptr @ask, i64 0, i64 %116
  %118 = getelementptr inbounds %"struct.std::pair", ptr %117, i32 0, i32 0
  %119 = load i32, ptr %118, align 8, !tbaa !13
  store i32 %119, ptr %2, align 4, !tbaa !5
  %120 = load i32, ptr %20, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [1234 x %"struct.std::pair"], ptr @ask, i64 0, i64 %121
  %123 = getelementptr inbounds %"struct.std::pair", ptr %122, i32 0, i32 1
  %124 = load i32, ptr %123, align 4, !tbaa !15
  store i32 %124, ptr %4, align 4, !tbaa !5
  %125 = load i32, ptr %20, align 4, !tbaa !5
  %126 = add nsw i32 %125, 1
  %127 = load i32, ptr %14, align 4, !tbaa !5
  %128 = srem i32 %126, %127
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds [1234 x %"struct.std::pair"], ptr @ask, i64 0, i64 %129
  %131 = getelementptr inbounds %"struct.std::pair", ptr %130, i32 0, i32 0
  %132 = load i32, ptr %131, align 8, !tbaa !13
  store i32 %132, ptr %3, align 4, !tbaa !5
  %133 = load i32, ptr %20, align 4, !tbaa !5
  %134 = add nsw i32 %133, 1
  %135 = load i32, ptr %14, align 4, !tbaa !5
  %136 = srem i32 %134, %135
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds [1234 x %"struct.std::pair"], ptr @ask, i64 0, i64 %137
  %139 = getelementptr inbounds %"struct.std::pair", ptr %138, i32 0, i32 1
  %140 = load i32, ptr %139, align 4, !tbaa !15
  store i32 %140, ptr %5, align 4, !tbaa !5
  %141 = load i32, ptr %2, align 4, !tbaa !5
  %142 = load i32, ptr %3, align 4, !tbaa !5
  %143 = icmp eq i32 %141, %142
  br i1 %143, label %144, label %162

144:                                              ; preds = %114
  %145 = load i32, ptr %2, align 4, !tbaa !5
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds [1234 x [1234 x i32]], ptr @sum, i64 0, i64 %146
  %148 = load i32, ptr %4, align 4, !tbaa !5
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds [1234 x i32], ptr %147, i64 0, i64 %149
  %151 = load i32, ptr %150, align 4, !tbaa !5
  %152 = load i32, ptr %2, align 4, !tbaa !5
  %153 = sext i32 %152 to i64
  %154 = getelementptr inbounds [1234 x [1234 x i32]], ptr @sum, i64 0, i64 %153
  %155 = load i32, ptr %5, align 4, !tbaa !5
  %156 = sext i32 %155 to i64
  %157 = getelementptr inbounds [1234 x i32], ptr %154, i64 0, i64 %156
  %158 = load i32, ptr %157, align 4, !tbaa !5
  %159 = sub nsw i32 %151, %158
  %160 = load i32, ptr %19, align 4, !tbaa !5
  %161 = add nsw i32 %160, %159
  store i32 %161, ptr %19, align 4, !tbaa !5
  br label %162

162:                                              ; preds = %144, %114
  br label %163

163:                                              ; preds = %162
  %164 = load i32, ptr %20, align 4, !tbaa !5
  %165 = add nsw i32 %164, 1
  store i32 %165, ptr %20, align 4, !tbaa !5
  br label %109, !llvm.loop !16

166:                                              ; preds = %113
  %167 = load i32, ptr %19, align 4, !tbaa !5
  %168 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %167)
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %86, !llvm.loop !17

169:                                              ; preds = %86
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %22, !llvm.loop !18

170:                                              ; preds = %22
  store i32 0, ptr %1, align 4
  store i32 1, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  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
  %171 = load i32, ptr %1, align 4
  ret i32 %171
}

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

; 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 i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #4

; 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)) #5 align 2

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

attributes #0 = { mustprogress norecurse 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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 #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 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = !{!14, !6, i64 0}
!14 = !{!"_ZTSSt4pairIiiE", !6, i64 0, !6, i64 4}
!15 = !{!14, !6, i64 4}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !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 }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }

@sum = external dso_local local_unnamed_addr global [1234 x [1234 x i32]], align 16
@ask = external dso_local global [1234 x %"struct.std::pair"], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca %"struct.std::pair", align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  %10 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %11 = load i32, ptr %1, align 4, !tbaa !5
  %12 = add nsw i32 %11, -1
  store i32 %12, ptr %1, align 4, !tbaa !5
  %.not58 = icmp eq i32 %11, 0
  br i1 %.not58, label %._crit_edge61, label %.lr.ph60

.lr.ph60:                                         ; preds = %0, %._crit_edge57
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  %13 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %14 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %13, ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(6091024) @sum, i8 0, i64 6091024, i1 false)
  %15 = load i32, ptr %2, align 4, !tbaa !5
  %.not3643 = icmp slt i32 %15, 1
  %16 = load i32, ptr %3, align 4
  %17 = icmp slt i32 %16, 1
  %or.cond = select i1 %.not3643, i1 true, i1 %17
  br i1 %or.cond, label %._crit_edge45, label %.preheader40

.preheader40:                                     ; preds = %.lr.ph60, %._crit_edge
  %18 = phi i32 [ %24, %._crit_edge ], [ %15, %.lr.ph60 ]
  %19 = phi i32 [ %25, %._crit_edge ], [ %16, %.lr.ph60 ]
  %indvars.iv65 = phi i64 [ %indvars.iv.next66, %._crit_edge ], [ 1, %.lr.ph60 ]
  %.not3841 = icmp slt i32 %19, 1
  br i1 %.not3841, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader40
  %20 = add nsw i64 %indvars.iv65, -1
  br label %27

._crit_edge45:                                    ; preds = %._crit_edge, %.lr.ph60
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #7
  %21 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %22 = load i32, ptr %5, align 4, !tbaa !5
  %23 = add nsw i32 %22, -1
  store i32 %23, ptr %5, align 4, !tbaa !5
  %.not3754 = icmp eq i32 %22, 0
  br i1 %.not3754, label %._crit_edge57, label %.lr.ph56

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

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader40
  %24 = phi i32 [ %.pre, %._crit_edge.loopexit ], [ %18, %.preheader40 ]
  %25 = phi i32 [ %41, %._crit_edge.loopexit ], [ %19, %.preheader40 ]
  %indvars.iv.next66 = add nuw nsw i64 %indvars.iv65, 1
  %26 = sext i32 %24 to i64
  %.not36.not = icmp slt i64 %indvars.iv65, %26
  br i1 %.not36.not, label %.preheader40, label %._crit_edge45, !llvm.loop !9

27:                                               ; preds = %.lr.ph, %27
  %indvars.iv = phi i64 [ 1, %.lr.ph ], [ %indvars.iv.next, %27 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #7
  %28 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %29 = load i32, ptr %4, align 4, !tbaa !5
  %30 = getelementptr inbounds [1234 x [1234 x i32]], ptr @sum, i64 0, i64 %20, i64 %indvars.iv
  %31 = load i32, ptr %30, align 4, !tbaa !5
  %32 = add nsw i32 %31, %29
  %33 = add nsw i64 %indvars.iv, -1
  %34 = getelementptr inbounds [1234 x [1234 x i32]], ptr @sum, i64 0, i64 %indvars.iv65, i64 %33
  %35 = load i32, ptr %34, align 4, !tbaa !5
  %36 = add nsw i32 %32, %35
  %37 = getelementptr inbounds [1234 x [1234 x i32]], ptr @sum, i64 0, i64 %20, i64 %33
  %38 = load i32, ptr %37, align 4, !tbaa !5
  %39 = sub i32 %36, %38
  %40 = getelementptr inbounds [1234 x [1234 x i32]], ptr @sum, i64 0, i64 %indvars.iv65, i64 %indvars.iv
  store i32 %39, ptr %40, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %41 = load i32, ptr %3, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %.not38.not = icmp slt i64 %indvars.iv, %42
  br i1 %.not38.not, label %27, label %._crit_edge.loopexit, !llvm.loop !12

.lr.ph56:                                         ; preds = %._crit_edge45, %._crit_edge52
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #7
  %43 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %6)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #7
  %44 = load i32, ptr %6, align 4, !tbaa !5
  %45 = icmp sgt i32 %44, 0
  br i1 %45, label %.lr.ph48, label %._crit_edge52

.preheader:                                       ; preds = %.lr.ph48
  %46 = icmp sgt i32 %53, 0
  br i1 %46, label %.lr.ph51.preheader, label %._crit_edge52

.lr.ph51.preheader:                               ; preds = %.preheader
  %47 = zext nneg i32 %53 to i64
  br label %.lr.ph51

.lr.ph48:                                         ; preds = %.lr.ph56, %.lr.ph48
  %indvars.iv68 = phi i64 [ %indvars.iv.next69, %.lr.ph48 ], [ 0, %.lr.ph56 ]
  %48 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %8)
  %49 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %48, ptr noundef nonnull align 4 dereferenceable(4) %7)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #7
  %50 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %8)
  store i64 %50, ptr %9, align 8
  %51 = getelementptr inbounds [1234 x %"struct.std::pair"], ptr @ask, i64 0, i64 %indvars.iv68
  %52 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %51, ptr noundef nonnull align 4 dereferenceable(8) %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #7
  %indvars.iv.next69 = add nuw nsw i64 %indvars.iv68, 1
  %53 = load i32, ptr %6, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = icmp slt i64 %indvars.iv.next69, %54
  br i1 %55, label %.lr.ph48, label %.preheader, !llvm.loop !13

._crit_edge52:                                    ; preds = %81, %.lr.ph56, %.preheader
  %.030.lcssa = phi i32 [ 0, %.preheader ], [ 0, %.lr.ph56 ], [ %.1, %81 ]
  %56 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %.030.lcssa)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #7
  %57 = load i32, ptr %5, align 4, !tbaa !5
  %58 = add nsw i32 %57, -1
  store i32 %58, ptr %5, align 4, !tbaa !5
  %.not37 = icmp eq i32 %57, 0
  br i1 %.not37, label %._crit_edge57, label %.lr.ph56, !llvm.loop !14

.lr.ph51:                                         ; preds = %.lr.ph51.preheader, %81
  %indvars.iv71 = phi i64 [ 0, %.lr.ph51.preheader ], [ %indvars.iv.next72, %81 ]
  %.03049 = phi i32 [ 0, %.lr.ph51.preheader ], [ %.1, %81 ]
  %59 = getelementptr inbounds [1234 x %"struct.std::pair"], ptr @ask, i64 0, i64 %indvars.iv71
  %60 = load i32, ptr %59, align 8, !tbaa !15
  %indvars.iv.next72 = add nuw nsw i64 %indvars.iv71, 1
  %61 = icmp eq i64 %indvars.iv.next72, %47
  %62 = and i64 %indvars.iv.next72, 4294967295
  %63 = select i1 %61, i64 0, i64 %62
  %64 = getelementptr inbounds [1234 x %"struct.std::pair"], ptr @ask, i64 0, i64 %63
  %65 = load i32, ptr %64, align 8, !tbaa !15
  %66 = icmp eq i32 %60, %65
  br i1 %66, label %67, label %81

67:                                               ; preds = %.lr.ph51
  %68 = getelementptr inbounds i8, ptr %64, i64 4
  %69 = load i32, ptr %68, align 4, !tbaa !17
  %70 = getelementptr inbounds i8, ptr %59, i64 4
  %71 = load i32, ptr %70, align 4, !tbaa !17
  %72 = sext i32 %60 to i64
  %73 = sext i32 %71 to i64
  %74 = getelementptr inbounds [1234 x [1234 x i32]], ptr @sum, i64 0, i64 %72, i64 %73
  %75 = load i32, ptr %74, align 4, !tbaa !5
  %76 = sext i32 %69 to i64
  %77 = getelementptr inbounds [1234 x [1234 x i32]], ptr @sum, i64 0, i64 %72, i64 %76
  %78 = load i32, ptr %77, align 4, !tbaa !5
  %79 = add i32 %75, %.03049
  %80 = sub i32 %79, %78
  br label %81

81:                                               ; preds = %.lr.ph51, %67
  %.1 = phi i32 [ %80, %67 ], [ %.03049, %.lr.ph51 ]
  %exitcond.not = icmp eq i64 %indvars.iv.next72, %47
  br i1 %exitcond.not, label %._crit_edge52, label %.lr.ph51, !llvm.loop !18

._crit_edge57:                                    ; preds = %._crit_edge52, %._crit_edge45
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  %82 = load i32, ptr %1, align 4, !tbaa !5
  %83 = add nsw i32 %82, -1
  store i32 %83, ptr %1, align 4, !tbaa !5
  %.not = icmp eq i32 %82, 0
  br i1 %.not, label %._crit_edge61, label %.lr.ph60, !llvm.loop !19

._crit_edge61:                                    ; preds = %._crit_edge57, %0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  ret i32 0
}

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

; 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 i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #4

; 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 #5 align 2

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

attributes #0 = { mustprogress norecurse 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 = { "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 nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 #6 = { 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 #7 = { 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, !11}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.unswitch.partial.disable"}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = !{!16, !6, i64 0}
!16 = !{!"_ZTSSt4pairIiiE", !6, i64 0, !6, i64 4}
!17 = !{!16, !6, i64 4}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}


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