; LLVM IR from VastoLorde95/Competitive-Programming :: Codeforces/305 Division 2/Problem C (C)

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

@m = external dso_local global i64, align 8
@h1 = external dso_local global i64, align 8
@a1 = external dso_local global i64, align 8
@x1 = external dso_local global i64, align 8
@Y1 = external dso_local global i64, align 8
@h2 = external dso_local global i64, align 8
@a2 = external dso_local global i64, align 8
@x2 = external dso_local global i64, align 8
@y2 = external dso_local global i64, align 8
@t = external dso_local global [2000001 x i64], align 16
@a = external dso_local global [1000001 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 noundef i64 @_Z3getxx(i64 noundef, i64 noundef) #0

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

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

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

; 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 i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i64, align 8
  %7 = alloca i32, align 4
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %11 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @m)
  %12 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef nonnull align 8 dereferenceable(8) @h1)
  %13 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %12, ptr noundef nonnull align 8 dereferenceable(8) @a1)
  %14 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %13, ptr noundef nonnull align 8 dereferenceable(8) @x1)
  %15 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %14, ptr noundef nonnull align 8 dereferenceable(8) @Y1)
  %16 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %15, ptr noundef nonnull align 8 dereferenceable(8) @h2)
  %17 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %16, ptr noundef nonnull align 8 dereferenceable(8) @a2)
  %18 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %17, ptr noundef nonnull align 8 dereferenceable(8) @x2)
  %19 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %18, ptr noundef nonnull align 8 dereferenceable(8) @y2)
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #7
  %20 = load i64, ptr @h1, align 8, !tbaa !5
  %21 = load i64, ptr @a1, align 8, !tbaa !5
  %22 = call noundef i64 @_Z3getxx(i64 noundef %20, i64 noundef %21)
  store i64 %22, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #7
  %23 = load i64, ptr @a1, align 8, !tbaa !5
  %24 = call noundef i64 @_Z5cyclex(i64 noundef %23)
  store i64 %24, ptr %3, align 8, !tbaa !5
  %25 = load i64, ptr @h2, align 8, !tbaa !5
  store i64 %25, ptr @t, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  store i32 0, ptr %4, align 4, !tbaa !9
  br label %26

26:                                               ; preds = %37, %0
  %27 = load i32, ptr %4, align 4, !tbaa !9
  %28 = sext i32 %27 to i64
  %29 = load i64, ptr @m, align 8, !tbaa !5
  %30 = mul nsw i64 2, %29
  %31 = icmp sle i64 %28, %30
  br i1 %31, label %33, label %32

32:                                               ; preds = %26
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  br label %40

33:                                               ; preds = %26
  %34 = load i32, ptr %4, align 4, !tbaa !9
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [1000001 x i64], ptr @a, i64 0, i64 %35
  store i64 1000000000, ptr %36, align 8, !tbaa !5
  br label %37

37:                                               ; preds = %33
  %38 = load i32, ptr %4, align 4, !tbaa !9
  %39 = add nsw i32 %38, 1
  store i32 %39, ptr %4, align 4, !tbaa !9
  br label %26, !llvm.loop !11

40:                                               ; preds = %32
  %41 = load i64, ptr @h2, align 8, !tbaa !5
  %42 = getelementptr inbounds [1000001 x i64], ptr @a, i64 0, i64 %41
  store i64 0, ptr %42, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  store i32 1, ptr %5, align 4, !tbaa !9
  br label %43

43:                                               ; preds = %79, %40
  %44 = load i32, ptr %5, align 4, !tbaa !9
  %45 = sext i32 %44 to i64
  %46 = load i64, ptr @m, align 8, !tbaa !5
  %47 = mul nsw i64 2, %46
  %48 = icmp sle i64 %45, %47
  br i1 %48, label %50, label %49

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

50:                                               ; preds = %43
  %51 = load i32, ptr %5, align 4, !tbaa !9
  %52 = sub nsw i32 %51, 1
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [2000001 x i64], ptr @t, i64 0, i64 %53
  %55 = load i64, ptr %54, align 8, !tbaa !5
  %56 = load i64, ptr @x2, align 8, !tbaa !5
  %57 = mul nsw i64 %55, %56
  %58 = load i64, ptr @y2, align 8, !tbaa !5
  %59 = add nsw i64 %57, %58
  %60 = load i64, ptr @m, align 8, !tbaa !5
  %61 = srem i64 %59, %60
  %62 = load i32, ptr %5, align 4, !tbaa !9
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [2000001 x i64], ptr @t, i64 0, i64 %63
  store i64 %61, ptr %64, align 8, !tbaa !5
  %65 = load i32, ptr %5, align 4, !tbaa !9
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [2000001 x i64], ptr @t, i64 0, i64 %66
  %68 = load i64, ptr %67, align 8, !tbaa !5
  %69 = getelementptr inbounds [1000001 x i64], ptr @a, i64 0, i64 %68
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  %70 = load i32, ptr %5, align 4, !tbaa !9
  %71 = sext i32 %70 to i64
  store i64 %71, ptr %6, align 8, !tbaa !5
  %72 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %69, ptr noundef nonnull align 8 dereferenceable(8) %6)
  %73 = load i64, ptr %72, align 8, !tbaa !5
  %74 = load i32, ptr %5, align 4, !tbaa !9
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [2000001 x i64], ptr @t, i64 0, i64 %75
  %77 = load i64, ptr %76, align 8, !tbaa !5
  %78 = getelementptr inbounds [1000001 x i64], ptr @a, i64 0, i64 %77
  store i64 %73, ptr %78, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  br label %79

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

82:                                               ; preds = %49
  %83 = load i64, ptr %2, align 8, !tbaa !5
  %84 = icmp eq i64 %83, -1
  br i1 %84, label %85, label %88

85:                                               ; preds = %82
  %86 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef -1)
  %87 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %86, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %7, align 4
  br label %144

88:                                               ; preds = %82
  %89 = load i64, ptr %2, align 8, !tbaa !5
  %90 = getelementptr inbounds [2000001 x i64], ptr @t, i64 0, i64 %89
  %91 = load i64, ptr %90, align 8, !tbaa !5
  %92 = load i64, ptr @a2, align 8, !tbaa !5
  %93 = icmp eq i64 %91, %92
  br i1 %93, label %94, label %98

94:                                               ; preds = %88
  %95 = load i64, ptr %2, align 8, !tbaa !5
  %96 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %95)
  %97 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %96, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %7, align 4
  br label %144

98:                                               ; preds = %88
  %99 = load i64, ptr %3, align 8, !tbaa !5
  %100 = icmp eq i64 %99, -1
  br i1 %100, label %101, label %104

101:                                              ; preds = %98
  %102 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef -1)
  %103 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %102, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %7, align 4
  br label %144

104:                                              ; preds = %98
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  %105 = load i64, ptr %2, align 8, !tbaa !5
  store i64 %105, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  %106 = load i64, ptr %2, align 8, !tbaa !5
  store i64 %106, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  store i32 1, ptr %10, align 4, !tbaa !9
  br label %107

107:                                              ; preds = %135, %104
  %108 = load i32, ptr %10, align 4, !tbaa !9
  %109 = sext i32 %108 to i64
  %110 = load i64, ptr @m, align 8, !tbaa !5
  %111 = icmp sle i64 %109, %110
  br i1 %111, label %113, label %112

112:                                              ; preds = %107
  store i32 8, ptr %7, align 4
  br label %138

113:                                              ; preds = %107
  %114 = load i64, ptr %3, align 8, !tbaa !5
  %115 = load i64, ptr %8, align 8, !tbaa !5
  %116 = add nsw i64 %115, %114
  store i64 %116, ptr %8, align 8, !tbaa !5
  %117 = load i64, ptr %3, align 8, !tbaa !5
  %118 = load i64, ptr %9, align 8, !tbaa !5
  %119 = add nsw i64 %118, %117
  store i64 %119, ptr %9, align 8, !tbaa !5
  %120 = load i64, ptr %9, align 8, !tbaa !5
  %121 = getelementptr inbounds [2000001 x i64], ptr @t, i64 0, i64 %120
  %122 = load i64, ptr %121, align 8, !tbaa !5
  %123 = load i64, ptr @a2, align 8, !tbaa !5
  %124 = icmp eq i64 %122, %123
  br i1 %124, label %125, label %129

125:                                              ; preds = %113
  %126 = load i64, ptr %8, align 8, !tbaa !5
  %127 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %126)
  %128 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %127, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %7, align 4
  br label %138

129:                                              ; preds = %113
  %130 = load i64, ptr %9, align 8, !tbaa !5
  %131 = getelementptr inbounds [2000001 x i64], ptr @t, i64 0, i64 %130
  %132 = load i64, ptr %131, align 8, !tbaa !5
  %133 = getelementptr inbounds [1000001 x i64], ptr @a, i64 0, i64 %132
  %134 = load i64, ptr %133, align 8, !tbaa !5
  store i64 %134, ptr %9, align 8, !tbaa !5
  br label %135

135:                                              ; preds = %129
  %136 = load i32, ptr %10, align 4, !tbaa !9
  %137 = add nsw i32 %136, 1
  store i32 %137, ptr %10, align 4, !tbaa !9
  br label %107, !llvm.loop !14

138:                                              ; preds = %125, %112
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  %139 = load i32, ptr %7, align 4
  switch i32 %139, label %143 [
    i32 8, label %140
  ]

140:                                              ; preds = %138
  %141 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef -1)
  %142 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %141, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %7, align 4
  br label %143

143:                                              ; preds = %140, %138
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  br label %144

144:                                              ; preds = %143, %101, %94, %85
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #7
  %145 = load i32, ptr %1, align 4
  ret i32 %145
}

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

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

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #5

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

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #3 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 = { 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 = { 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 #5 = { "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 = !{!"long long", !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}


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

@m = external dso_local global i64, align 8
@h1 = external dso_local global i64, align 8
@a1 = external dso_local global i64, align 8
@x1 = external dso_local global i64, align 8
@Y1 = external dso_local global i64, align 8
@h2 = external dso_local global i64, align 8
@a2 = external dso_local global i64, align 8
@x2 = external dso_local global i64, align 8
@y2 = external dso_local global i64, align 8
@t = external dso_local local_unnamed_addr global [2000001 x i64], align 16
@a = external dso_local global [1000001 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 noundef i64 @_Z3getxx(i64 noundef, i64 noundef) local_unnamed_addr #0

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

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 {
  %1 = alloca i64, align 8
  %2 = 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) @m)
  %3 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %2, ptr noundef nonnull align 8 dereferenceable(8) @h1)
  %4 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef nonnull align 8 dereferenceable(8) @a1)
  %5 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %4, ptr noundef nonnull align 8 dereferenceable(8) @x1)
  %6 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 8 dereferenceable(8) @Y1)
  %7 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %6, ptr noundef nonnull align 8 dereferenceable(8) @h2)
  %8 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %7, ptr noundef nonnull align 8 dereferenceable(8) @a2)
  %9 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %8, ptr noundef nonnull align 8 dereferenceable(8) @x2)
  %10 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef nonnull align 8 dereferenceable(8) @y2)
  %11 = load i64, ptr @h1, align 8, !tbaa !5
  %12 = load i64, ptr @a1, align 8, !tbaa !5
  %13 = tail call noundef i64 @_Z3getxx(i64 noundef %11, i64 noundef %12)
  %14 = load i64, ptr @a1, align 8, !tbaa !5
  %15 = tail call noundef i64 @_Z5cyclex(i64 noundef %14)
  %16 = load i64, ptr @h2, align 8, !tbaa !5
  store i64 %16, ptr @t, align 16, !tbaa !5
  %17 = load i64, ptr @m, align 8, !tbaa !5
  %.not41 = icmp slt i64 %17, 0
  br i1 %.not41, label %._crit_edge.thread, label %.lr.ph.preheader

._crit_edge.thread:                               ; preds = %0
  %18 = getelementptr inbounds [1000001 x i64], ptr @a, i64 0, i64 %16
  store i64 0, ptr %18, align 8, !tbaa !5
  br label %._crit_edge47

.lr.ph.preheader:                                 ; preds = %0
  %19 = shl nuw i64 %17, 1
  %20 = or disjoint i64 %19, 1
  %smax = tail call i64 @llvm.smax.i64(i64 %20, i64 1)
  %min.iters.check = icmp slt i64 %20, 4
  br i1 %min.iters.check, label %.lr.ph.preheader69, label %vector.ph

.lr.ph.preheader69:                               ; preds = %vector.body, %.lr.ph.preheader
  %indvars.iv.ph = phi i64 [ 0, %.lr.ph.preheader ], [ %n.vec, %vector.body ]
  br label %.lr.ph

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

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %21 = getelementptr inbounds [1000001 x i64], ptr @a, i64 0, i64 %index
  %22 = getelementptr inbounds i8, ptr %21, i64 16
  store <2 x i64> <i64 1000000000, i64 1000000000>, ptr %21, align 16, !tbaa !5
  store <2 x i64> <i64 1000000000, i64 1000000000>, ptr %22, align 16, !tbaa !5
  %index.next = add nuw i64 %index, 4
  %23 = icmp eq i64 %index.next, %n.vec
  br i1 %23, label %.lr.ph.preheader69, label %vector.body, !llvm.loop !9

._crit_edge:                                      ; preds = %.lr.ph
  %24 = getelementptr inbounds [1000001 x i64], ptr @a, i64 0, i64 %16
  store i64 0, ptr %24, align 8, !tbaa !5
  %.not3843 = icmp eq i64 %17, 0
  br i1 %.not3843, label %._crit_edge47, label %.lr.ph46

.lr.ph:                                           ; preds = %.lr.ph.preheader69, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ %indvars.iv.ph, %.lr.ph.preheader69 ]
  %25 = getelementptr inbounds [1000001 x i64], ptr @a, i64 0, i64 %indvars.iv
  store i64 1000000000, ptr %25, align 8, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond = icmp eq i64 %indvars.iv.next, %smax
  br i1 %exitcond, label %._crit_edge, label %.lr.ph, !llvm.loop !13

._crit_edge47:                                    ; preds = %.lr.ph46, %._crit_edge.thread, %._crit_edge
  %.lcssa40 = phi i64 [ %17, %._crit_edge ], [ %17, %._crit_edge.thread ], [ %40, %.lr.ph46 ]
  %26 = icmp eq i64 %13, -1
  br i1 %26, label %42, label %44

.lr.ph46:                                         ; preds = %._crit_edge, %.lr.ph46
  %27 = phi i64 [ %38, %.lr.ph46 ], [ %16, %._crit_edge ]
  %indvars.iv56 = phi i64 [ %indvars.iv.next57, %.lr.ph46 ], [ 1, %._crit_edge ]
  %28 = phi i64 [ %40, %.lr.ph46 ], [ %17, %._crit_edge ]
  %29 = load i64, ptr @x2, align 8, !tbaa !5
  %30 = mul nsw i64 %29, %27
  %31 = load i64, ptr @y2, align 8, !tbaa !5
  %32 = add nsw i64 %30, %31
  %33 = srem i64 %32, %28
  %34 = getelementptr inbounds [2000001 x i64], ptr @t, i64 0, i64 %indvars.iv56
  store i64 %33, ptr %34, align 8, !tbaa !5
  %35 = getelementptr inbounds [1000001 x i64], ptr @a, i64 0, i64 %33
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #8
  store i64 %indvars.iv56, ptr %1, align 8, !tbaa !5
  %36 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %35, ptr noundef nonnull align 8 dereferenceable(8) %1)
  %37 = load i64, ptr %36, align 8, !tbaa !5
  %38 = load i64, ptr %34, align 8, !tbaa !5
  %39 = getelementptr inbounds [1000001 x i64], ptr @a, i64 0, i64 %38
  store i64 %37, ptr %39, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #8
  %indvars.iv.next57 = add nuw nsw i64 %indvars.iv56, 1
  %40 = load i64, ptr @m, align 8, !tbaa !5
  %41 = shl nsw i64 %40, 1
  %.not38.not = icmp sgt i64 %41, %indvars.iv56
  br i1 %.not38.not, label %.lr.ph46, label %._crit_edge47, !llvm.loop !14

42:                                               ; preds = %._crit_edge47
  %43 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef -1)
  br label %66

44:                                               ; preds = %._crit_edge47
  %45 = getelementptr inbounds [2000001 x i64], ptr @t, i64 0, i64 %13
  %46 = load i64, ptr %45, align 8, !tbaa !5
  %47 = load i64, ptr @a2, align 8, !tbaa !5
  %48 = icmp eq i64 %46, %47
  br i1 %48, label %49, label %51

49:                                               ; preds = %44
  %50 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %13)
  br label %66

51:                                               ; preds = %44
  %52 = icmp eq i64 %15, -1
  br i1 %52, label %53, label %.preheader

.preheader:                                       ; preds = %51
  %.not3948 = icmp slt i64 %.lcssa40, 1
  br i1 %.not3948, label %.critedge, label %.lr.ph52

53:                                               ; preds = %51
  %54 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef -1)
  br label %66

.lr.ph52:                                         ; preds = %.preheader, %62
  %indvars.iv59 = phi i64 [ %indvars.iv.next60, %62 ], [ 1, %.preheader ]
  %.02750 = phi i64 [ %64, %62 ], [ %13, %.preheader ]
  %.02849 = phi i64 [ %55, %62 ], [ %13, %.preheader ]
  %55 = add nsw i64 %.02849, %15
  %56 = add nsw i64 %.02750, %15
  %57 = getelementptr inbounds [2000001 x i64], ptr @t, i64 0, i64 %56
  %58 = load i64, ptr %57, align 8, !tbaa !5
  %59 = icmp eq i64 %58, %47
  br i1 %59, label %60, label %62

60:                                               ; preds = %.lr.ph52
  %61 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %55)
  br label %66

62:                                               ; preds = %.lr.ph52
  %63 = getelementptr inbounds [1000001 x i64], ptr @a, i64 0, i64 %58
  %64 = load i64, ptr %63, align 8, !tbaa !5
  %indvars.iv.next60 = add nuw nsw i64 %indvars.iv59, 1
  %.not39.not = icmp sgt i64 %.lcssa40, %indvars.iv59
  br i1 %.not39.not, label %.lr.ph52, label %.critedge, !llvm.loop !15

.critedge:                                        ; preds = %62, %.preheader
  %65 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef -1)
  br label %66

66:                                               ; preds = %60, %.critedge, %53, %49, %42
  %.sink = phi ptr [ %61, %60 ], [ %65, %.critedge ], [ %54, %53 ], [ %50, %49 ], [ %43, %42 ]
  %67 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %.sink, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  ret i32 0
}

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

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

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #5

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #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 #3 align 2

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

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 = { 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 = { 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 #5 = { "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 = { 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 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10, !12, !11}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}


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