; LLVM IR from kazunetakahashi/atcoder :: 201510_201609/0621_ARC047 (B)

; 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 { i64, i64 }
%"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 }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@N = external dso_local global i32, align 4
@X = external dso_local global [100010 x i64], align 16
@Y = external dso_local global [100010 x i64], align 16
@p = external dso_local global [100010 x %"struct.std::pair"], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z2okxx(i64 noundef, i64 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: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #2 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca %"struct.std::pair", align 8
  %6 = alloca i8, align 1
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i32, align 4
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  %15 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @N)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %16

16:                                               ; preds = %40, %0
  %17 = load i32, ptr %2, align 4, !tbaa !5
  %18 = load i32, ptr @N, align 4, !tbaa !5
  %19 = icmp slt i32 %17, %18
  br i1 %19, label %21, label %20

20:                                               ; preds = %16
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  br label %43

21:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  %22 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %23 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %22, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %24 = load i64, ptr %3, align 8, !tbaa !9
  %25 = load i64, ptr %4, align 8, !tbaa !9
  %26 = add nsw i64 %24, %25
  %27 = load i32, ptr %2, align 4, !tbaa !5
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds [100010 x i64], ptr @X, i64 0, i64 %28
  store i64 %26, ptr %29, align 8, !tbaa !9
  %30 = load i64, ptr %3, align 8, !tbaa !9
  %31 = load i64, ptr %4, align 8, !tbaa !9
  %32 = sub nsw i64 %30, %31
  %33 = load i32, ptr %2, align 4, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [100010 x i64], ptr @Y, i64 0, i64 %34
  store i64 %32, ptr %35, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr %5) #6
  call void @_ZNSt4pairIxxEC2IRxS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %36 = load i32, ptr %2, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [100010 x %"struct.std::pair"], ptr @p, i64 0, i64 %37
  %39 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt4pairIxxEaSEOS0_(ptr noundef nonnull align 8 dereferenceable(16) %38, ptr noundef nonnull align 8 dereferenceable(16) %5) #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
  br label %40

40:                                               ; preds = %21
  %41 = load i32, ptr %2, align 4, !tbaa !5
  %42 = add nsw i32 %41, 1
  store i32 %42, ptr %2, align 4, !tbaa !5
  br label %16, !llvm.loop !11

43:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 1, ptr %6) #6
  store i8 1, ptr %6, align 1, !tbaa !13
  %44 = load i32, ptr @N, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds i64, ptr @X, i64 %45
  call void @_ZSt4sortIPxEvT_S1_(ptr noundef @X, ptr noundef %46)
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %47 = load i32, ptr @N, align 4, !tbaa !5
  %48 = sub nsw i32 %47, 1
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [100010 x i64], ptr @X, i64 0, i64 %49
  %51 = load i64, ptr %50, align 8, !tbaa !9
  %52 = load i64, ptr @X, align 16, !tbaa !9
  %53 = sub nsw i64 %51, %52
  store i64 %53, ptr %7, align 8, !tbaa !9
  %54 = load i32, ptr @N, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds i64, ptr @Y, i64 %55
  call void @_ZSt4sortIPxEvT_S1_(ptr noundef @Y, ptr noundef %56)
  %57 = load i64, ptr %7, align 8, !tbaa !9
  %58 = load i32, ptr @N, align 4, !tbaa !5
  %59 = sub nsw i32 %58, 1
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [100010 x i64], ptr @Y, i64 0, i64 %60
  %62 = load i64, ptr %61, align 8, !tbaa !9
  %63 = load i64, ptr @Y, align 16, !tbaa !9
  %64 = sub nsw i64 %62, %63
  %65 = icmp slt i64 %57, %64
  br i1 %65, label %66, label %74

66:                                               ; preds = %43
  %67 = load i32, ptr @N, align 4, !tbaa !5
  %68 = sub nsw i32 %67, 1
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [100010 x i64], ptr @Y, i64 0, i64 %69
  %71 = load i64, ptr %70, align 8, !tbaa !9
  %72 = load i64, ptr @Y, align 16, !tbaa !9
  %73 = sub nsw i64 %71, %72
  store i64 %73, ptr %7, align 8, !tbaa !9
  store i8 0, ptr %6, align 1, !tbaa !13
  br label %74

74:                                               ; preds = %66, %43
  %75 = load i64, ptr %7, align 8, !tbaa !9
  %76 = srem i64 %75, 2
  %77 = icmp eq i64 %76, 0
  br i1 %77, label %78, label %81

78:                                               ; preds = %74
  %79 = load i64, ptr %7, align 8, !tbaa !9
  %80 = add nsw i64 %79, 1
  store i64 %80, ptr %7, align 8, !tbaa !9
  br label %81

81:                                               ; preds = %78, %74
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  store i64 0, ptr %8, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  store i64 0, ptr %9, align 8, !tbaa !9
  %82 = load i8, ptr %6, align 1, !tbaa !13, !range !15, !noundef !16
  %83 = trunc i8 %82 to i1
  br i1 %83, label %84, label %116

84:                                               ; preds = %81
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %85 = load i64, ptr @X, align 16, !tbaa !9
  %86 = load i64, ptr %7, align 8, !tbaa !9
  %87 = sdiv i64 %86, 2
  %88 = add nsw i64 %85, %87
  store i64 %88, ptr %10, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %89 = load i64, ptr @Y, align 16, !tbaa !9
  %90 = load i64, ptr %7, align 8, !tbaa !9
  %91 = sub nsw i64 %89, %90
  store i64 %91, ptr %11, align 8, !tbaa !9
  br label %92

92:                                               ; preds = %111, %84
  %93 = load i64, ptr %11, align 8, !tbaa !9
  %94 = load i32, ptr @N, align 4, !tbaa !5
  %95 = sub nsw i32 %94, 1
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [100010 x i64], ptr @Y, i64 0, i64 %96
  %98 = load i64, ptr %97, align 8, !tbaa !9
  %99 = load i64, ptr %7, align 8, !tbaa !9
  %100 = add nsw i64 %98, %99
  %101 = icmp sle i64 %93, %100
  br i1 %101, label %103, label %102

102:                                              ; preds = %92
  store i32 5, ptr %12, align 4
  br label %114

103:                                              ; preds = %92
  %104 = load i64, ptr %10, align 8, !tbaa !9
  %105 = load i64, ptr %11, align 8, !tbaa !9
  %106 = call noundef zeroext i1 @_Z2okxx(i64 noundef %104, i64 noundef %105)
  br i1 %106, label %107, label %110

107:                                              ; preds = %103
  %108 = load i64, ptr %10, align 8, !tbaa !9
  store i64 %108, ptr %8, align 8, !tbaa !9
  %109 = load i64, ptr %11, align 8, !tbaa !9
  store i64 %109, ptr %9, align 8, !tbaa !9
  store i32 5, ptr %12, align 4
  br label %114

110:                                              ; preds = %103
  br label %111

111:                                              ; preds = %110
  %112 = load i64, ptr %11, align 8, !tbaa !9
  %113 = add nsw i64 %112, 1
  store i64 %113, ptr %11, align 8, !tbaa !9
  br label %92, !llvm.loop !17

114:                                              ; preds = %107, %102
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  br label %115

115:                                              ; preds = %114
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  br label %148

116:                                              ; preds = %81
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %117 = load i64, ptr @Y, align 16, !tbaa !9
  %118 = load i64, ptr %7, align 8, !tbaa !9
  %119 = sdiv i64 %118, 2
  %120 = add nsw i64 %117, %119
  store i64 %120, ptr %13, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %121 = load i64, ptr @X, align 16, !tbaa !9
  %122 = load i64, ptr %7, align 8, !tbaa !9
  %123 = sub nsw i64 %121, %122
  store i64 %123, ptr %14, align 8, !tbaa !9
  br label %124

124:                                              ; preds = %143, %116
  %125 = load i64, ptr %14, align 8, !tbaa !9
  %126 = load i32, ptr @N, align 4, !tbaa !5
  %127 = sub nsw i32 %126, 1
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds [100010 x i64], ptr @X, i64 0, i64 %128
  %130 = load i64, ptr %129, align 8, !tbaa !9
  %131 = load i64, ptr %7, align 8, !tbaa !9
  %132 = add nsw i64 %130, %131
  %133 = icmp sle i64 %125, %132
  br i1 %133, label %135, label %134

134:                                              ; preds = %124
  store i32 8, ptr %12, align 4
  br label %146

135:                                              ; preds = %124
  %136 = load i64, ptr %14, align 8, !tbaa !9
  %137 = load i64, ptr %13, align 8, !tbaa !9
  %138 = call noundef zeroext i1 @_Z2okxx(i64 noundef %136, i64 noundef %137)
  br i1 %138, label %139, label %142

139:                                              ; preds = %135
  %140 = load i64, ptr %14, align 8, !tbaa !9
  store i64 %140, ptr %8, align 8, !tbaa !9
  %141 = load i64, ptr %13, align 8, !tbaa !9
  store i64 %141, ptr %9, align 8, !tbaa !9
  store i32 8, ptr %12, align 4
  br label %146

142:                                              ; preds = %135
  br label %143

143:                                              ; preds = %142
  %144 = load i64, ptr %14, align 8, !tbaa !9
  %145 = add nsw i64 %144, 1
  store i64 %145, ptr %14, align 8, !tbaa !9
  br label %124, !llvm.loop !18

146:                                              ; preds = %139, %134
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  br label %147

147:                                              ; preds = %146
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  br label %148

148:                                              ; preds = %147, %115
  %149 = load i64, ptr %8, align 8, !tbaa !9
  %150 = load i64, ptr %9, align 8, !tbaa !9
  %151 = add nsw i64 %149, %150
  %152 = sdiv i64 %151, 2
  %153 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %152)
  %154 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %153, ptr noundef @.str)
  %155 = load i64, ptr %8, align 8, !tbaa !9
  %156 = load i64, ptr %9, align 8, !tbaa !9
  %157 = sub nsw i64 %155, %156
  %158 = sdiv i64 %157, 2
  %159 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %154, i64 noundef %158)
  %160 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %159, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #6
  %161 = load i32, ptr %1, align 4
  ret i32 %161
}

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) #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 #4 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPxEvT_S1_(ptr noundef, ptr noundef) #5

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #5

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #0 align 2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #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 = { 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 #3 = { "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 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 = { inlinehint 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 #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 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !14, i64 0}
!14 = !{!"bool", !7, i64 0}
!15 = !{i8 0, i8 2}
!16 = !{}
!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"

%"struct.std::pair" = type { i64, i64 }
%"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 }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@N = external dso_local global i32, align 4
@X = external dso_local global [100010 x i64], align 16
@Y = external dso_local global [100010 x i64], align 16
@p = external dso_local global [100010 x %"struct.std::pair"], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z2okxx(i64 noundef, i64 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: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 {
  %1 = alloca i64, align 8
  %2 = alloca i64, align 8
  %3 = alloca %"struct.std::pair", align 8
  %4 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @N)
  %5 = load i32, ptr @N, align 4, !tbaa !5
  %6 = icmp sgt i32 %5, 0
  br i1 %6, label %.lr.ph, label %.._crit_edge_crit_edge

.._crit_edge_crit_edge:                           ; preds = %0
  %.pre = sext i32 %5 to i64
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.._crit_edge_crit_edge
  %.pre-phi = phi i64 [ %.pre, %.._crit_edge_crit_edge ], [ %35, %.lr.ph ]
  %7 = getelementptr inbounds i64, ptr @X, i64 %.pre-phi
  call void @_ZSt4sortIPxEvT_S1_(ptr noundef nonnull @X, ptr noundef nonnull %7)
  %8 = load i32, ptr @N, align 4, !tbaa !5
  %9 = add nsw i32 %8, -1
  %10 = sext i32 %9 to i64
  %11 = getelementptr inbounds [100010 x i64], ptr @X, i64 0, i64 %10
  %12 = load i64, ptr %11, align 8, !tbaa !9
  %13 = load i64, ptr @X, align 16, !tbaa !9
  %14 = sub nsw i64 %12, %13
  %15 = sext i32 %8 to i64
  %16 = getelementptr inbounds i64, ptr @Y, i64 %15
  call void @_ZSt4sortIPxEvT_S1_(ptr noundef nonnull @Y, ptr noundef nonnull %16)
  %17 = load i32, ptr @N, align 4, !tbaa !5
  %18 = add nsw i32 %17, -1
  %19 = sext i32 %18 to i64
  %20 = getelementptr inbounds [100010 x i64], ptr @Y, i64 0, i64 %19
  %21 = load i64, ptr %20, align 8, !tbaa !9
  %22 = load i64, ptr @Y, align 16, !tbaa !9
  %23 = sub nsw i64 %21, %22
  %.not = icmp slt i64 %14, %23
  %spec.select = call i64 @llvm.smax.i64(i64 %14, i64 %23)
  %.140 = or i64 %spec.select, 1
  br i1 %.not, label %52, label %37

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #7
  %24 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %1)
  %25 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %24, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %26 = load i64, ptr %1, align 8, !tbaa !9
  %27 = load i64, ptr %2, align 8, !tbaa !9
  %28 = add nsw i64 %27, %26
  %29 = getelementptr inbounds [100010 x i64], ptr @X, i64 0, i64 %indvars.iv
  store i64 %28, ptr %29, align 8, !tbaa !9
  %30 = sub nsw i64 %26, %27
  %31 = getelementptr inbounds [100010 x i64], ptr @Y, i64 0, i64 %indvars.iv
  store i64 %30, ptr %31, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #7
  call void @_ZNSt4pairIxxEC2IRxS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %32 = getelementptr inbounds [100010 x %"struct.std::pair"], ptr @p, i64 0, i64 %indvars.iv
  %33 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt4pairIxxEaSEOS0_(ptr noundef nonnull align 8 dereferenceable(16) %32, ptr noundef nonnull align 8 dereferenceable(16) %3) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #7
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %34 = load i32, ptr @N, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = icmp slt i64 %indvars.iv.next, %35
  br i1 %36, label %.lr.ph, label %._crit_edge, !llvm.loop !11

37:                                               ; preds = %._crit_edge
  %38 = load i64, ptr @X, align 16, !tbaa !9
  %39 = sdiv i64 %.140, 2
  %40 = add nsw i64 %38, %39
  %41 = sub nsw i64 %22, %.140
  %42 = add nsw i64 %21, %.140
  %.not4550 = icmp sgt i64 %41, %42
  br i1 %.not4550, label %.loopexit, label %.lr.ph53

.lr.ph53:                                         ; preds = %37, %44
  %.03351 = phi i64 [ %45, %44 ], [ %41, %37 ]
  %43 = call noundef zeroext i1 @_Z2okxx(i64 noundef %40, i64 noundef %.03351)
  br i1 %43, label %.loopexit, label %44

44:                                               ; preds = %.lr.ph53
  %45 = add nsw i64 %.03351, 1
  %46 = load i32, ptr @N, align 4, !tbaa !5
  %47 = add nsw i32 %46, -1
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [100010 x i64], ptr @Y, i64 0, i64 %48
  %50 = load i64, ptr %49, align 8, !tbaa !9
  %51 = add nsw i64 %50, %.140
  %.not45.not = icmp slt i64 %.03351, %51
  br i1 %.not45.not, label %.lr.ph53, label %.loopexit, !llvm.loop !13

52:                                               ; preds = %._crit_edge
  %53 = sdiv i64 %.140, 2
  %54 = add nsw i64 %53, %22
  %55 = load i64, ptr @X, align 16, !tbaa !9
  %56 = sub nsw i64 %55, %.140
  %57 = getelementptr inbounds [100010 x i64], ptr @X, i64 0, i64 %19
  %58 = load i64, ptr %57, align 8, !tbaa !9
  %59 = add nsw i64 %58, %.140
  %.not4459 = icmp sgt i64 %56, %59
  br i1 %.not4459, label %.loopexit, label %.lr.ph62

.lr.ph62:                                         ; preds = %52, %61
  %.060 = phi i64 [ %62, %61 ], [ %56, %52 ]
  %60 = call noundef zeroext i1 @_Z2okxx(i64 noundef %.060, i64 noundef %54)
  br i1 %60, label %.loopexit, label %61

61:                                               ; preds = %.lr.ph62
  %62 = add nsw i64 %.060, 1
  %63 = load i32, ptr @N, align 4, !tbaa !5
  %64 = add nsw i32 %63, -1
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [100010 x i64], ptr @X, i64 0, i64 %65
  %67 = load i64, ptr %66, align 8, !tbaa !9
  %68 = add nsw i64 %67, %.140
  %.not44.not = icmp slt i64 %.060, %68
  br i1 %.not44.not, label %.lr.ph62, label %.loopexit, !llvm.loop !14

.loopexit:                                        ; preds = %.lr.ph53, %44, %.lr.ph62, %61, %37, %52
  %.238 = phi i64 [ 0, %52 ], [ 0, %37 ], [ %.060, %.lr.ph62 ], [ 0, %61 ], [ %40, %.lr.ph53 ], [ 0, %44 ]
  %.2 = phi i64 [ 0, %52 ], [ 0, %37 ], [ %54, %.lr.ph62 ], [ 0, %61 ], [ %.03351, %.lr.ph53 ], [ 0, %44 ]
  %69 = add nsw i64 %.2, %.238
  %70 = sdiv i64 %69, 2
  %71 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %70)
  %72 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %71, ptr noundef nonnull @.str)
  %73 = sub nsw i64 %.238, %.2
  %74 = sdiv i64 %73, 2
  %75 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %72, i64 noundef %74)
  %76 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %75, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  ret i32 0
}

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 #3

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) 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 #4 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPxEvT_S1_(ptr noundef, ptr noundef) local_unnamed_addr #5

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #5

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) local_unnamed_addr #0 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #5

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #6

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 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 #3 = { "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 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 = { inlinehint 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 #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}


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