; LLVM IR from eyangch/competitive-programming :: Codeforces/1619 (h)

; 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::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
@Q = external dso_local global i64, align 8
@S = external dso_local global i64, align 8
@P = external dso_local global [100000 x i64], align 16
@R = external dso_local global [100000 x i64], align 16
@J = external dso_local global [100000 x i64], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z3updx(i64 noundef) #0

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #2 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca i32, align 4
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  %15 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %16 = getelementptr i8, ptr %15, i64 -24
  %17 = load i64, ptr %16, align 8
  %18 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %17
  %19 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %18, ptr noundef null)
  %20 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %21 = 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)
  %22 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %21, ptr noundef nonnull align 8 dereferenceable(8) @Q)
  %23 = load i64, ptr @N, align 8, !tbaa !8
  %24 = call noundef double @_ZSt4sqrtIxEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i64 noundef %23)
  %25 = fptosi double %24 to i64
  store i64 %25, ptr @S, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #7
  store i64 0, ptr %2, align 8, !tbaa !8
  br label %26

26:                                               ; preds = %39, %0
  %27 = load i64, ptr %2, align 8, !tbaa !8
  %28 = load i64, ptr @N, align 8, !tbaa !8
  %29 = icmp slt i64 %27, %28
  br i1 %29, label %31, label %30

30:                                               ; preds = %26
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #7
  br label %42

31:                                               ; preds = %26
  %32 = load i64, ptr %2, align 8, !tbaa !8
  %33 = getelementptr inbounds [100000 x i64], ptr @P, i64 0, i64 %32
  %34 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %33)
  %35 = load i64, ptr %2, align 8, !tbaa !8
  %36 = getelementptr inbounds [100000 x i64], ptr @P, i64 0, i64 %35
  %37 = load i64, ptr %36, align 8, !tbaa !8
  %38 = add nsw i64 %37, -1
  store i64 %38, ptr %36, align 8, !tbaa !8
  br label %39

39:                                               ; preds = %31
  %40 = load i64, ptr %2, align 8, !tbaa !8
  %41 = add nsw i64 %40, 1
  store i64 %41, ptr %2, align 8, !tbaa !8
  br label %26, !llvm.loop !11

42:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #7
  store i64 0, ptr %3, align 8, !tbaa !8
  br label %43

43:                                               ; preds = %54, %42
  %44 = load i64, ptr %3, align 8, !tbaa !8
  %45 = load i64, ptr @N, align 8, !tbaa !8
  %46 = icmp slt i64 %44, %45
  br i1 %46, label %48, label %47

47:                                               ; preds = %43
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #7
  br label %57

48:                                               ; preds = %43
  %49 = load i64, ptr %3, align 8, !tbaa !8
  %50 = load i64, ptr %3, align 8, !tbaa !8
  %51 = getelementptr inbounds [100000 x i64], ptr @P, i64 0, i64 %50
  %52 = load i64, ptr %51, align 8, !tbaa !8
  %53 = getelementptr inbounds [100000 x i64], ptr @R, i64 0, i64 %52
  store i64 %49, ptr %53, align 8, !tbaa !8
  br label %54

54:                                               ; preds = %48
  %55 = load i64, ptr %3, align 8, !tbaa !8
  %56 = add nsw i64 %55, 1
  store i64 %56, ptr %3, align 8, !tbaa !8
  br label %43, !llvm.loop !13

57:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #7
  store i64 0, ptr %4, align 8, !tbaa !8
  br label %58

58:                                               ; preds = %84, %57
  %59 = load i64, ptr %4, align 8, !tbaa !8
  %60 = load i64, ptr @N, align 8, !tbaa !8
  %61 = icmp slt i64 %59, %60
  br i1 %61, label %63, label %62

62:                                               ; preds = %58
  store i32 8, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #7
  br label %87

63:                                               ; preds = %58
  %64 = load i64, ptr %4, align 8, !tbaa !8
  %65 = load i64, ptr %4, align 8, !tbaa !8
  %66 = getelementptr inbounds [100000 x i64], ptr @J, i64 0, i64 %65
  store i64 %64, ptr %66, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  store i64 0, ptr %6, align 8, !tbaa !8
  br label %67

67:                                               ; preds = %80, %63
  %68 = load i64, ptr %6, align 8, !tbaa !8
  %69 = load i64, ptr @S, align 8, !tbaa !8
  %70 = icmp slt i64 %68, %69
  br i1 %70, label %72, label %71

71:                                               ; preds = %67
  store i32 11, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  br label %83

72:                                               ; preds = %67
  %73 = load i64, ptr %4, align 8, !tbaa !8
  %74 = getelementptr inbounds [100000 x i64], ptr @J, i64 0, i64 %73
  %75 = load i64, ptr %74, align 8, !tbaa !8
  %76 = getelementptr inbounds [100000 x i64], ptr @P, i64 0, i64 %75
  %77 = load i64, ptr %76, align 8, !tbaa !8
  %78 = load i64, ptr %4, align 8, !tbaa !8
  %79 = getelementptr inbounds [100000 x i64], ptr @J, i64 0, i64 %78
  store i64 %77, ptr %79, align 8, !tbaa !8
  br label %80

80:                                               ; preds = %72
  %81 = load i64, ptr %6, align 8, !tbaa !8
  %82 = add nsw i64 %81, 1
  store i64 %82, ptr %6, align 8, !tbaa !8
  br label %67, !llvm.loop !14

83:                                               ; preds = %71
  br label %84

84:                                               ; preds = %83
  %85 = load i64, ptr %4, align 8, !tbaa !8
  %86 = add nsw i64 %85, 1
  store i64 %86, ptr %4, align 8, !tbaa !8
  br label %58, !llvm.loop !15

87:                                               ; preds = %62
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  store i64 0, ptr %7, align 8, !tbaa !8
  br label %88

88:                                               ; preds = %158, %87
  %89 = load i64, ptr %7, align 8, !tbaa !8
  %90 = load i64, ptr @Q, align 8, !tbaa !8
  %91 = icmp slt i64 %89, %90
  br i1 %91, label %93, label %92

92:                                               ; preds = %88
  store i32 14, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  br label %161

93:                                               ; preds = %88
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  %94 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %8)
  %95 = load i64, ptr %8, align 8, !tbaa !8
  %96 = icmp eq i64 %95, 1
  br i1 %96, label %97, label %118

97:                                               ; preds = %93
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  %98 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %9)
  %99 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %98, ptr noundef nonnull align 8 dereferenceable(8) %10)
  %100 = load i64, ptr %9, align 8, !tbaa !8
  %101 = add nsw i64 %100, -1
  store i64 %101, ptr %9, align 8, !tbaa !8
  %102 = load i64, ptr %10, align 8, !tbaa !8
  %103 = add nsw i64 %102, -1
  store i64 %103, ptr %10, align 8, !tbaa !8
  %104 = load i64, ptr %9, align 8, !tbaa !8
  %105 = getelementptr inbounds [100000 x i64], ptr @P, i64 0, i64 %104
  %106 = load i64, ptr %10, align 8, !tbaa !8
  %107 = getelementptr inbounds [100000 x i64], ptr @P, i64 0, i64 %106
  call void @_ZSt4swapIxENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 8 dereferenceable(8) %105, ptr noundef nonnull align 8 dereferenceable(8) %107) #7
  %108 = load i64, ptr %9, align 8, !tbaa !8
  %109 = getelementptr inbounds [100000 x i64], ptr @P, i64 0, i64 %108
  %110 = load i64, ptr %109, align 8, !tbaa !8
  %111 = getelementptr inbounds [100000 x i64], ptr @R, i64 0, i64 %110
  %112 = load i64, ptr %10, align 8, !tbaa !8
  %113 = getelementptr inbounds [100000 x i64], ptr @P, i64 0, i64 %112
  %114 = load i64, ptr %113, align 8, !tbaa !8
  %115 = getelementptr inbounds [100000 x i64], ptr @R, i64 0, i64 %114
  call void @_ZSt4swapIxENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 8 dereferenceable(8) %111, ptr noundef nonnull align 8 dereferenceable(8) %115) #7
  %116 = load i64, ptr %9, align 8, !tbaa !8
  call void @_Z3updx(i64 noundef %116)
  %117 = load i64, ptr %10, align 8, !tbaa !8
  call void @_Z3updx(i64 noundef %117)
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  br label %157

118:                                              ; preds = %93
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  %119 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %11)
  %120 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %119, ptr noundef nonnull align 8 dereferenceable(8) %12)
  %121 = load i64, ptr %11, align 8, !tbaa !8
  %122 = add nsw i64 %121, -1
  store i64 %122, ptr %11, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  store i64 0, ptr %13, align 8, !tbaa !8
  br label %123

123:                                              ; preds = %134, %118
  %124 = load i64, ptr %13, align 8, !tbaa !8
  %125 = load i64, ptr %12, align 8, !tbaa !8
  %126 = load i64, ptr @S, align 8, !tbaa !8
  %127 = sdiv i64 %125, %126
  %128 = icmp slt i64 %124, %127
  br i1 %128, label %130, label %129

129:                                              ; preds = %123
  store i32 17, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  br label %137

130:                                              ; preds = %123
  %131 = load i64, ptr %11, align 8, !tbaa !8
  %132 = getelementptr inbounds [100000 x i64], ptr @J, i64 0, i64 %131
  %133 = load i64, ptr %132, align 8, !tbaa !8
  store i64 %133, ptr %11, align 8, !tbaa !8
  br label %134

134:                                              ; preds = %130
  %135 = load i64, ptr %13, align 8, !tbaa !8
  %136 = add nsw i64 %135, 1
  store i64 %136, ptr %13, align 8, !tbaa !8
  br label %123, !llvm.loop !16

137:                                              ; preds = %129
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  store i64 0, ptr %14, align 8, !tbaa !8
  br label %138

138:                                              ; preds = %149, %137
  %139 = load i64, ptr %14, align 8, !tbaa !8
  %140 = load i64, ptr %12, align 8, !tbaa !8
  %141 = load i64, ptr @S, align 8, !tbaa !8
  %142 = srem i64 %140, %141
  %143 = icmp slt i64 %139, %142
  br i1 %143, label %145, label %144

144:                                              ; preds = %138
  store i32 20, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  br label %152

145:                                              ; preds = %138
  %146 = load i64, ptr %11, align 8, !tbaa !8
  %147 = getelementptr inbounds [100000 x i64], ptr @P, i64 0, i64 %146
  %148 = load i64, ptr %147, align 8, !tbaa !8
  store i64 %148, ptr %11, align 8, !tbaa !8
  br label %149

149:                                              ; preds = %145
  %150 = load i64, ptr %14, align 8, !tbaa !8
  %151 = add nsw i64 %150, 1
  store i64 %151, ptr %14, align 8, !tbaa !8
  br label %138, !llvm.loop !17

152:                                              ; preds = %144
  %153 = load i64, ptr %11, align 8, !tbaa !8
  %154 = add nsw i64 %153, 1
  %155 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %154)
  %156 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %155, i8 noundef signext 10)
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  br label %157

157:                                              ; preds = %152, %97
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  br label %158

158:                                              ; preds = %157
  %159 = load i64, ptr %7, align 8, !tbaa !8
  %160 = add nsw i64 %159, 1
  store i64 %160, ptr %7, align 8, !tbaa !8
  br label %88, !llvm.loop !18

161:                                              ; preds = %92
  %162 = load i32, ptr %1, align 4
  ret i32 %162
}

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt4sqrtIxEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i64 noundef) #5

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) #6

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #4 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 norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress 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 = { 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 #7 = { nounwind }

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

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


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"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
@Q = external dso_local global i64, align 8
@S = external dso_local local_unnamed_addr global i64, align 8
@P = external dso_local global [100000 x i64], align 16
@R = external dso_local global [100000 x i64], align 16
@J = external dso_local local_unnamed_addr global [100000 x i64], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z3updx(i64 noundef) local_unnamed_addr #0

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 {
  %1 = alloca i64, align 8
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %7 = getelementptr i8, ptr %6, i64 -24
  %8 = load i64, ptr %7, align 8
  %9 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %8
  %10 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %9, ptr noundef null)
  %11 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %12 = tail 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)
  %13 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %12, ptr noundef nonnull align 8 dereferenceable(8) @Q)
  %14 = load i64, ptr @N, align 8, !tbaa !8
  %15 = tail call noundef double @_ZSt4sqrtIxEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i64 noundef %14)
  %16 = fptosi double %15 to i64
  store i64 %16, ptr @S, align 8, !tbaa !8
  %17 = load i64, ptr @N, align 8, !tbaa !8
  %18 = icmp sgt i64 %17, 0
  br i1 %18, label %.lr.ph, label %.preheader29

.preheader31:                                     ; preds = %.lr.ph
  %19 = icmp sgt i64 %26, 0
  br i1 %19, label %.lr.ph36.preheader, label %.preheader29

.lr.ph36.preheader:                               ; preds = %.preheader31
  %xtraiter = and i64 %26, 3
  %20 = icmp ult i64 %26, 4
  br i1 %20, label %.preheader30.unr-lcssa, label %.lr.ph36.preheader.new

.lr.ph36.preheader.new:                           ; preds = %.lr.ph36.preheader
  %unroll_iter = and i64 %26, 9223372036854775804
  br label %.lr.ph36

.lr.ph:                                           ; preds = %0, %.lr.ph
  %.02834 = phi i64 [ %25, %.lr.ph ], [ 0, %0 ]
  %21 = getelementptr inbounds [100000 x i64], ptr @P, i64 0, i64 %.02834
  %22 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %21)
  %23 = load i64, ptr %21, align 8, !tbaa !8
  %24 = add nsw i64 %23, -1
  store i64 %24, ptr %21, align 8, !tbaa !8
  %25 = add nuw nsw i64 %.02834, 1
  %26 = load i64, ptr @N, align 8, !tbaa !8
  %27 = icmp slt i64 %25, %26
  br i1 %27, label %.lr.ph, label %.preheader31, !llvm.loop !11

.preheader30.unr-lcssa:                           ; preds = %.lr.ph36, %.lr.ph36.preheader
  %.02735.unr = phi i64 [ 0, %.lr.ph36.preheader ], [ %75, %.lr.ph36 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader30, label %.lr.ph36.epil

.lr.ph36.epil:                                    ; preds = %.preheader30.unr-lcssa, %.lr.ph36.epil
  %.02735.epil = phi i64 [ %31, %.lr.ph36.epil ], [ %.02735.unr, %.preheader30.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph36.epil ], [ 0, %.preheader30.unr-lcssa ]
  %28 = getelementptr inbounds [100000 x i64], ptr @P, i64 0, i64 %.02735.epil
  %29 = load i64, ptr %28, align 8, !tbaa !8
  %30 = getelementptr inbounds [100000 x i64], ptr @R, i64 0, i64 %29
  store i64 %.02735.epil, ptr %30, align 8, !tbaa !8
  %31 = add nuw nsw i64 %.02735.epil, 1
  %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 %.preheader30, label %.lr.ph36.epil, !llvm.loop !13

.preheader30:                                     ; preds = %.lr.ph36.epil, %.preheader30.unr-lcssa
  br i1 %19, label %.lr.ph41, label %.preheader29

.lr.ph41:                                         ; preds = %.preheader30
  %32 = load i64, ptr @S, align 8, !tbaa !8
  %33 = icmp sgt i64 %32, 0
  br i1 %33, label %.lr.ph38.us.preheader, label %.lr.ph41.split.preheader

.lr.ph38.us.preheader:                            ; preds = %.lr.ph41
  %xtraiter81 = and i64 %32, 7
  %34 = icmp ult i64 %32, 8
  %unroll_iter85 = and i64 %32, 9223372036854775800
  %lcmp.mod83.not = icmp eq i64 %xtraiter81, 0
  br label %.lr.ph38.us

.lr.ph41.split.preheader:                         ; preds = %.lr.ph41
  %min.iters.check = icmp ult i64 %26, 4
  br i1 %min.iters.check, label %.lr.ph41.split.preheader78, label %vector.ph

.lr.ph41.split.preheader78:                       ; preds = %middle.block, %.lr.ph41.split.preheader
  %.02640.ph = phi i64 [ 0, %.lr.ph41.split.preheader ], [ %n.vec, %middle.block ]
  br label %.lr.ph41.split

vector.ph:                                        ; preds = %.lr.ph41.split.preheader
  %n.vec = and i64 %26, 9223372036854775804
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.ind = phi <2 x i64> [ <i64 0, i64 1>, %vector.ph ], [ %vec.ind.next, %vector.body ]
  %step.add = add <2 x i64> %vec.ind, <i64 2, i64 2>
  %35 = getelementptr inbounds [100000 x i64], ptr @J, i64 0, i64 %index
  %36 = getelementptr inbounds i8, ptr %35, i64 16
  store <2 x i64> %vec.ind, ptr %35, align 16, !tbaa !8
  store <2 x i64> %step.add, ptr %36, align 16, !tbaa !8
  %index.next = add nuw i64 %index, 4
  %vec.ind.next = add <2 x i64> %vec.ind, <i64 4, i64 4>
  %37 = icmp eq i64 %index.next, %n.vec
  br i1 %37, label %middle.block, label %vector.body, !llvm.loop !15

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %26, %n.vec
  br i1 %cmp.n, label %.preheader29, label %.lr.ph41.split.preheader78

.lr.ph38.us:                                      ; preds = %.lr.ph38.us.preheader, %._crit_edge.us
  %.02640.us = phi i64 [ %59, %._crit_edge.us ], [ 0, %.lr.ph38.us.preheader ]
  %38 = getelementptr inbounds [100000 x i64], ptr @J, i64 0, i64 %.02640.us
  br i1 %34, label %._crit_edge.us.unr-lcssa, label %.lr.ph38.us.new

.lr.ph38.us.new:                                  ; preds = %.lr.ph38.us, %.lr.ph38.us.new
  %39 = phi i64 [ %55, %.lr.ph38.us.new ], [ %.02640.us, %.lr.ph38.us ]
  %niter86 = phi i64 [ %niter86.next.7, %.lr.ph38.us.new ], [ 0, %.lr.ph38.us ]
  %40 = getelementptr inbounds [100000 x i64], ptr @P, i64 0, i64 %39
  %41 = load i64, ptr %40, align 8, !tbaa !8
  %42 = getelementptr inbounds [100000 x i64], ptr @P, i64 0, i64 %41
  %43 = load i64, ptr %42, align 8, !tbaa !8
  %44 = getelementptr inbounds [100000 x i64], ptr @P, i64 0, i64 %43
  %45 = load i64, ptr %44, align 8, !tbaa !8
  %46 = getelementptr inbounds [100000 x i64], ptr @P, i64 0, i64 %45
  %47 = load i64, ptr %46, align 8, !tbaa !8
  %48 = getelementptr inbounds [100000 x i64], ptr @P, i64 0, i64 %47
  %49 = load i64, ptr %48, align 8, !tbaa !8
  %50 = getelementptr inbounds [100000 x i64], ptr @P, i64 0, i64 %49
  %51 = load i64, ptr %50, align 8, !tbaa !8
  %52 = getelementptr inbounds [100000 x i64], ptr @P, i64 0, i64 %51
  %53 = load i64, ptr %52, align 8, !tbaa !8
  %54 = getelementptr inbounds [100000 x i64], ptr @P, i64 0, i64 %53
  %55 = load i64, ptr %54, align 8, !tbaa !8
  %niter86.next.7 = add i64 %niter86, 8
  %niter86.ncmp.7 = icmp eq i64 %niter86.next.7, %unroll_iter85
  br i1 %niter86.ncmp.7, label %._crit_edge.us.unr-lcssa, label %.lr.ph38.us.new, !llvm.loop !18

._crit_edge.us.unr-lcssa:                         ; preds = %.lr.ph38.us.new, %.lr.ph38.us
  %.lcssa77.ph = phi i64 [ poison, %.lr.ph38.us ], [ %55, %.lr.ph38.us.new ]
  %.unr = phi i64 [ %.02640.us, %.lr.ph38.us ], [ %55, %.lr.ph38.us.new ]
  br i1 %lcmp.mod83.not, label %._crit_edge.us, label %.epil.preheader

.epil.preheader:                                  ; preds = %._crit_edge.us.unr-lcssa, %.epil.preheader
  %56 = phi i64 [ %58, %.epil.preheader ], [ %.unr, %._crit_edge.us.unr-lcssa ]
  %epil.iter82 = phi i64 [ %epil.iter82.next, %.epil.preheader ], [ 0, %._crit_edge.us.unr-lcssa ]
  %57 = getelementptr inbounds [100000 x i64], ptr @P, i64 0, i64 %56
  %58 = load i64, ptr %57, align 8, !tbaa !8
  %epil.iter82.next = add i64 %epil.iter82, 1
  %epil.iter82.cmp.not = icmp eq i64 %epil.iter82.next, %xtraiter81
  br i1 %epil.iter82.cmp.not, label %._crit_edge.us, label %.epil.preheader, !llvm.loop !19

._crit_edge.us:                                   ; preds = %.epil.preheader, %._crit_edge.us.unr-lcssa
  %.lcssa77 = phi i64 [ %.lcssa77.ph, %._crit_edge.us.unr-lcssa ], [ %58, %.epil.preheader ]
  store i64 %.lcssa77, ptr %38, align 8, !tbaa !8
  %59 = add nuw nsw i64 %.02640.us, 1
  %exitcond60.not = icmp eq i64 %59, %26
  br i1 %exitcond60.not, label %.preheader29, label %.lr.ph38.us, !llvm.loop !20

.lr.ph36:                                         ; preds = %.lr.ph36, %.lr.ph36.preheader.new
  %.02735 = phi i64 [ 0, %.lr.ph36.preheader.new ], [ %75, %.lr.ph36 ]
  %niter = phi i64 [ 0, %.lr.ph36.preheader.new ], [ %niter.next.3, %.lr.ph36 ]
  %60 = getelementptr inbounds [100000 x i64], ptr @P, i64 0, i64 %.02735
  %61 = load i64, ptr %60, align 16, !tbaa !8
  %62 = getelementptr inbounds [100000 x i64], ptr @R, i64 0, i64 %61
  store i64 %.02735, ptr %62, align 8, !tbaa !8
  %63 = or disjoint i64 %.02735, 1
  %64 = getelementptr inbounds [100000 x i64], ptr @P, i64 0, i64 %63
  %65 = load i64, ptr %64, align 8, !tbaa !8
  %66 = getelementptr inbounds [100000 x i64], ptr @R, i64 0, i64 %65
  store i64 %63, ptr %66, align 8, !tbaa !8
  %67 = or disjoint i64 %.02735, 2
  %68 = getelementptr inbounds [100000 x i64], ptr @P, i64 0, i64 %67
  %69 = load i64, ptr %68, align 16, !tbaa !8
  %70 = getelementptr inbounds [100000 x i64], ptr @R, i64 0, i64 %69
  store i64 %67, ptr %70, align 8, !tbaa !8
  %71 = or disjoint i64 %.02735, 3
  %72 = getelementptr inbounds [100000 x i64], ptr @P, i64 0, i64 %71
  %73 = load i64, ptr %72, align 8, !tbaa !8
  %74 = getelementptr inbounds [100000 x i64], ptr @R, i64 0, i64 %73
  store i64 %71, ptr %74, align 8, !tbaa !8
  %75 = add nuw nsw i64 %.02735, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %.preheader30.unr-lcssa, label %.lr.ph36, !llvm.loop !21

.preheader29:                                     ; preds = %.lr.ph41.split, %._crit_edge.us, %middle.block, %0, %.preheader31, %.preheader30
  %76 = load i64, ptr @Q, align 8, !tbaa !8
  %77 = icmp sgt i64 %76, 0
  br i1 %77, label %.lr.ph52, label %._crit_edge53

.lr.ph41.split:                                   ; preds = %.lr.ph41.split.preheader78, %.lr.ph41.split
  %.02640 = phi i64 [ %79, %.lr.ph41.split ], [ %.02640.ph, %.lr.ph41.split.preheader78 ]
  %78 = getelementptr inbounds [100000 x i64], ptr @J, i64 0, i64 %.02640
  store i64 %.02640, ptr %78, align 8, !tbaa !8
  %79 = add nuw nsw i64 %.02640, 1
  %exitcond58.not = icmp eq i64 %79, %26
  br i1 %exitcond58.not, label %.preheader29, label %.lr.ph41.split, !llvm.loop !22

._crit_edge53:                                    ; preds = %160, %.preheader29
  ret i32 0

.lr.ph52:                                         ; preds = %.preheader29, %160
  %.02451 = phi i64 [ %161, %160 ], [ 0, %.preheader29 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #7
  %80 = 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)
  %81 = load i64, ptr %1, align 8, !tbaa !8
  %82 = icmp eq i64 %81, 1
  br i1 %82, label %83, label %102

83:                                               ; preds = %.lr.ph52
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #7
  %84 = 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)
  %85 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %84, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %86 = load i64, ptr %2, align 8, !tbaa !8
  %87 = add nsw i64 %86, -1
  store i64 %87, ptr %2, align 8, !tbaa !8
  %88 = load i64, ptr %3, align 8, !tbaa !8
  %89 = add nsw i64 %88, -1
  store i64 %89, ptr %3, align 8, !tbaa !8
  %90 = getelementptr inbounds [100000 x i64], ptr @P, i64 0, i64 %87
  %91 = getelementptr inbounds [100000 x i64], ptr @P, i64 0, i64 %89
  call void @_ZSt4swapIxENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 8 dereferenceable(8) %90, ptr noundef nonnull align 8 dereferenceable(8) %91) #7
  %92 = load i64, ptr %2, align 8, !tbaa !8
  %93 = getelementptr inbounds [100000 x i64], ptr @P, i64 0, i64 %92
  %94 = load i64, ptr %93, align 8, !tbaa !8
  %95 = getelementptr inbounds [100000 x i64], ptr @R, i64 0, i64 %94
  %96 = load i64, ptr %3, align 8, !tbaa !8
  %97 = getelementptr inbounds [100000 x i64], ptr @P, i64 0, i64 %96
  %98 = load i64, ptr %97, align 8, !tbaa !8
  %99 = getelementptr inbounds [100000 x i64], ptr @R, i64 0, i64 %98
  call void @_ZSt4swapIxENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 8 dereferenceable(8) %95, ptr noundef nonnull align 8 dereferenceable(8) %99) #7
  %100 = load i64, ptr %2, align 8, !tbaa !8
  call void @_Z3updx(i64 noundef %100)
  %101 = load i64, ptr %3, align 8, !tbaa !8
  call void @_Z3updx(i64 noundef %101)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #7
  br label %160

102:                                              ; preds = %.lr.ph52
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #7
  %103 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %104 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %103, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %105 = load i64, ptr %4, align 8, !tbaa !8
  %106 = add nsw i64 %105, -1
  store i64 %106, ptr %4, align 8, !tbaa !8
  %107 = load i64, ptr %5, align 8, !tbaa !8
  %108 = load i64, ptr @S, align 8, !tbaa !8
  %109 = sdiv i64 %107, %108
  %110 = srem i64 %107, %108
  %111 = icmp sgt i64 %109, 0
  br i1 %111, label %.lr.ph43.preheader, label %.preheader

.lr.ph43.preheader:                               ; preds = %102
  %xtraiter87 = and i64 %109, 7
  %112 = icmp ult i64 %109, 8
  br i1 %112, label %..preheader_crit_edge.unr-lcssa, label %.lr.ph43.preheader.new

.lr.ph43.preheader.new:                           ; preds = %.lr.ph43.preheader
  %unroll_iter92 = and i64 %109, 9223372036854775800
  br label %.lr.ph43

..preheader_crit_edge.unr-lcssa:                  ; preds = %.lr.ph43, %.lr.ph43.preheader
  %.lcssa.ph = phi i64 [ poison, %.lr.ph43.preheader ], [ %134, %.lr.ph43 ]
  %.unr89 = phi i64 [ %106, %.lr.ph43.preheader ], [ %134, %.lr.ph43 ]
  %lcmp.mod90.not = icmp eq i64 %xtraiter87, 0
  br i1 %lcmp.mod90.not, label %..preheader_crit_edge, label %.lr.ph43.epil

.lr.ph43.epil:                                    ; preds = %..preheader_crit_edge.unr-lcssa, %.lr.ph43.epil
  %113 = phi i64 [ %115, %.lr.ph43.epil ], [ %.unr89, %..preheader_crit_edge.unr-lcssa ]
  %epil.iter88 = phi i64 [ %epil.iter88.next, %.lr.ph43.epil ], [ 0, %..preheader_crit_edge.unr-lcssa ]
  %114 = getelementptr inbounds [100000 x i64], ptr @J, i64 0, i64 %113
  %115 = load i64, ptr %114, align 8, !tbaa !8
  %epil.iter88.next = add i64 %epil.iter88, 1
  %epil.iter88.cmp.not = icmp eq i64 %epil.iter88.next, %xtraiter87
  br i1 %epil.iter88.cmp.not, label %..preheader_crit_edge, label %.lr.ph43.epil, !llvm.loop !23

..preheader_crit_edge:                            ; preds = %.lr.ph43.epil, %..preheader_crit_edge.unr-lcssa
  %.lcssa = phi i64 [ %.lcssa.ph, %..preheader_crit_edge.unr-lcssa ], [ %115, %.lr.ph43.epil ]
  store i64 %.lcssa, ptr %4, align 8, !tbaa !8
  br label %.preheader

.preheader:                                       ; preds = %..preheader_crit_edge, %102
  %.promoted47 = phi i64 [ %.lcssa, %..preheader_crit_edge ], [ %106, %102 ]
  %116 = icmp sgt i64 %110, 0
  br i1 %116, label %.lr.ph49.preheader, label %138

.lr.ph49.preheader:                               ; preds = %.preheader
  %xtraiter94 = and i64 %110, 7
  %117 = icmp ult i64 %110, 8
  br i1 %117, label %._crit_edge.unr-lcssa, label %.lr.ph49.preheader.new

.lr.ph49.preheader.new:                           ; preds = %.lr.ph49.preheader
  %unroll_iter99 = and i64 %110, 9223372036854775800
  br label %.lr.ph49

.lr.ph43:                                         ; preds = %.lr.ph43, %.lr.ph43.preheader.new
  %118 = phi i64 [ %106, %.lr.ph43.preheader.new ], [ %134, %.lr.ph43 ]
  %niter93 = phi i64 [ 0, %.lr.ph43.preheader.new ], [ %niter93.next.7, %.lr.ph43 ]
  %119 = getelementptr inbounds [100000 x i64], ptr @J, i64 0, i64 %118
  %120 = load i64, ptr %119, align 8, !tbaa !8
  %121 = getelementptr inbounds [100000 x i64], ptr @J, i64 0, i64 %120
  %122 = load i64, ptr %121, align 8, !tbaa !8
  %123 = getelementptr inbounds [100000 x i64], ptr @J, i64 0, i64 %122
  %124 = load i64, ptr %123, align 8, !tbaa !8
  %125 = getelementptr inbounds [100000 x i64], ptr @J, i64 0, i64 %124
  %126 = load i64, ptr %125, align 8, !tbaa !8
  %127 = getelementptr inbounds [100000 x i64], ptr @J, i64 0, i64 %126
  %128 = load i64, ptr %127, align 8, !tbaa !8
  %129 = getelementptr inbounds [100000 x i64], ptr @J, i64 0, i64 %128
  %130 = load i64, ptr %129, align 8, !tbaa !8
  %131 = getelementptr inbounds [100000 x i64], ptr @J, i64 0, i64 %130
  %132 = load i64, ptr %131, align 8, !tbaa !8
  %133 = getelementptr inbounds [100000 x i64], ptr @J, i64 0, i64 %132
  %134 = load i64, ptr %133, align 8, !tbaa !8
  %niter93.next.7 = add i64 %niter93, 8
  %niter93.ncmp.7 = icmp eq i64 %niter93.next.7, %unroll_iter92
  br i1 %niter93.ncmp.7, label %..preheader_crit_edge.unr-lcssa, label %.lr.ph43, !llvm.loop !24

._crit_edge.unr-lcssa:                            ; preds = %.lr.ph49, %.lr.ph49.preheader
  %.lcssa76.ph = phi i64 [ poison, %.lr.ph49.preheader ], [ %159, %.lr.ph49 ]
  %.unr96 = phi i64 [ %.promoted47, %.lr.ph49.preheader ], [ %159, %.lr.ph49 ]
  %lcmp.mod97.not = icmp eq i64 %xtraiter94, 0
  br i1 %lcmp.mod97.not, label %._crit_edge, label %.lr.ph49.epil

.lr.ph49.epil:                                    ; preds = %._crit_edge.unr-lcssa, %.lr.ph49.epil
  %135 = phi i64 [ %137, %.lr.ph49.epil ], [ %.unr96, %._crit_edge.unr-lcssa ]
  %epil.iter95 = phi i64 [ %epil.iter95.next, %.lr.ph49.epil ], [ 0, %._crit_edge.unr-lcssa ]
  %136 = getelementptr inbounds [100000 x i64], ptr @P, i64 0, i64 %135
  %137 = load i64, ptr %136, align 8, !tbaa !8
  %epil.iter95.next = add i64 %epil.iter95, 1
  %epil.iter95.cmp.not = icmp eq i64 %epil.iter95.next, %xtraiter94
  br i1 %epil.iter95.cmp.not, label %._crit_edge, label %.lr.ph49.epil, !llvm.loop !25

._crit_edge:                                      ; preds = %.lr.ph49.epil, %._crit_edge.unr-lcssa
  %.lcssa76 = phi i64 [ %.lcssa76.ph, %._crit_edge.unr-lcssa ], [ %137, %.lr.ph49.epil ]
  store i64 %.lcssa76, ptr %4, align 8, !tbaa !8
  br label %138

138:                                              ; preds = %._crit_edge, %.preheader
  %139 = phi i64 [ %.lcssa76, %._crit_edge ], [ %.promoted47, %.preheader ]
  %140 = add nsw i64 %139, 1
  %141 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %140)
  %142 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %141, i8 noundef signext 10)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  br label %160

.lr.ph49:                                         ; preds = %.lr.ph49, %.lr.ph49.preheader.new
  %143 = phi i64 [ %.promoted47, %.lr.ph49.preheader.new ], [ %159, %.lr.ph49 ]
  %niter100 = phi i64 [ 0, %.lr.ph49.preheader.new ], [ %niter100.next.7, %.lr.ph49 ]
  %144 = getelementptr inbounds [100000 x i64], ptr @P, i64 0, i64 %143
  %145 = load i64, ptr %144, align 8, !tbaa !8
  %146 = getelementptr inbounds [100000 x i64], ptr @P, i64 0, i64 %145
  %147 = load i64, ptr %146, align 8, !tbaa !8
  %148 = getelementptr inbounds [100000 x i64], ptr @P, i64 0, i64 %147
  %149 = load i64, ptr %148, align 8, !tbaa !8
  %150 = getelementptr inbounds [100000 x i64], ptr @P, i64 0, i64 %149
  %151 = load i64, ptr %150, align 8, !tbaa !8
  %152 = getelementptr inbounds [100000 x i64], ptr @P, i64 0, i64 %151
  %153 = load i64, ptr %152, align 8, !tbaa !8
  %154 = getelementptr inbounds [100000 x i64], ptr @P, i64 0, i64 %153
  %155 = load i64, ptr %154, align 8, !tbaa !8
  %156 = getelementptr inbounds [100000 x i64], ptr @P, i64 0, i64 %155
  %157 = load i64, ptr %156, align 8, !tbaa !8
  %158 = getelementptr inbounds [100000 x i64], ptr @P, i64 0, i64 %157
  %159 = load i64, ptr %158, align 8, !tbaa !8
  %niter100.next.7 = add i64 %niter100, 8
  %niter100.ncmp.7 = icmp eq i64 %niter100.next.7, %unroll_iter99
  br i1 %niter100.ncmp.7, label %._crit_edge.unr-lcssa, label %.lr.ph49, !llvm.loop !26

160:                                              ; preds = %138, %83
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #7
  %161 = add nuw nsw i64 %.02451, 1
  %162 = load i64, ptr @Q, align 8, !tbaa !8
  %163 = icmp slt i64 %161, %162
  br i1 %163, label %.lr.ph52, label %._crit_edge53, !llvm.loop !27
}

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt4sqrtIxEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i64 noundef) local_unnamed_addr #5

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) local_unnamed_addr #6

; 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 #4 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 norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress 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 = { 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 #7 = { nounwind }

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

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


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