; LLVM IR from bqi343/cp-notebook :: Contests/USACO Solutions/2015-16/Jan 2016/Plat/16 Jan P3.ll (Z5inputv)

; 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"

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"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 }
%"struct.std::pair" = type { i32, i32 }

@N = external dso_local global i32, align 4
@cum = external dso_local global [400 x i32], align 16
@x = external dso_local global %"class.std::vector", align 8
@point = external dso_local global %"class.std::vector.0", align 8
@.str = external hidden unnamed_addr constant [13 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [2 x i8], align 1
@stdin = external global ptr, align 8
@.str.6 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [2 x i8], align 1
@stdout = external global ptr, align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #0 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5inputv() #2 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca %"struct.std::pair", align 4
  %5 = alloca %"struct.std::pair", align 4
  %6 = alloca %"struct.std::pair", align 4
  %7 = alloca i32, align 4
  %8 = alloca %"struct.std::pair", align 4
  %9 = alloca %"struct.std::pair", align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = load ptr, ptr @stdin, align 8, !tbaa !5
  %13 = call ptr @freopen(ptr noundef @.str, ptr noundef @.str.5, ptr noundef %12)
  %14 = load ptr, ptr @stdout, align 8, !tbaa !5
  %15 = call ptr @freopen(ptr noundef @.str.6, ptr noundef @.str.7, ptr noundef %14)
  %16 = 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)
  %17 = load i32, ptr @N, align 4, !tbaa !9
  %18 = sext i32 %17 to i64
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) @point, i64 noundef %18)
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #5
  store i32 0, ptr %1, align 4, !tbaa !9
  br label %19

19:                                               ; preds = %35, %0
  %20 = load i32, ptr %1, align 4, !tbaa !9
  %21 = load i32, ptr @N, align 4, !tbaa !9
  %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 %1) #5
  br label %38

24:                                               ; preds = %19
  %25 = load i32, ptr %1, align 4, !tbaa !9
  %26 = sext i32 %25 to i64
  %27 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @point, i64 noundef %26) #5
  %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 %1, align 4, !tbaa !9
  %31 = sext i32 %30 to i64
  %32 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @point, i64 noundef %31) #5
  %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 %1, align 4, !tbaa !9
  %37 = add nsw i32 %36, 1
  store i32 %37, ptr %1, align 4, !tbaa !9
  br label %19, !llvm.loop !11

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

39:                                               ; preds = %79, %38
  %40 = load i32, ptr %2, align 4, !tbaa !9
  %41 = load i32, ptr @N, align 4, !tbaa !9
  %42 = icmp slt i32 %40, %41
  br i1 %42, label %44, label %43

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

44:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  %45 = load i32, ptr %2, align 4, !tbaa !9
  %46 = load i32, ptr @N, align 4, !tbaa !9
  %47 = sub nsw i32 %46, 1
  %48 = add nsw i32 %45, %47
  %49 = load i32, ptr @N, align 4, !tbaa !9
  %50 = srem i32 %48, %49
  %51 = sext i32 %50 to i64
  %52 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @point, i64 noundef %51) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %4, ptr align 4 %52, i64 8, i1 false)
  %53 = load i32, ptr %2, align 4, !tbaa !9
  %54 = sext i32 %53 to i64
  %55 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @point, i64 noundef %54) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %5, ptr align 4 %55, i64 8, i1 false)
  %56 = load i32, ptr %2, align 4, !tbaa !9
  %57 = add nsw i32 %56, 1
  %58 = load i32, ptr @N, align 4, !tbaa !9
  %59 = srem i32 %57, %58
  %60 = sext i32 %59 to i64
  %61 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @point, i64 noundef %60) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %6, ptr align 4 %61, i64 8, i1 false)
  %62 = load i32, ptr %2, align 4, !tbaa !9
  %63 = load i64, ptr %4, align 4
  %64 = load i64, ptr %5, align 4
  %65 = load i64, ptr %6, align 4
  %66 = call noundef i32 @_Z5angleSt4pairIiiES0_S0_i(i64 %63, i64 %64, i64 %65, i32 noundef %62)
  store i32 %66, ptr %3, align 4, !tbaa !9
  call void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) @x, ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  %67 = load i32, ptr %2, align 4, !tbaa !9
  %68 = sext i32 %67 to i64
  %69 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @point, i64 noundef %68) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %8, ptr align 4 %69, i64 8, i1 false)
  %70 = load i32, ptr %2, align 4, !tbaa !9
  %71 = add nsw i32 %70, 1
  %72 = load i32, ptr @N, align 4, !tbaa !9
  %73 = srem i32 %71, %72
  %74 = sext i32 %73 to i64
  %75 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @point, i64 noundef %74) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %9, ptr align 4 %75, i64 8, i1 false)
  %76 = load i64, ptr %8, align 4
  %77 = load i64, ptr %9, align 4
  %78 = call noundef i32 @_Z4distSt4pairIiiES0_(i64 %76, i64 %77)
  store i32 %78, ptr %7, align 4, !tbaa !9
  call void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) @x, ptr noundef nonnull align 4 dereferenceable(4) %7)
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %79

79:                                               ; preds = %44
  %80 = load i32, ptr %2, align 4, !tbaa !9
  %81 = add nsw i32 %80, 1
  store i32 %81, ptr %2, align 4, !tbaa !9
  br label %39, !llvm.loop !13

82:                                               ; preds = %43
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 0, ptr %10, align 4, !tbaa !9
  br label %83

83:                                               ; preds = %93, %82
  %84 = load i32, ptr %10, align 4, !tbaa !9
  %85 = load i32, ptr @N, align 4, !tbaa !9
  %86 = mul nsw i32 2, %85
  %87 = icmp slt i32 %84, %86
  br i1 %87, label %89, label %88

88:                                               ; preds = %83
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %96

89:                                               ; preds = %83
  %90 = load i32, ptr %10, align 4, !tbaa !9
  %91 = sext i32 %90 to i64
  %92 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @x, i64 noundef %91) #5
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) @x, ptr noundef nonnull align 4 dereferenceable(4) %92)
  br label %93

93:                                               ; preds = %89
  %94 = load i32, ptr %10, align 4, !tbaa !9
  %95 = add nsw i32 %94, 1
  store i32 %95, ptr %10, align 4, !tbaa !9
  br label %83, !llvm.loop !14

96:                                               ; preds = %88
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 1, ptr %11, align 4, !tbaa !9
  br label %97

97:                                               ; preds = %120, %96
  %98 = load i32, ptr %11, align 4, !tbaa !9
  %99 = load i32, ptr @N, align 4, !tbaa !9
  %100 = mul nsw i32 2, %99
  %101 = add nsw i32 %100, 1
  %102 = icmp slt i32 %98, %101
  br i1 %102, label %104, label %103

103:                                              ; preds = %97
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %123

104:                                              ; preds = %97
  %105 = load i32, ptr %11, align 4, !tbaa !9
  %106 = sub nsw i32 %105, 1
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [400 x i32], ptr @cum, i64 0, i64 %107
  %109 = load i32, ptr %108, align 4, !tbaa !9
  %110 = load i32, ptr %11, align 4, !tbaa !9
  %111 = mul nsw i32 2, %110
  %112 = sub nsw i32 %111, 1
  %113 = sext i32 %112 to i64
  %114 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @x, i64 noundef %113) #5
  %115 = load i32, ptr %114, align 4, !tbaa !9
  %116 = add nsw i32 %109, %115
  %117 = load i32, ptr %11, align 4, !tbaa !9
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [400 x i32], ptr @cum, i64 0, i64 %118
  store i32 %116, ptr %119, align 4, !tbaa !9
  br label %120

120:                                              ; preds = %104
  %121 = load i32, ptr %11, align 4, !tbaa !9
  %122 = add nsw i32 %121, 1
  store i32 %122, ptr %11, align 4, !tbaa !9
  br label %97, !llvm.loop !15

123:                                              ; preds = %103
  ret void
}

declare ptr @freopen(ptr noundef, ptr noundef, ptr noundef) #3

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 dso_local void @_ZNSt6vectorISt4pairIiiESaIS1_EE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) #2 align 2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) #2 align 2

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { "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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !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"

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"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 }

@N = external dso_local global i32, align 4
@cum = external dso_local local_unnamed_addr global [400 x i32], align 16
@x = external dso_local global %"class.std::vector", align 8
@point = external dso_local global %"class.std::vector.0", align 8
@.str = external hidden unnamed_addr constant [13 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [2 x i8], align 1
@stdin = external local_unnamed_addr global ptr, align 8
@.str.6 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [2 x i8], align 1
@stdout = external local_unnamed_addr global ptr, align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z4distSt4pairIiiES0_(i64, i64) 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 nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #0 align 2

; 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 nounwind uwtable
declare dso_local noundef i32 @_Z5angleSt4pairIiiES0_S0_i(i64, i64, i64, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5inputv() local_unnamed_addr #2 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = load ptr, ptr @stdin, align 8, !tbaa !5
  %4 = tail call ptr @freopen(ptr noundef nonnull @.str, ptr noundef nonnull @.str.5, ptr noundef %3)
  %5 = load ptr, ptr @stdout, align 8, !tbaa !5
  %6 = tail call ptr @freopen(ptr noundef nonnull @.str.6, ptr noundef nonnull @.str.7, ptr noundef %5)
  %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 !9
  %9 = sext i32 %8 to i64
  tail call void @_ZNSt6vectorISt4pairIiiESaIS1_EE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) @point, i64 noundef %9)
  %10 = load i32, ptr @N, align 4, !tbaa !9
  %11 = icmp sgt i32 %10, 0
  br i1 %11, label %.lr.ph, label %._crit_edge

.preheader28:                                     ; preds = %.lr.ph
  %12 = icmp sgt i32 %18, 0
  br i1 %12, label %.lr.ph31, label %._crit_edge

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %13 = tail call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @point, i64 noundef %indvars.iv) #4
  %14 = 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) %13)
  %15 = tail call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @point, i64 noundef %indvars.iv) #4
  %16 = getelementptr inbounds i8, ptr %15, i64 4
  %17 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %14, ptr noundef nonnull align 4 dereferenceable(4) %16)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %18 = load i32, ptr @N, align 4, !tbaa !9
  %19 = sext i32 %18 to i64
  %20 = icmp slt i64 %indvars.iv.next, %19
  br i1 %20, label %.lr.ph, label %.preheader28, !llvm.loop !11

.preheader27:                                     ; preds = %.lr.ph31
  %21 = icmp sgt i32 %43, 0
  br i1 %21, label %.lr.ph33, label %._crit_edge

.lr.ph31:                                         ; preds = %.preheader28, %.lr.ph31
  %indvars.iv38 = phi i64 [ %indvars.iv.next39, %.lr.ph31 ], [ 0, %.preheader28 ]
  %22 = phi i32 [ %43, %.lr.ph31 ], [ %18, %.preheader28 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #4
  %23 = trunc i64 %indvars.iv38 to i32
  %24 = add i32 %23, -1
  %25 = add i32 %24, %22
  %26 = srem i32 %25, %22
  %27 = sext i32 %26 to i64
  %28 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @point, i64 noundef %27) #4
  %.sroa.011.0.copyload = load i64, ptr %28, align 4
  %29 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @point, i64 noundef %indvars.iv38) #4
  %.sroa.010.0.copyload = load i64, ptr %29, align 4
  %indvars.iv.next39 = add nuw nsw i64 %indvars.iv38, 1
  %30 = load i32, ptr @N, align 4, !tbaa !9
  %31 = trunc nuw nsw i64 %indvars.iv.next39 to i32
  %32 = srem i32 %31, %30
  %33 = zext nneg i32 %32 to i64
  %34 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @point, i64 noundef %33) #4
  %.sroa.09.0.copyload = load i64, ptr %34, align 4
  %35 = trunc nuw nsw i64 %indvars.iv38 to i32
  %36 = call noundef i32 @_Z5angleSt4pairIiiES0_S0_i(i64 %.sroa.011.0.copyload, i64 %.sroa.010.0.copyload, i64 %.sroa.09.0.copyload, i32 noundef %35)
  store i32 %36, ptr %1, align 4, !tbaa !9
  call void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) @x, ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #4
  %37 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @point, i64 noundef %indvars.iv38) #4
  %.sroa.08.0.copyload = load i64, ptr %37, align 4
  %38 = load i32, ptr @N, align 4, !tbaa !9
  %39 = srem i32 %31, %38
  %40 = zext nneg i32 %39 to i64
  %41 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @point, i64 noundef %40) #4
  %.sroa.0.0.copyload = load i64, ptr %41, align 4
  %42 = call noundef i32 @_Z4distSt4pairIiiES0_(i64 %.sroa.08.0.copyload, i64 %.sroa.0.0.copyload)
  store i32 %42, ptr %2, align 4, !tbaa !9
  call void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) @x, ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #4
  %43 = load i32, ptr @N, align 4, !tbaa !9
  %44 = sext i32 %43 to i64
  %45 = icmp slt i64 %indvars.iv.next39, %44
  br i1 %45, label %.lr.ph31, label %.preheader27, !llvm.loop !13

.preheader:                                       ; preds = %.lr.ph33
  %46 = icmp slt i32 %48, 1
  br i1 %46, label %._crit_edge, label %.lr.ph36.preheader

.lr.ph36.preheader:                               ; preds = %.preheader
  %.pre = load i32, ptr @cum, align 16, !tbaa !9
  br label %.lr.ph36

.lr.ph33:                                         ; preds = %.preheader27, %.lr.ph33
  %indvars.iv41 = phi i64 [ %indvars.iv.next42, %.lr.ph33 ], [ 0, %.preheader27 ]
  %47 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @x, i64 noundef %indvars.iv41) #4
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) @x, ptr noundef nonnull align 4 dereferenceable(4) %47)
  %indvars.iv.next42 = add nuw nsw i64 %indvars.iv41, 1
  %48 = load i32, ptr @N, align 4, !tbaa !9
  %49 = shl nsw i32 %48, 1
  %50 = sext i32 %49 to i64
  %51 = icmp slt i64 %indvars.iv.next42, %50
  br i1 %51, label %.lr.ph33, label %.preheader, !llvm.loop !14

._crit_edge:                                      ; preds = %.lr.ph36, %0, %.preheader28, %.preheader27, %.preheader
  ret void

.lr.ph36:                                         ; preds = %.lr.ph36.preheader, %.lr.ph36
  %52 = phi i32 [ %.pre, %.lr.ph36.preheader ], [ %57, %.lr.ph36 ]
  %indvars.iv44 = phi i64 [ 1, %.lr.ph36.preheader ], [ %indvars.iv.next45, %.lr.ph36 ]
  %53 = shl nuw nsw i64 %indvars.iv44, 1
  %54 = add nsw i64 %53, -1
  %55 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @x, i64 noundef %54) #4
  %56 = load i32, ptr %55, align 4, !tbaa !9
  %57 = add nsw i32 %56, %52
  %58 = getelementptr inbounds [400 x i32], ptr @cum, i64 0, i64 %indvars.iv44
  store i32 %57, ptr %58, align 4, !tbaa !9
  %indvars.iv.next45 = add nuw nsw i64 %indvars.iv44, 1
  %59 = load i32, ptr @N, align 4, !tbaa !9
  %60 = shl nsw i32 %59, 1
  %61 = sext i32 %60 to i64
  %.not.not = icmp slt i64 %indvars.iv44, %61
  br i1 %.not.not, label %.lr.ph36, label %._crit_edge, !llvm.loop !15
}

declare ptr @freopen(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

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 dso_local void @_ZNSt6vectorISt4pairIiiESaIS1_EE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #0 align 2

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

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

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { "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 = { 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}


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