; LLVM IR from ravireddy07/cpp-book :: src/Google-competitions/KickStart (2020-H-Rugby)

; 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 i64, align 8
@mxX = external dso_local global i64, align 8
@mnX = external dso_local global i64, align 8
@mxY = external dso_local global i64, align 8
@mnY = external dso_local global i64, align 8
@x = external dso_local global [100005 x i64], align 16
@y = external dso_local global [100005 x i64], align 16
@a = external dso_local global [100005 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 [7 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_Z8ternaryYxx(i64 noundef, i64 noundef) #2

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #3 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #5
  %7 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %2)
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #5
  store i64 0, ptr %3, align 8, !tbaa !5
  br label %8

8:                                                ; preds = %96, %0
  %9 = load i64, ptr %2, align 8, !tbaa !5
  %10 = add nsw i64 %9, -1
  store i64 %10, ptr %2, align 8, !tbaa !5
  %11 = icmp ne i64 %9, 0
  br i1 %11, label %12, label %107

12:                                               ; preds = %8
  %13 = load i64, ptr %3, align 8, !tbaa !5
  %14 = add nsw i64 %13, 1
  store i64 %14, ptr %3, align 8, !tbaa !5
  %15 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @n)
  store i64 -1000000000, ptr @mxX, align 8, !tbaa !5
  store i64 -1000000000, ptr @mxY, align 8, !tbaa !5
  store i64 1000000000, ptr @mnX, align 8, !tbaa !5
  store i64 1000000000, ptr @mnY, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #5
  store i64 1, ptr %4, align 8, !tbaa !5
  br label %16

16:                                               ; preds = %56, %12
  %17 = load i64, ptr %4, align 8, !tbaa !5
  %18 = load i64, ptr @n, align 8, !tbaa !5
  %19 = icmp sle i64 %17, %18
  br i1 %19, label %21, label %20

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

21:                                               ; preds = %16
  %22 = load i64, ptr %4, align 8, !tbaa !5
  %23 = getelementptr inbounds [100005 x i64], ptr @x, i64 0, i64 %22
  %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) %23)
  %25 = load i64, ptr %4, align 8, !tbaa !5
  %26 = getelementptr inbounds [100005 x i64], ptr @y, i64 0, i64 %25
  %27 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %24, ptr noundef nonnull align 8 dereferenceable(8) %26)
  %28 = load i64, ptr %4, align 8, !tbaa !5
  %29 = getelementptr inbounds [100005 x i64], ptr @x, i64 0, i64 %28
  %30 = load i64, ptr %29, align 8, !tbaa !5
  %31 = load i64, ptr %4, align 8, !tbaa !5
  %32 = getelementptr inbounds [100005 x %"struct.std::pair"], ptr @a, i64 0, i64 %31
  %33 = getelementptr inbounds %"struct.std::pair", ptr %32, i32 0, i32 0
  store i64 %30, ptr %33, align 16, !tbaa !9
  %34 = load i64, ptr %4, align 8, !tbaa !5
  %35 = getelementptr inbounds [100005 x i64], ptr @y, i64 0, i64 %34
  %36 = load i64, ptr %35, align 8, !tbaa !5
  %37 = load i64, ptr %4, align 8, !tbaa !5
  %38 = getelementptr inbounds [100005 x %"struct.std::pair"], ptr @a, i64 0, i64 %37
  %39 = getelementptr inbounds %"struct.std::pair", ptr %38, i32 0, i32 1
  store i64 %36, ptr %39, align 8, !tbaa !11
  %40 = load i64, ptr %4, align 8, !tbaa !5
  %41 = getelementptr inbounds [100005 x i64], ptr @x, i64 0, i64 %40
  %42 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) @mnX, ptr noundef nonnull align 8 dereferenceable(8) %41)
  %43 = load i64, ptr %42, align 8, !tbaa !5
  store i64 %43, ptr @mnX, align 8, !tbaa !5
  %44 = load i64, ptr %4, align 8, !tbaa !5
  %45 = getelementptr inbounds [100005 x i64], ptr @x, i64 0, i64 %44
  %46 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) @mxX, ptr noundef nonnull align 8 dereferenceable(8) %45)
  %47 = load i64, ptr %46, align 8, !tbaa !5
  store i64 %47, ptr @mxX, align 8, !tbaa !5
  %48 = load i64, ptr %4, align 8, !tbaa !5
  %49 = getelementptr inbounds [100005 x i64], ptr @y, i64 0, i64 %48
  %50 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) @mnY, ptr noundef nonnull align 8 dereferenceable(8) %49)
  %51 = load i64, ptr %50, align 8, !tbaa !5
  store i64 %51, ptr @mnY, align 8, !tbaa !5
  %52 = load i64, ptr %4, align 8, !tbaa !5
  %53 = getelementptr inbounds [100005 x i64], ptr @y, i64 0, i64 %52
  %54 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) @mxY, ptr noundef nonnull align 8 dereferenceable(8) %53)
  %55 = load i64, ptr %54, align 8, !tbaa !5
  store i64 %55, ptr @mxY, align 8, !tbaa !5
  br label %56

56:                                               ; preds = %21
  %57 = load i64, ptr %4, align 8, !tbaa !5
  %58 = add nsw i64 %57, 1
  store i64 %58, ptr %4, align 8, !tbaa !5
  br label %16, !llvm.loop !12

59:                                               ; preds = %20
  %60 = load i64, ptr @n, align 8, !tbaa !5
  %61 = load i64, ptr @mnY, align 8, !tbaa !5
  %62 = sub nsw i64 %61, %60
  store i64 %62, ptr @mnY, align 8, !tbaa !5
  %63 = load i64, ptr @n, align 8, !tbaa !5
  %64 = load i64, ptr @mxY, align 8, !tbaa !5
  %65 = add nsw i64 %64, %63
  store i64 %65, ptr @mxY, align 8, !tbaa !5
  %66 = load i64, ptr @n, align 8, !tbaa !5
  %67 = load i64, ptr @mnX, align 8, !tbaa !5
  %68 = sub nsw i64 %67, %66
  store i64 %68, ptr @mnX, align 8, !tbaa !5
  %69 = load i64, ptr @n, align 8, !tbaa !5
  %70 = load i64, ptr @mxX, align 8, !tbaa !5
  %71 = add nsw i64 %70, %69
  store i64 %71, ptr @mxX, align 8, !tbaa !5
  %72 = load i64, ptr @n, align 8, !tbaa !5
  %73 = getelementptr inbounds %"struct.std::pair", ptr @a, i64 %72
  %74 = getelementptr inbounds %"struct.std::pair", ptr %73, i64 1
  call void @_ZSt4sortIPSt4pairIxxEEvT_S3_(ptr noundef getelementptr inbounds (%"struct.std::pair", ptr @a, i64 1), ptr noundef %74)
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  store i64 1, ptr %5, align 8, !tbaa !5
  br label %75

75:                                               ; preds = %93, %59
  %76 = load i64, ptr %5, align 8, !tbaa !5
  %77 = load i64, ptr @n, align 8, !tbaa !5
  %78 = icmp sle i64 %76, %77
  br i1 %78, label %80, label %79

79:                                               ; preds = %75
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  br label %96

80:                                               ; preds = %75
  %81 = load i64, ptr %5, align 8, !tbaa !5
  %82 = getelementptr inbounds [100005 x %"struct.std::pair"], ptr @a, i64 0, i64 %81
  %83 = getelementptr inbounds %"struct.std::pair", ptr %82, i32 0, i32 0
  %84 = load i64, ptr %83, align 16, !tbaa !9
  %85 = load i64, ptr %5, align 8, !tbaa !5
  %86 = getelementptr inbounds [100005 x i64], ptr @x, i64 0, i64 %85
  store i64 %84, ptr %86, align 8, !tbaa !5
  %87 = load i64, ptr %5, align 8, !tbaa !5
  %88 = getelementptr inbounds [100005 x %"struct.std::pair"], ptr @a, i64 0, i64 %87
  %89 = getelementptr inbounds %"struct.std::pair", ptr %88, i32 0, i32 1
  %90 = load i64, ptr %89, align 8, !tbaa !11
  %91 = load i64, ptr %5, align 8, !tbaa !5
  %92 = getelementptr inbounds [100005 x i64], ptr @y, i64 0, i64 %91
  store i64 %90, ptr %92, align 8, !tbaa !5
  br label %93

93:                                               ; preds = %80
  %94 = load i64, ptr %5, align 8, !tbaa !5
  %95 = add nsw i64 %94, 1
  store i64 %95, ptr %5, align 8, !tbaa !5
  br label %75, !llvm.loop !14

96:                                               ; preds = %79
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %97 = load i64, ptr @mnY, align 8, !tbaa !5
  %98 = load i64, ptr @mxY, align 8, !tbaa !5
  %99 = call noundef i64 @_Z8ternaryYxx(i64 noundef %97, i64 noundef %98)
  store i64 %99, ptr %6, align 8, !tbaa !5
  %100 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
  %101 = load i64, ptr %3, align 8, !tbaa !5
  %102 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %100, i64 noundef %101)
  %103 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %102, ptr noundef @.str.1)
  %104 = load i64, ptr %6, align 8, !tbaa !5
  %105 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %103, i64 noundef %104)
  %106 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %105, ptr noundef @.str.2)
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  br label %8, !llvm.loop !15

107:                                              ; preds = %8
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #5
  ret i32 0
}

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

; 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)) #1

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

; 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) #4

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #3 = { 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 #4 = { 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 #5 = { nounwind }

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

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


; 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 i64, align 8
@mxX = external dso_local global i64, align 8
@mnX = external dso_local global i64, align 8
@mxY = external dso_local global i64, align 8
@mnY = external dso_local global i64, align 8
@x = external dso_local global [100005 x i64], align 16
@y = external dso_local global [100005 x i64], align 16
@a = external dso_local global [100005 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 [7 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_Z8ternaryYxx(i64 noundef, i64 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #3 {
  %1 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #5
  %2 = 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)
  %3 = load i64, ptr %1, align 8, !tbaa !5
  %4 = add nsw i64 %3, -1
  store i64 %4, ptr %1, align 8, !tbaa !5
  %.not33 = icmp eq i64 %3, 0
  br i1 %.not33, label %._crit_edge37, label %.lr.ph36

.lr.ph36:                                         ; preds = %0, %._crit_edge32
  %.034 = phi i64 [ %5, %._crit_edge32 ], [ 0, %0 ]
  %5 = add nuw nsw i64 %.034, 1
  %6 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @n)
  store i64 -1000000000, ptr @mxX, align 8, !tbaa !5
  store i64 -1000000000, ptr @mxY, align 8, !tbaa !5
  store i64 1000000000, ptr @mnX, align 8, !tbaa !5
  store i64 1000000000, ptr @mnY, align 8, !tbaa !5
  %7 = load i64, ptr @n, align 8, !tbaa !5
  %.not2426 = icmp slt i64 %7, 1
  br i1 %.not2426, label %._crit_edge, label %.lr.ph

._crit_edge.loopexit:                             ; preds = %.lr.ph
  %.pre = load i64, ptr @mnY, align 8, !tbaa !5
  %.pre39 = load i64, ptr @mnX, align 8, !tbaa !5
  %.pre40 = load i64, ptr @mxX, align 8, !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.lr.ph36
  %8 = phi i64 [ -1000000000, %.lr.ph36 ], [ %.pre40, %._crit_edge.loopexit ]
  %9 = phi i64 [ 1000000000, %.lr.ph36 ], [ %.pre39, %._crit_edge.loopexit ]
  %10 = phi i64 [ -1000000000, %.lr.ph36 ], [ %40, %._crit_edge.loopexit ]
  %11 = phi i64 [ 1000000000, %.lr.ph36 ], [ %.pre, %._crit_edge.loopexit ]
  %.lcssa = phi i64 [ %7, %.lr.ph36 ], [ %42, %._crit_edge.loopexit ]
  %12 = sub nsw i64 %11, %.lcssa
  store i64 %12, ptr @mnY, align 8, !tbaa !5
  %13 = add nsw i64 %10, %.lcssa
  store i64 %13, ptr @mxY, align 8, !tbaa !5
  %14 = sub nsw i64 %9, %.lcssa
  store i64 %14, ptr @mnX, align 8, !tbaa !5
  %15 = add nsw i64 %8, %.lcssa
  store i64 %15, ptr @mxX, align 8, !tbaa !5
  %gep = getelementptr %"struct.std::pair", ptr getelementptr inbounds (i8, ptr @a, i64 16), i64 %.lcssa
  call void @_ZSt4sortIPSt4pairIxxEEvT_S3_(ptr noundef nonnull getelementptr inbounds (i8, ptr @a, i64 16), ptr noundef nonnull %gep)
  %16 = load i64, ptr @n, align 8, !tbaa !5
  %.not2528 = icmp slt i64 %16, 1
  br i1 %.not2528, label %._crit_edge32, label %.lr.ph31.preheader

.lr.ph31.preheader:                               ; preds = %._crit_edge
  %min.iters.check = icmp ult i64 %16, 4
  br i1 %min.iters.check, label %.lr.ph31.preheader49, label %vector.ph

.lr.ph31.preheader49:                             ; preds = %middle.block, %.lr.ph31.preheader
  %.02129.ph = phi i64 [ 1, %.lr.ph31.preheader ], [ %ind.end, %middle.block ]
  br label %.lr.ph31

vector.ph:                                        ; preds = %.lr.ph31.preheader
  %n.vec = and i64 %16, 9223372036854775804
  %ind.end = or disjoint i64 %n.vec, 1
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %offset.idx = or disjoint i64 %index, 1
  %17 = or disjoint i64 %index, 3
  %18 = getelementptr inbounds [100005 x %"struct.std::pair"], ptr @a, i64 0, i64 %offset.idx
  %19 = getelementptr inbounds [100005 x %"struct.std::pair"], ptr @a, i64 0, i64 %17
  %wide.vec = load <4 x i64>, ptr %18, align 16, !tbaa !5
  %wide.vec45 = load <4 x i64>, ptr %19, align 16, !tbaa !5
  %strided.vec = shufflevector <4 x i64> %wide.vec, <4 x i64> poison, <2 x i32> <i32 0, i32 2>
  %strided.vec46 = shufflevector <4 x i64> %wide.vec45, <4 x i64> poison, <2 x i32> <i32 0, i32 2>
  %strided.vec47 = shufflevector <4 x i64> %wide.vec, <4 x i64> poison, <2 x i32> <i32 1, i32 3>
  %strided.vec48 = shufflevector <4 x i64> %wide.vec45, <4 x i64> poison, <2 x i32> <i32 1, i32 3>
  %20 = getelementptr inbounds [100005 x i64], ptr @x, i64 0, i64 %offset.idx
  %21 = getelementptr inbounds i8, ptr %20, i64 16
  store <2 x i64> %strided.vec, ptr %20, align 8, !tbaa !5
  store <2 x i64> %strided.vec46, ptr %21, align 8, !tbaa !5
  %22 = getelementptr inbounds [100005 x i64], ptr @y, i64 0, i64 %offset.idx
  %23 = getelementptr inbounds i8, ptr %22, i64 16
  store <2 x i64> %strided.vec47, ptr %22, align 8, !tbaa !5
  store <2 x i64> %strided.vec48, ptr %23, align 8, !tbaa !5
  %index.next = add nuw i64 %index, 4
  %24 = icmp eq i64 %index.next, %n.vec
  br i1 %24, label %middle.block, label %vector.body, !llvm.loop !9

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %16, %n.vec
  br i1 %cmp.n, label %._crit_edge32, label %.lr.ph31.preheader49

.lr.ph:                                           ; preds = %.lr.ph36, %.lr.ph
  %.02227 = phi i64 [ %41, %.lr.ph ], [ 1, %.lr.ph36 ]
  %25 = getelementptr inbounds [100005 x i64], ptr @x, i64 0, i64 %.02227
  %26 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %25)
  %27 = getelementptr inbounds [100005 x i64], ptr @y, i64 0, i64 %.02227
  %28 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %26, ptr noundef nonnull align 8 dereferenceable(8) %27)
  %29 = load i64, ptr %25, align 8, !tbaa !5
  %30 = getelementptr inbounds [100005 x %"struct.std::pair"], ptr @a, i64 0, i64 %.02227
  store i64 %29, ptr %30, align 16, !tbaa !13
  %31 = load i64, ptr %27, align 8, !tbaa !5
  %32 = getelementptr inbounds i8, ptr %30, i64 8
  store i64 %31, ptr %32, align 8, !tbaa !15
  %33 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) @mnX, ptr noundef nonnull align 8 dereferenceable(8) %25)
  %34 = load i64, ptr %33, align 8, !tbaa !5
  store i64 %34, ptr @mnX, align 8, !tbaa !5
  %35 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) @mxX, ptr noundef nonnull align 8 dereferenceable(8) %25)
  %36 = load i64, ptr %35, align 8, !tbaa !5
  store i64 %36, ptr @mxX, align 8, !tbaa !5
  %37 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) @mnY, ptr noundef nonnull align 8 dereferenceable(8) %27)
  %38 = load i64, ptr %37, align 8, !tbaa !5
  store i64 %38, ptr @mnY, align 8, !tbaa !5
  %39 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) @mxY, ptr noundef nonnull align 8 dereferenceable(8) %27)
  %40 = load i64, ptr %39, align 8, !tbaa !5
  store i64 %40, ptr @mxY, align 8, !tbaa !5
  %41 = add nuw nsw i64 %.02227, 1
  %42 = load i64, ptr @n, align 8, !tbaa !5
  %.not24.not = icmp slt i64 %.02227, %42
  br i1 %.not24.not, label %.lr.ph, label %._crit_edge.loopexit, !llvm.loop !16

._crit_edge32:                                    ; preds = %.lr.ph31, %middle.block, %._crit_edge
  %43 = load i64, ptr @mnY, align 8, !tbaa !5
  %44 = load i64, ptr @mxY, align 8, !tbaa !5
  %45 = call noundef i64 @_Z8ternaryYxx(i64 noundef %43, i64 noundef %44)
  %46 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str)
  %47 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %46, i64 noundef %5)
  %48 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %47, ptr noundef nonnull @.str.1)
  %49 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %48, i64 noundef %45)
  %50 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %49, ptr noundef nonnull @.str.2)
  %51 = load i64, ptr %1, align 8, !tbaa !5
  %52 = add nsw i64 %51, -1
  store i64 %52, ptr %1, align 8, !tbaa !5
  %.not = icmp eq i64 %51, 0
  br i1 %.not, label %._crit_edge37, label %.lr.ph36, !llvm.loop !17

.lr.ph31:                                         ; preds = %.lr.ph31.preheader49, %.lr.ph31
  %.02129 = phi i64 [ %59, %.lr.ph31 ], [ %.02129.ph, %.lr.ph31.preheader49 ]
  %53 = getelementptr inbounds [100005 x %"struct.std::pair"], ptr @a, i64 0, i64 %.02129
  %54 = load i64, ptr %53, align 16, !tbaa !13
  %55 = getelementptr inbounds [100005 x i64], ptr @x, i64 0, i64 %.02129
  store i64 %54, ptr %55, align 8, !tbaa !5
  %56 = getelementptr inbounds i8, ptr %53, i64 8
  %57 = load i64, ptr %56, align 8, !tbaa !15
  %58 = getelementptr inbounds [100005 x i64], ptr @y, i64 0, i64 %.02129
  store i64 %57, ptr %58, align 8, !tbaa !5
  %59 = add nuw i64 %.02129, 1
  %exitcond.not = icmp eq i64 %.02129, %16
  br i1 %exitcond.not, label %._crit_edge32, label %.lr.ph31, !llvm.loop !18

._crit_edge37:                                    ; preds = %._crit_edge32, %0
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #5
  ret i32 0
}

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

; 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 #1

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

; 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 #4

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #3 = { 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 #4 = { 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 #5 = { nounwind }

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

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


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,SROAPass,SimplifyCFGPass