; LLVM IR from eyangch/competitive-programming :: Kattis (polygonarea)

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

@N = external dso_local global i32, align 4
@p = external dso_local global [1000 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 [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.2 = 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 double, align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca %"struct.std::_Setprecision", align 4
  store i32 0, ptr %1, align 4
  %7 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %8 = getelementptr i8, ptr %7, i64 -24
  %9 = load i64, ptr %8, align 8
  %10 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %9
  %11 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %10, ptr noundef null)
  %12 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  br label %13

13:                                               ; preds = %139, %0
  %14 = 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)
  %15 = load i32, ptr @N, align 4, !tbaa !8
  %16 = icmp eq i32 %15, 0
  br i1 %16, label %17, label %18

17:                                               ; preds = %13
  br label %140

18:                                               ; preds = %13
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #8
  store double 0.000000e+00, ptr %2, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #8
  store i32 0, ptr %3, align 4, !tbaa !8
  br label %19

19:                                               ; preds = %35, %18
  %20 = load i32, ptr %3, align 4, !tbaa !8
  %21 = load i32, ptr @N, align 4, !tbaa !8
  %22 = icmp slt i32 %20, %21
  br i1 %22, label %24, label %23

23:                                               ; preds = %19
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #8
  br label %38

24:                                               ; preds = %19
  %25 = load i32, ptr %3, align 4, !tbaa !8
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds [1000 x %"struct.std::pair"], ptr @p, i64 0, i64 %26
  %28 = getelementptr inbounds %"struct.std::pair", ptr %27, i32 0, i32 0
  %29 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %28)
  %30 = load i32, ptr %3, align 4, !tbaa !8
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [1000 x %"struct.std::pair"], ptr @p, i64 0, i64 %31
  %33 = getelementptr inbounds %"struct.std::pair", ptr %32, i32 0, i32 1
  %34 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %29, ptr noundef nonnull align 4 dereferenceable(4) %33)
  br label %35

35:                                               ; preds = %24
  %36 = load i32, ptr %3, align 4, !tbaa !8
  %37 = add nsw i32 %36, 1
  store i32 %37, ptr %3, align 4, !tbaa !8
  br label %19, !llvm.loop !13

38:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #8
  store i32 0, ptr %4, align 4, !tbaa !8
  br label %39

39:                                               ; preds = %61, %38
  %40 = load i32, ptr %4, align 4, !tbaa !8
  %41 = load i32, ptr @N, align 4, !tbaa !8
  %42 = sub nsw i32 %41, 1
  %43 = icmp slt i32 %40, %42
  br i1 %43, label %45, label %44

44:                                               ; preds = %39
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #8
  br label %64

45:                                               ; preds = %39
  %46 = load i32, ptr %4, align 4, !tbaa !8
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [1000 x %"struct.std::pair"], ptr @p, i64 0, i64 %47
  %49 = getelementptr inbounds %"struct.std::pair", ptr %48, i32 0, i32 0
  %50 = load i32, ptr %49, align 8, !tbaa !15
  %51 = load i32, ptr %4, align 4, !tbaa !8
  %52 = add nsw i32 %51, 1
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [1000 x %"struct.std::pair"], ptr @p, i64 0, i64 %53
  %55 = getelementptr inbounds %"struct.std::pair", ptr %54, i32 0, i32 1
  %56 = load i32, ptr %55, align 4, !tbaa !17
  %57 = mul nsw i32 %50, %56
  %58 = sitofp i32 %57 to double
  %59 = load double, ptr %2, align 8, !tbaa !11
  %60 = fadd double %59, %58
  store double %60, ptr %2, align 8, !tbaa !11
  br label %61

61:                                               ; preds = %45
  %62 = load i32, ptr %4, align 4, !tbaa !8
  %63 = add nsw i32 %62, 1
  store i32 %63, ptr %4, align 4, !tbaa !8
  br label %39, !llvm.loop !18

64:                                               ; preds = %44
  %65 = load i32, ptr @N, align 4, !tbaa !8
  %66 = sub nsw i32 %65, 1
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [1000 x %"struct.std::pair"], ptr @p, i64 0, i64 %67
  %69 = getelementptr inbounds %"struct.std::pair", ptr %68, i32 0, i32 0
  %70 = load i32, ptr %69, align 8, !tbaa !15
  %71 = load i32, ptr getelementptr inbounds (%"struct.std::pair", ptr @p, i32 0, i32 1), align 4, !tbaa !17
  %72 = mul nsw i32 %70, %71
  %73 = sitofp i32 %72 to double
  %74 = load double, ptr %2, align 8, !tbaa !11
  %75 = fadd double %74, %73
  store double %75, ptr %2, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #8
  store i32 1, ptr %5, align 4, !tbaa !8
  br label %76

76:                                               ; preds = %97, %64
  %77 = load i32, ptr %5, align 4, !tbaa !8
  %78 = load i32, ptr @N, align 4, !tbaa !8
  %79 = icmp slt i32 %77, %78
  br i1 %79, label %81, label %80

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

81:                                               ; preds = %76
  %82 = load i32, ptr %5, align 4, !tbaa !8
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [1000 x %"struct.std::pair"], ptr @p, i64 0, i64 %83
  %85 = getelementptr inbounds %"struct.std::pair", ptr %84, i32 0, i32 0
  %86 = load i32, ptr %85, align 8, !tbaa !15
  %87 = load i32, ptr %5, align 4, !tbaa !8
  %88 = sub nsw i32 %87, 1
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [1000 x %"struct.std::pair"], ptr @p, i64 0, i64 %89
  %91 = getelementptr inbounds %"struct.std::pair", ptr %90, i32 0, i32 1
  %92 = load i32, ptr %91, align 4, !tbaa !17
  %93 = mul nsw i32 %86, %92
  %94 = sitofp i32 %93 to double
  %95 = load double, ptr %2, align 8, !tbaa !11
  %96 = fsub double %95, %94
  store double %96, ptr %2, align 8, !tbaa !11
  br label %97

97:                                               ; preds = %81
  %98 = load i32, ptr %5, align 4, !tbaa !8
  %99 = add nsw i32 %98, 1
  store i32 %99, ptr %5, align 4, !tbaa !8
  br label %76, !llvm.loop !19

100:                                              ; preds = %80
  %101 = load i32, ptr @p, align 16, !tbaa !15
  %102 = load i32, ptr @N, align 4, !tbaa !8
  %103 = sub nsw i32 %102, 1
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [1000 x %"struct.std::pair"], ptr @p, i64 0, i64 %104
  %106 = getelementptr inbounds %"struct.std::pair", ptr %105, i32 0, i32 1
  %107 = load i32, ptr %106, align 4, !tbaa !17
  %108 = mul nsw i32 %101, %107
  %109 = sitofp i32 %108 to double
  %110 = load double, ptr %2, align 8, !tbaa !11
  %111 = fsub double %110, %109
  store double %111, ptr %2, align 8, !tbaa !11
  %112 = load double, ptr %2, align 8, !tbaa !11
  %113 = fdiv double %112, 2.000000e+00
  store double %113, ptr %2, align 8, !tbaa !11
  %114 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSt8ios_baseS0_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @_ZSt5fixedRSt8ios_base)
  %115 = call i32 @_ZSt12setprecisioni(i32 noundef 1)
  %116 = getelementptr inbounds %"struct.std::_Setprecision", ptr %6, i32 0, i32 0
  store i32 %115, ptr %116, align 4
  %117 = getelementptr inbounds %"struct.std::_Setprecision", ptr %6, i32 0, i32 0
  %118 = load i32, ptr %117, align 4
  %119 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_St13_Setprecision(ptr noundef nonnull align 8 dereferenceable(8) %114, i32 %118)
  %120 = load double, ptr %2, align 8, !tbaa !11
  %121 = fcmp ogt double %120, 0.000000e+00
  br i1 %121, label %122, label %130

122:                                              ; preds = %100
  %123 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
  %124 = load double, ptr %2, align 8, !tbaa !11
  %125 = fmul double %124, 1.000000e+01
  %126 = call double @llvm.round.f64(double %125)
  %127 = fdiv double %126, 1.000000e+01
  %128 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEd(ptr noundef nonnull align 8 dereferenceable(8) %123, double noundef %127)
  %129 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %128, ptr noundef @.str.1)
  br label %139

130:                                              ; preds = %100
  %131 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.2)
  %132 = load double, ptr %2, align 8, !tbaa !11
  %133 = fneg double %132
  %134 = fmul double %133, 1.000000e+01
  %135 = call double @llvm.round.f64(double %134)
  %136 = fdiv double %135, 1.000000e+01
  %137 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEd(ptr noundef nonnull align 8 dereferenceable(8) %131, double noundef %136)
  %138 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %137, ptr noundef @.str.1)
  br label %139

139:                                              ; preds = %130, %122
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #8
  br label %13, !llvm.loop !20

140:                                              ; preds = %17
  %141 = load i32, ptr %1, align 4
  ret i32 %141
}

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) #1 align 2

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) #2

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 nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #3

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_St13_Setprecision(ptr noundef nonnull align 8 dereferenceable(8), i32) #4

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(216) ptr @_ZSt5fixedRSt8ios_base(ptr noundef nonnull align 8 dereferenceable(216)) #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local i32 @_ZSt12setprecisioni(i32 noundef) #6

; 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 @_ZNSolsEd(ptr noundef nonnull align 8 dereferenceable(8), double noundef) #5 align 2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.round.f64(double) #7

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 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 = { "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 nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = { 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 #7 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #8 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !10, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!16, !9, i64 0}
!16 = !{!"_ZTSSt4pairIiiE", !9, i64 0, !9, i64 4}
!17 = !{!16, !9, i64 4}
!18 = distinct !{!18, !14}
!19 = distinct !{!19, !14}
!20 = distinct !{!20, !14}


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

@N = external dso_local global i32, align 4
@p = external dso_local global [1000 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 [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.2 = 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 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %2 = getelementptr i8, ptr %1, i64 -24
  %3 = load i64, ptr %2, align 8
  %4 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %3
  %5 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %4, ptr noundef null)
  %6 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %7 = 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)
  %8 = load i32, ptr @N, align 4, !tbaa !8
  %9 = icmp eq i32 %8, 0
  br i1 %9, label %._crit_edge41, label %.preheader27

.preheader27:                                     ; preds = %0, %._crit_edge39
  %10 = phi i32 [ %101, %._crit_edge39 ], [ %8, %0 ]
  %11 = icmp sgt i32 %10, 0
  br i1 %11, label %.lr.ph, label %.preheader.thread

.preheader.thread:                                ; preds = %.preheader27
  %12 = add i32 %10, -1
  br label %._crit_edge.thread

.preheader:                                       ; preds = %.lr.ph
  %13 = add i32 %21, -1
  %14 = icmp sgt i32 %21, 1
  br i1 %14, label %.lr.ph32.preheader, label %._crit_edge.thread

.lr.ph32.preheader:                               ; preds = %.preheader
  %wide.trip.count = zext nneg i32 %13 to i64
  %15 = add nsw i64 %wide.trip.count, -1
  %xtraiter = and i64 %wide.trip.count, 3
  %16 = icmp ult i64 %15, 3
  br i1 %16, label %._crit_edge.unr-lcssa, label %.lr.ph32.preheader.new

.lr.ph32.preheader.new:                           ; preds = %.lr.ph32.preheader
  %unroll_iter = and i64 %wide.trip.count, 2147483644
  br label %.lr.ph32

.lr.ph:                                           ; preds = %.preheader27, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.preheader27 ]
  %17 = getelementptr inbounds [1000 x %"struct.std::pair"], ptr @p, i64 0, i64 %indvars.iv
  %18 = 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) %17)
  %19 = getelementptr inbounds i8, ptr %17, i64 4
  %20 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %18, ptr noundef nonnull align 4 dereferenceable(4) %19)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %21 = load i32, ptr @N, align 4, !tbaa !8
  %22 = sext i32 %21 to i64
  %23 = icmp slt i64 %indvars.iv.next, %22
  br i1 %23, label %.lr.ph, label %.preheader, !llvm.loop !11

._crit_edge.thread:                               ; preds = %.preheader, %.preheader.thread
  %.ph56 = phi i32 [ %12, %.preheader.thread ], [ %13, %.preheader ]
  %24 = sext i32 %.ph56 to i64
  %25 = getelementptr inbounds [1000 x %"struct.std::pair"], ptr @p, i64 0, i64 %24
  %26 = load i32, ptr %25, align 8, !tbaa !13
  %27 = load i32, ptr getelementptr inbounds (i8, ptr @p, i64 4), align 4, !tbaa !15
  %28 = mul nsw i32 %27, %26
  %29 = sitofp i32 %28 to double
  br label %._crit_edge39

._crit_edge.unr-lcssa:                            ; preds = %.lr.ph32, %.lr.ph32.preheader
  %.lcssa66.ph = phi double [ poison, %.lr.ph32.preheader ], [ %73, %.lr.ph32 ]
  %indvars.iv46.unr = phi i64 [ 0, %.lr.ph32.preheader ], [ %indvars.iv.next47.3, %.lr.ph32 ]
  %.031.unr = phi double [ 0.000000e+00, %.lr.ph32.preheader ], [ %73, %.lr.ph32 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge, label %.lr.ph32.epil

.lr.ph32.epil:                                    ; preds = %._crit_edge.unr-lcssa, %.lr.ph32.epil
  %indvars.iv46.epil = phi i64 [ %indvars.iv.next47.epil, %.lr.ph32.epil ], [ %indvars.iv46.unr, %._crit_edge.unr-lcssa ]
  %.031.epil = phi double [ %36, %.lr.ph32.epil ], [ %.031.unr, %._crit_edge.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph32.epil ], [ 0, %._crit_edge.unr-lcssa ]
  %30 = getelementptr inbounds [1000 x %"struct.std::pair"], ptr @p, i64 0, i64 %indvars.iv46.epil
  %31 = load i32, ptr %30, align 8, !tbaa !13
  %indvars.iv.next47.epil = add nuw nsw i64 %indvars.iv46.epil, 1
  %32 = getelementptr inbounds [1000 x %"struct.std::pair"], ptr @p, i64 0, i64 %indvars.iv.next47.epil, i32 1
  %33 = load i32, ptr %32, align 4, !tbaa !15
  %34 = mul nsw i32 %33, %31
  %35 = sitofp i32 %34 to double
  %36 = fadd double %.031.epil, %35
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %._crit_edge, label %.lr.ph32.epil, !llvm.loop !16

._crit_edge:                                      ; preds = %.lr.ph32.epil, %._crit_edge.unr-lcssa
  %.lcssa66 = phi double [ %.lcssa66.ph, %._crit_edge.unr-lcssa ], [ %36, %.lr.ph32.epil ]
  %37 = sext i32 %13 to i64
  %38 = getelementptr inbounds [1000 x %"struct.std::pair"], ptr @p, i64 0, i64 %37
  %39 = load i32, ptr %38, align 8, !tbaa !13
  %40 = load i32, ptr getelementptr inbounds (i8, ptr @p, i64 4), align 4, !tbaa !15
  %41 = mul nsw i32 %40, %39
  %42 = sitofp i32 %41 to double
  %43 = fadd double %.lcssa66, %42
  br i1 %14, label %.lr.ph38.preheader, label %._crit_edge39

.lr.ph38.preheader:                               ; preds = %._crit_edge
  %wide.trip.count52 = zext nneg i32 %21 to i64
  %44 = add nsw i64 %wide.trip.count52, -1
  %xtraiter69 = and i64 %44, 1
  %45 = icmp eq i32 %21, 2
  br i1 %45, label %._crit_edge39.loopexit.unr-lcssa, label %.lr.ph38.preheader.new

.lr.ph38.preheader.new:                           ; preds = %.lr.ph38.preheader
  %unroll_iter73 = and i64 %44, -2
  br label %.lr.ph38

.lr.ph32:                                         ; preds = %.lr.ph32, %.lr.ph32.preheader.new
  %indvars.iv46 = phi i64 [ 0, %.lr.ph32.preheader.new ], [ %indvars.iv.next47.3, %.lr.ph32 ]
  %.031 = phi double [ 0.000000e+00, %.lr.ph32.preheader.new ], [ %73, %.lr.ph32 ]
  %niter = phi i64 [ 0, %.lr.ph32.preheader.new ], [ %niter.next.3, %.lr.ph32 ]
  %46 = getelementptr inbounds [1000 x %"struct.std::pair"], ptr @p, i64 0, i64 %indvars.iv46
  %47 = load i32, ptr %46, align 16, !tbaa !13
  %indvars.iv.next47 = or disjoint i64 %indvars.iv46, 1
  %48 = getelementptr inbounds [1000 x %"struct.std::pair"], ptr @p, i64 0, i64 %indvars.iv.next47, i32 1
  %49 = load i32, ptr %48, align 4, !tbaa !15
  %50 = mul nsw i32 %49, %47
  %51 = sitofp i32 %50 to double
  %52 = fadd double %.031, %51
  %53 = getelementptr inbounds [1000 x %"struct.std::pair"], ptr @p, i64 0, i64 %indvars.iv.next47
  %54 = load i32, ptr %53, align 8, !tbaa !13
  %indvars.iv.next47.1 = or disjoint i64 %indvars.iv46, 2
  %55 = getelementptr inbounds [1000 x %"struct.std::pair"], ptr @p, i64 0, i64 %indvars.iv.next47.1, i32 1
  %56 = load i32, ptr %55, align 4, !tbaa !15
  %57 = mul nsw i32 %56, %54
  %58 = sitofp i32 %57 to double
  %59 = fadd double %52, %58
  %60 = getelementptr inbounds [1000 x %"struct.std::pair"], ptr @p, i64 0, i64 %indvars.iv.next47.1
  %61 = load i32, ptr %60, align 16, !tbaa !13
  %indvars.iv.next47.2 = or disjoint i64 %indvars.iv46, 3
  %62 = getelementptr inbounds [1000 x %"struct.std::pair"], ptr @p, i64 0, i64 %indvars.iv.next47.2, i32 1
  %63 = load i32, ptr %62, align 4, !tbaa !15
  %64 = mul nsw i32 %63, %61
  %65 = sitofp i32 %64 to double
  %66 = fadd double %59, %65
  %67 = getelementptr inbounds [1000 x %"struct.std::pair"], ptr @p, i64 0, i64 %indvars.iv.next47.2
  %68 = load i32, ptr %67, align 8, !tbaa !13
  %indvars.iv.next47.3 = add nuw nsw i64 %indvars.iv46, 4
  %69 = getelementptr inbounds [1000 x %"struct.std::pair"], ptr @p, i64 0, i64 %indvars.iv.next47.3, i32 1
  %70 = load i32, ptr %69, align 4, !tbaa !15
  %71 = mul nsw i32 %70, %68
  %72 = sitofp i32 %71 to double
  %73 = fadd double %66, %72
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %._crit_edge.unr-lcssa, label %.lr.ph32, !llvm.loop !18

._crit_edge39.loopexit.unr-lcssa:                 ; preds = %.lr.ph38, %.lr.ph38.preheader
  %.lcssa67.ph = phi double [ poison, %.lr.ph38.preheader ], [ %117, %.lr.ph38 ]
  %indvars.iv49.unr = phi i64 [ 1, %.lr.ph38.preheader ], [ %indvars.iv.next50.1, %.lr.ph38 ]
  %.136.unr = phi double [ %43, %.lr.ph38.preheader ], [ %117, %.lr.ph38 ]
  %lcmp.mod71.not = icmp eq i64 %xtraiter69, 0
  br i1 %lcmp.mod71.not, label %._crit_edge39, label %.lr.ph38.epil

.lr.ph38.epil:                                    ; preds = %._crit_edge39.loopexit.unr-lcssa
  %74 = getelementptr inbounds [1000 x %"struct.std::pair"], ptr @p, i64 0, i64 %indvars.iv49.unr
  %75 = load i32, ptr %74, align 8, !tbaa !13
  %76 = add nsw i64 %indvars.iv49.unr, -1
  %77 = getelementptr inbounds [1000 x %"struct.std::pair"], ptr @p, i64 0, i64 %76, i32 1
  %78 = load i32, ptr %77, align 4, !tbaa !15
  %79 = mul nsw i32 %78, %75
  %80 = sitofp i32 %79 to double
  %81 = fsub double %.136.unr, %80
  br label %._crit_edge39

._crit_edge39:                                    ; preds = %.lr.ph38.epil, %._crit_edge39.loopexit.unr-lcssa, %._crit_edge.thread, %._crit_edge
  %82 = phi i64 [ %37, %._crit_edge ], [ %24, %._crit_edge.thread ], [ %37, %._crit_edge39.loopexit.unr-lcssa ], [ %37, %.lr.ph38.epil ]
  %.1.lcssa = phi double [ %43, %._crit_edge ], [ %29, %._crit_edge.thread ], [ %.lcssa67.ph, %._crit_edge39.loopexit.unr-lcssa ], [ %81, %.lr.ph38.epil ]
  %83 = load i32, ptr @p, align 16, !tbaa !13
  %84 = getelementptr inbounds [1000 x %"struct.std::pair"], ptr @p, i64 0, i64 %82, i32 1
  %85 = load i32, ptr %84, align 4, !tbaa !15
  %86 = mul nsw i32 %85, %83
  %87 = sitofp i32 %86 to double
  %88 = fsub double %.1.lcssa, %87
  %89 = fmul double %88, 5.000000e-01
  %90 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSt8ios_baseS0_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @_ZSt5fixedRSt8ios_base)
  %91 = tail call i32 @_ZSt12setprecisioni(i32 noundef 1)
  %92 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_St13_Setprecision(ptr noundef nonnull align 8 dereferenceable(8) %90, i32 %91)
  %93 = fcmp ogt double %89, 0.000000e+00
  %.str..str.2 = select i1 %93, ptr @.str, ptr @.str.2
  %. = select i1 %93, double 1.000000e+01, double -1.000000e+01
  %94 = tail 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..str.2)
  %95 = fmul double %89, %.
  %96 = tail call double @llvm.round.f64(double %95)
  %97 = fdiv double %96, 1.000000e+01
  %98 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEd(ptr noundef nonnull align 8 dereferenceable(8) %94, double noundef %97)
  %99 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %98, ptr noundef nonnull @.str.1)
  %100 = 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)
  %101 = load i32, ptr @N, align 4, !tbaa !8
  %102 = icmp eq i32 %101, 0
  br i1 %102, label %._crit_edge41, label %.preheader27, !llvm.loop !19

.lr.ph38:                                         ; preds = %.lr.ph38, %.lr.ph38.preheader.new
  %indvars.iv49 = phi i64 [ 1, %.lr.ph38.preheader.new ], [ %indvars.iv.next50.1, %.lr.ph38 ]
  %.136 = phi double [ %43, %.lr.ph38.preheader.new ], [ %117, %.lr.ph38 ]
  %niter74 = phi i64 [ 0, %.lr.ph38.preheader.new ], [ %niter74.next.1, %.lr.ph38 ]
  %103 = getelementptr inbounds [1000 x %"struct.std::pair"], ptr @p, i64 0, i64 %indvars.iv49
  %104 = load i32, ptr %103, align 8, !tbaa !13
  %105 = add nsw i64 %indvars.iv49, -1
  %106 = getelementptr inbounds [1000 x %"struct.std::pair"], ptr @p, i64 0, i64 %105, i32 1
  %107 = load i32, ptr %106, align 4, !tbaa !15
  %108 = mul nsw i32 %107, %104
  %109 = sitofp i32 %108 to double
  %110 = fsub double %.136, %109
  %indvars.iv.next50 = add nuw nsw i64 %indvars.iv49, 1
  %111 = getelementptr inbounds [1000 x %"struct.std::pair"], ptr @p, i64 0, i64 %indvars.iv.next50
  %112 = load i32, ptr %111, align 8, !tbaa !13
  %113 = getelementptr inbounds [1000 x %"struct.std::pair"], ptr @p, i64 0, i64 %indvars.iv49, i32 1
  %114 = load i32, ptr %113, align 4, !tbaa !15
  %115 = mul nsw i32 %114, %112
  %116 = sitofp i32 %115 to double
  %117 = fsub double %110, %116
  %indvars.iv.next50.1 = add nuw nsw i64 %indvars.iv49, 2
  %niter74.next.1 = add i64 %niter74, 2
  %niter74.ncmp.1 = icmp eq i64 %niter74.next.1, %unroll_iter73
  br i1 %niter74.ncmp.1, label %._crit_edge39.loopexit.unr-lcssa, label %.lr.ph38, !llvm.loop !20

._crit_edge41:                                    ; preds = %._crit_edge39, %0
  ret i32 0
}

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) local_unnamed_addr #1 align 2

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) local_unnamed_addr #2

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: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_St13_Setprecision(ptr noundef nonnull align 8 dereferenceable(8), i32) local_unnamed_addr #3

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(216) ptr @_ZSt5fixedRSt8ios_base(ptr noundef nonnull align 8 dereferenceable(216)) #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local i32 @_ZSt12setprecisioni(i32 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 #3

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.round.f64(double) #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 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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { inlinehint mustprogress 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 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 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 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }

!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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !9, i64 0}
!14 = !{!"_ZTSSt4pairIiiE", !9, i64 0, !9, i64 4}
!15 = !{!14, !9, i64 4}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.unroll.disable"}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12}


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