; LLVM IR from tangjz/acm-icpc :: self_training/2015-03-15 (I)

; 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, i64 }

@t = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z4initii(i32 noundef, i32 noundef) #0

; 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: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #2

; Function Attrs: mustprogress uwtable
declare dso_local { i32, i64 } @_Z4findiixb(i32 noundef, i32 noundef, i64 noundef, i1 noundef zeroext) #0

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5cha_xiiix(i32 noundef, i32 noundef, i32 noundef, i64 noundef) #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5cha_siiii(i32 noundef, i32 noundef, i32 noundef, i32 noundef) #0

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_Z3queiiii(i32 noundef, i32 noundef, i32 noundef, i32 noundef) #0

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_Z3updRxx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #2

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #4 {
  %1 = alloca i32, align 4
  %2 = alloca [2 x i8], align 1
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca %"struct.std::pair", align 8
  %6 = alloca %"struct.std::pair", align 8
  %7 = alloca %"struct.std::pair", align 8
  %8 = alloca %"struct.std::pair", align 8
  %9 = alloca i32, align 4
  %10 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  %11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @t)
  br label %12

12:                                               ; preds = %127, %0
  %13 = load i32, ptr @t, align 4, !tbaa !5
  %14 = add nsw i32 %13, -1
  store i32 %14, ptr @t, align 4, !tbaa !5
  %15 = icmp ne i32 %13, 0
  br i1 %15, label %16, label %128

16:                                               ; preds = %12
  %17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef @n, ptr noundef @m)
  %18 = load i32, ptr @n, align 4, !tbaa !5
  call void @_Z4initii(i32 noundef 1, i32 noundef %18)
  br label %19

19:                                               ; preds = %126, %124, %16
  %20 = load i32, ptr @m, align 4, !tbaa !5
  %21 = add nsw i32 %20, -1
  store i32 %21, ptr @m, align 4, !tbaa !5
  %22 = icmp ne i32 %20, 0
  br i1 %22, label %23, label %127

23:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 2, ptr %2) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %5) #6
  call void @_ZNSt4pairIixEC2IixTnNSt9enable_ifIXsr6__and_ISt37__is_implicitly_default_constructibleIT_ES3_IT0_EEE5valueEbE4typeELb1EEEv(ptr noundef nonnull align 8 dereferenceable(16) %5)
  call void @llvm.lifetime.start.p0(i64 16, ptr %6) #6
  call void @_ZNSt4pairIixEC2IixTnNSt9enable_ifIXsr6__and_ISt37__is_implicitly_default_constructibleIT_ES3_IT0_EEE5valueEbE4typeELb1EEEv(ptr noundef nonnull align 8 dereferenceable(16) %6)
  %24 = getelementptr inbounds [2 x i8], ptr %2, i64 0, i64 0
  %25 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef %24, ptr noundef %3, ptr noundef %4)
  call void @llvm.lifetime.start.p0(i64 16, ptr %7) #6
  %26 = load i32, ptr @n, align 4, !tbaa !5
  %27 = load i64, ptr %3, align 8, !tbaa !9
  %28 = call { i32, i64 } @_Z4findiixb(i32 noundef 1, i32 noundef %26, i64 noundef %27, i1 noundef zeroext false)
  %29 = getelementptr inbounds { i32, i64 }, ptr %7, i32 0, i32 0
  %30 = extractvalue { i32, i64 } %28, 0
  store i32 %30, ptr %29, align 8
  %31 = getelementptr inbounds { i32, i64 }, ptr %7, i32 0, i32 1
  %32 = extractvalue { i32, i64 } %28, 1
  store i64 %32, ptr %31, align 8
  %33 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt4pairIixEaSEOS0_(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 8 dereferenceable(16) %7) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %8) #6
  %34 = load i32, ptr @n, align 4, !tbaa !5
  %35 = load i64, ptr %4, align 8, !tbaa !9
  %36 = call { i32, i64 } @_Z4findiixb(i32 noundef 1, i32 noundef %34, i64 noundef %35, i1 noundef zeroext true)
  %37 = getelementptr inbounds { i32, i64 }, ptr %8, i32 0, i32 0
  %38 = extractvalue { i32, i64 } %36, 0
  store i32 %38, ptr %37, align 8
  %39 = getelementptr inbounds { i32, i64 }, ptr %8, i32 0, i32 1
  %40 = extractvalue { i32, i64 } %36, 1
  store i64 %40, ptr %39, align 8
  %41 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt4pairIixEaSEOS0_(ptr noundef nonnull align 8 dereferenceable(16) %6, ptr noundef nonnull align 8 dereferenceable(16) %8) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %8) #6
  %42 = getelementptr inbounds [2 x i8], ptr %2, i64 0, i64 0
  %43 = load i8, ptr %42, align 1, !tbaa !11
  %44 = sext i8 %43 to i32
  %45 = icmp eq i32 %44, 68
  br i1 %45, label %46, label %87

46:                                               ; preds = %23
  %47 = getelementptr inbounds %"struct.std::pair", ptr %5, i32 0, i32 0
  %48 = load i32, ptr %47, align 8, !tbaa !12
  %49 = getelementptr inbounds %"struct.std::pair", ptr %6, i32 0, i32 0
  %50 = load i32, ptr %49, align 8, !tbaa !12
  %51 = icmp eq i32 %48, %50
  br i1 %51, label %52, label %60

52:                                               ; preds = %46
  %53 = load i32, ptr @n, align 4, !tbaa !5
  %54 = getelementptr inbounds %"struct.std::pair", ptr %5, i32 0, i32 0
  %55 = load i32, ptr %54, align 8, !tbaa !12
  %56 = load i64, ptr %4, align 8, !tbaa !9
  %57 = load i64, ptr %3, align 8, !tbaa !9
  %58 = sub nsw i64 %56, %57
  %59 = add nsw i64 %58, 1
  call void @_Z5cha_xiiix(i32 noundef 1, i32 noundef %53, i32 noundef %55, i64 noundef %59)
  store i32 4, ptr %9, align 4
  br label %124, !llvm.loop !14

60:                                               ; preds = %46
  %61 = load i32, ptr @n, align 4, !tbaa !5
  %62 = getelementptr inbounds %"struct.std::pair", ptr %5, i32 0, i32 0
  %63 = load i32, ptr %62, align 8, !tbaa !12
  %64 = getelementptr inbounds %"struct.std::pair", ptr %5, i32 0, i32 1
  %65 = load i64, ptr %64, align 8, !tbaa !16
  call void @_Z5cha_xiiix(i32 noundef 1, i32 noundef %61, i32 noundef %63, i64 noundef %65)
  %66 = load i32, ptr @n, align 4, !tbaa !5
  %67 = getelementptr inbounds %"struct.std::pair", ptr %6, i32 0, i32 0
  %68 = load i32, ptr %67, align 8, !tbaa !12
  %69 = getelementptr inbounds %"struct.std::pair", ptr %6, i32 0, i32 1
  %70 = load i64, ptr %69, align 8, !tbaa !16
  call void @_Z5cha_xiiix(i32 noundef 1, i32 noundef %66, i32 noundef %68, i64 noundef %70)
  %71 = getelementptr inbounds %"struct.std::pair", ptr %5, i32 0, i32 0
  %72 = load i32, ptr %71, align 8, !tbaa !12
  %73 = add nsw i32 %72, 1
  %74 = getelementptr inbounds %"struct.std::pair", ptr %6, i32 0, i32 0
  %75 = load i32, ptr %74, align 8, !tbaa !12
  %76 = sub nsw i32 %75, 1
  %77 = icmp sle i32 %73, %76
  br i1 %77, label %78, label %86

78:                                               ; preds = %60
  %79 = load i32, ptr @n, align 4, !tbaa !5
  %80 = getelementptr inbounds %"struct.std::pair", ptr %5, i32 0, i32 0
  %81 = load i32, ptr %80, align 8, !tbaa !12
  %82 = add nsw i32 %81, 1
  %83 = getelementptr inbounds %"struct.std::pair", ptr %6, i32 0, i32 0
  %84 = load i32, ptr %83, align 8, !tbaa !12
  %85 = sub nsw i32 %84, 1
  call void @_Z5cha_siiii(i32 noundef 1, i32 noundef %79, i32 noundef %82, i32 noundef %85)
  br label %86

86:                                               ; preds = %78, %60
  br label %123

87:                                               ; preds = %23
  %88 = getelementptr inbounds %"struct.std::pair", ptr %5, i32 0, i32 0
  %89 = load i32, ptr %88, align 8, !tbaa !12
  %90 = getelementptr inbounds %"struct.std::pair", ptr %6, i32 0, i32 0
  %91 = load i32, ptr %90, align 8, !tbaa !12
  %92 = icmp eq i32 %89, %91
  br i1 %92, label %93, label %99

93:                                               ; preds = %87
  %94 = load i64, ptr %4, align 8, !tbaa !9
  %95 = load i64, ptr %3, align 8, !tbaa !9
  %96 = sub nsw i64 %94, %95
  %97 = add nsw i64 %96, 1
  %98 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i64 noundef %97)
  store i32 4, ptr %9, align 4
  br label %124, !llvm.loop !14

99:                                               ; preds = %87
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %100 = getelementptr inbounds %"struct.std::pair", ptr %5, i32 0, i32 1
  %101 = getelementptr inbounds %"struct.std::pair", ptr %6, i32 0, i32 1
  %102 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %100, ptr noundef nonnull align 8 dereferenceable(8) %101)
  %103 = load i64, ptr %102, align 8, !tbaa !9
  store i64 %103, ptr %10, align 8, !tbaa !9
  %104 = getelementptr inbounds %"struct.std::pair", ptr %5, i32 0, i32 0
  %105 = load i32, ptr %104, align 8, !tbaa !12
  %106 = add nsw i32 %105, 1
  %107 = getelementptr inbounds %"struct.std::pair", ptr %6, i32 0, i32 0
  %108 = load i32, ptr %107, align 8, !tbaa !12
  %109 = sub nsw i32 %108, 1
  %110 = icmp sle i32 %106, %109
  br i1 %110, label %111, label %120

111:                                              ; preds = %99
  %112 = load i32, ptr @n, align 4, !tbaa !5
  %113 = getelementptr inbounds %"struct.std::pair", ptr %5, i32 0, i32 0
  %114 = load i32, ptr %113, align 8, !tbaa !12
  %115 = add nsw i32 %114, 1
  %116 = getelementptr inbounds %"struct.std::pair", ptr %6, i32 0, i32 0
  %117 = load i32, ptr %116, align 8, !tbaa !12
  %118 = sub nsw i32 %117, 1
  %119 = call noundef i64 @_Z3queiiii(i32 noundef 1, i32 noundef %112, i32 noundef %115, i32 noundef %118)
  call void @_Z3updRxx(ptr noundef nonnull align 8 dereferenceable(8) %10, i64 noundef %119)
  br label %120

120:                                              ; preds = %111, %99
  %121 = load i64, ptr %10, align 8, !tbaa !9
  %122 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i64 noundef %121)
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  br label %123

123:                                              ; preds = %120, %86
  store i32 0, ptr %9, align 4
  br label %124

124:                                              ; preds = %123, %93, %52
  call void @llvm.lifetime.end.p0(i64 16, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 2, ptr %2) #6
  %125 = load i32, ptr %9, align 4
  switch i32 %125, label %129 [
    i32 0, label %126
    i32 4, label %19
  ]

126:                                              ; preds = %124
  br label %19, !llvm.loop !14

127:                                              ; preds = %19
  br label %12, !llvm.loop !17

128:                                              ; preds = %12
  ret i32 0

129:                                              ; preds = %124
  unreachable
}

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

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

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 = { 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 #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 = { 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 #5 = { "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 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = !{!13, !6, i64 0}
!13 = !{!"_ZTSSt4pairIixE", !6, i64 0, !10, i64 8}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = !{!13, !10, i64 8}
!17 = distinct !{!17, !15}


; 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, i64 }

@t = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z4initii(i32 noundef, i32 noundef) local_unnamed_addr #0

; 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: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local { i32, i64 } @_Z4findiixb(i32 noundef, i32 noundef, i64 noundef, i1 noundef zeroext) local_unnamed_addr #0

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5cha_xiiix(i32 noundef, i32 noundef, i32 noundef, i64 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5cha_siiii(i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_Z3queiiii(i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_Z3updRxx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #4 {
  %1 = alloca [2 x i8], align 1
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca %"struct.std::pair", align 8
  %5 = alloca %"struct.std::pair", align 8
  %6 = alloca %"struct.std::pair", align 8
  %7 = alloca %"struct.std::pair", align 8
  %8 = alloca i64, align 8
  %9 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @t)
  %10 = load i32, ptr @t, align 4, !tbaa !5
  %11 = add nsw i32 %10, -1
  store i32 %11, ptr @t, align 4, !tbaa !5
  %.not10 = icmp eq i32 %10, 0
  br i1 %.not10, label %._crit_edge, label %.lr.ph11

.lr.ph11:                                         ; preds = %0
  %12 = getelementptr inbounds i8, ptr %6, i64 8
  %13 = getelementptr inbounds i8, ptr %7, i64 8
  %14 = getelementptr inbounds i8, ptr %4, i64 8
  %15 = getelementptr inbounds i8, ptr %5, i64 8
  br label %18

.loopexit:                                        ; preds = %79, %18
  %16 = load i32, ptr @t, align 4, !tbaa !5
  %17 = add nsw i32 %16, -1
  store i32 %17, ptr @t, align 4, !tbaa !5
  %.not = icmp eq i32 %16, 0
  br i1 %.not, label %._crit_edge, label %18, !llvm.loop !9

18:                                               ; preds = %.lr.ph11, %.loopexit
  %19 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @n, ptr noundef nonnull @m)
  %20 = load i32, ptr @n, align 4, !tbaa !5
  call void @_Z4initii(i32 noundef 1, i32 noundef %20)
  %21 = load i32, ptr @m, align 4, !tbaa !5
  %22 = add nsw i32 %21, -1
  store i32 %22, ptr @m, align 4, !tbaa !5
  %.not59 = icmp eq i32 %21, 0
  br i1 %.not59, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %18, %79
  call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #6
  call void @_ZNSt4pairIixEC2IixTnNSt9enable_ifIXsr6__and_ISt37__is_implicitly_default_constructibleIT_ES3_IT0_EEE5valueEbE4typeELb1EEEv(ptr noundef nonnull align 8 dereferenceable(16) %4)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #6
  call void @_ZNSt4pairIixEC2IixTnNSt9enable_ifIXsr6__and_ISt37__is_implicitly_default_constructibleIT_ES3_IT0_EEE5valueEbE4typeELb1EEEv(ptr noundef nonnull align 8 dereferenceable(16) %5)
  %23 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %1, ptr noundef nonnull %2, ptr noundef nonnull %3)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #6
  %24 = load i32, ptr @n, align 4, !tbaa !5
  %25 = load i64, ptr %2, align 8, !tbaa !11
  %26 = call { i32, i64 } @_Z4findiixb(i32 noundef 1, i32 noundef %24, i64 noundef %25, i1 noundef zeroext false)
  %27 = extractvalue { i32, i64 } %26, 0
  store i32 %27, ptr %6, align 8
  %28 = extractvalue { i32, i64 } %26, 1
  store i64 %28, ptr %12, align 8
  %29 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt4pairIixEaSEOS0_(ptr noundef nonnull align 8 dereferenceable(16) %4, ptr noundef nonnull align 8 dereferenceable(16) %6) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #6
  %30 = load i32, ptr @n, align 4, !tbaa !5
  %31 = load i64, ptr %3, align 8, !tbaa !11
  %32 = call { i32, i64 } @_Z4findiixb(i32 noundef 1, i32 noundef %30, i64 noundef %31, i1 noundef zeroext true)
  %33 = extractvalue { i32, i64 } %32, 0
  store i32 %33, ptr %7, align 8
  %34 = extractvalue { i32, i64 } %32, 1
  store i64 %34, ptr %13, align 8
  %35 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt4pairIixEaSEOS0_(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 8 dereferenceable(16) %7) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #6
  %36 = load i8, ptr %1, align 1, !tbaa !13
  %37 = icmp eq i8 %36, 68
  %38 = load i32, ptr %4, align 8, !tbaa !14
  %39 = load i32, ptr %5, align 8, !tbaa !14
  %40 = icmp eq i32 %38, %39
  br i1 %37, label %41, label %59

41:                                               ; preds = %.lr.ph
  %42 = load i32, ptr @n, align 4, !tbaa !5
  br i1 %40, label %43, label %48

43:                                               ; preds = %41
  %44 = load i64, ptr %3, align 8, !tbaa !11
  %45 = load i64, ptr %2, align 8, !tbaa !11
  %46 = add i64 %44, 1
  %47 = sub i64 %46, %45
  call void @_Z5cha_xiiix(i32 noundef 1, i32 noundef %42, i32 noundef %38, i64 noundef %47)
  br label %79, !llvm.loop !16

48:                                               ; preds = %41
  %49 = load i64, ptr %14, align 8, !tbaa !17
  call void @_Z5cha_xiiix(i32 noundef 1, i32 noundef %42, i32 noundef %38, i64 noundef %49)
  %50 = load i32, ptr @n, align 4, !tbaa !5
  %51 = load i32, ptr %5, align 8, !tbaa !14
  %52 = load i64, ptr %15, align 8, !tbaa !17
  call void @_Z5cha_xiiix(i32 noundef 1, i32 noundef %50, i32 noundef %51, i64 noundef %52)
  %53 = load i32, ptr %4, align 8, !tbaa !14
  %54 = load i32, ptr %5, align 8, !tbaa !14
  %55 = add nsw i32 %54, -1
  %.not7.not = icmp slt i32 %53, %55
  br i1 %.not7.not, label %56, label %79

56:                                               ; preds = %48
  %57 = add nsw i32 %53, 1
  %58 = load i32, ptr @n, align 4, !tbaa !5
  call void @_Z5cha_siiii(i32 noundef 1, i32 noundef %58, i32 noundef %57, i32 noundef %55)
  br label %79

59:                                               ; preds = %.lr.ph
  br i1 %40, label %60, label %66

60:                                               ; preds = %59
  %61 = load i64, ptr %3, align 8, !tbaa !11
  %62 = load i64, ptr %2, align 8, !tbaa !11
  %63 = add i64 %61, 1
  %64 = sub i64 %63, %62
  %65 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %64)
  br label %79, !llvm.loop !16

66:                                               ; preds = %59
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #6
  %67 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(8) %15)
  %68 = load i64, ptr %67, align 8, !tbaa !11
  store i64 %68, ptr %8, align 8, !tbaa !11
  %69 = load i32, ptr %4, align 8, !tbaa !14
  %70 = load i32, ptr %5, align 8, !tbaa !14
  %71 = add nsw i32 %70, -1
  %.not6.not = icmp slt i32 %69, %71
  br i1 %.not6.not, label %72, label %76

72:                                               ; preds = %66
  %73 = add nsw i32 %69, 1
  %74 = load i32, ptr @n, align 4, !tbaa !5
  %75 = call noundef i64 @_Z3queiiii(i32 noundef 1, i32 noundef %74, i32 noundef %73, i32 noundef %71)
  call void @_Z3updRxx(ptr noundef nonnull align 8 dereferenceable(8) %8, i64 noundef %75)
  %.pre = load i64, ptr %8, align 8, !tbaa !11
  br label %76

76:                                               ; preds = %72, %66
  %77 = phi i64 [ %.pre, %72 ], [ %68, %66 ]
  %78 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %77)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  br label %79

79:                                               ; preds = %76, %56, %48, %60, %43
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %1) #6
  %80 = load i32, ptr @m, align 4, !tbaa !5
  %81 = add nsw i32 %80, -1
  store i32 %81, ptr @m, align 4, !tbaa !5
  %.not5 = icmp eq i32 %80, 0
  br i1 %.not5, label %.loopexit, label %.lr.ph

._crit_edge:                                      ; preds = %.loopexit, %0
  ret i32 0
}

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

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

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 = { 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 #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 = { 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 #5 = { 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 #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 = !{!"long long", !7, i64 0}
!13 = !{!7, !7, i64 0}
!14 = !{!15, !6, i64 0}
!15 = !{!"_ZTSSt4pairIixE", !6, i64 0, !12, i64 8}
!16 = distinct !{!16, !10}
!17 = !{!15, !12, i64 8}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass