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

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

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #0 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)) #1

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

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #4 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca i32, align 4
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #6
  %15 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %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) %3)
  %17 = load i64, ptr %2, align 8, !tbaa !5
  %18 = icmp sle i64 %17, 59
  br i1 %18, label %19, label %29

19:                                               ; preds = %0
  %20 = load i64, ptr %2, align 8, !tbaa !5
  %21 = shl i64 1, %20
  %22 = load i64, ptr %3, align 8, !tbaa !5
  %23 = icmp slt i64 %21, %22
  br i1 %23, label %24, label %29

24:                                               ; preds = %19
  %25 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 1)
  %26 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %25, i8 noundef signext 32)
  %27 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %26, i32 noundef 1)
  %28 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %27, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %4, align 4
  br label %126

29:                                               ; preds = %19, %0
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  %30 = load i64, ptr %2, align 8, !tbaa !5
  %31 = call noundef i64 @_Z4fastxxx(i64 noundef 2, i64 noundef %30, i64 noundef 1000003)
  store i64 %31, ptr %6, align 8, !tbaa !5
  %32 = load i64, ptr %6, align 8, !tbaa !5
  %33 = load i64, ptr %3, align 8, !tbaa !5
  %34 = sub nsw i64 %33, 1
  %35 = call noundef i64 @_Z4fastxxx(i64 noundef %32, i64 noundef %34, i64 noundef 1000003)
  store i64 %35, ptr %6, align 8, !tbaa !5
  store i64 1, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %36 = load i64, ptr %3, align 8, !tbaa !5
  %37 = sub nsw i64 %36, 1
  %38 = sdiv i64 %37, 1000003
  store i64 %38, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %39 = load i64, ptr %3, align 8, !tbaa !5
  %40 = sub nsw i64 %39, 1
  %41 = srem i64 %40, 1000003
  store i64 %41, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %42 = load i64, ptr %2, align 8, !tbaa !5
  %43 = call noundef i64 @_Z4fastxxx(i64 noundef 2, i64 noundef %42, i64 noundef 1000003)
  store i64 %43, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 1, ptr %10, align 4, !tbaa !9
  br label %44

44:                                               ; preds = %60, %29
  %45 = load i32, ptr %10, align 4, !tbaa !9
  %46 = sext i32 %45 to i64
  %47 = icmp sle i64 %46, 1000003
  br i1 %47, label %49, label %48

48:                                               ; preds = %44
  store i32 2, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %63

49:                                               ; preds = %44
  %50 = load i64, ptr %9, align 8, !tbaa !5
  %51 = load i32, ptr %10, align 4, !tbaa !9
  %52 = sext i32 %51 to i64
  %53 = sub nsw i64 %50, %52
  %54 = add nsw i64 %53, 1000003
  %55 = srem i64 %54, 1000003
  %56 = load i64, ptr %5, align 8, !tbaa !5
  %57 = mul nsw i64 %56, %55
  store i64 %57, ptr %5, align 8, !tbaa !5
  %58 = load i64, ptr %5, align 8, !tbaa !5
  %59 = srem i64 %58, 1000003
  store i64 %59, ptr %5, align 8, !tbaa !5
  br label %60

60:                                               ; preds = %49
  %61 = load i32, ptr %10, align 4, !tbaa !9
  %62 = add nsw i32 %61, 1
  store i32 %62, ptr %10, align 4, !tbaa !9
  br label %44, !llvm.loop !11

63:                                               ; preds = %48
  %64 = load i64, ptr %5, align 8, !tbaa !5
  %65 = load i64, ptr %7, align 8, !tbaa !5
  %66 = call noundef i64 @_Z4fastxxx(i64 noundef %64, i64 noundef %65, i64 noundef 1000003)
  store i64 %66, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 1, ptr %11, align 4, !tbaa !9
  br label %67

67:                                               ; preds = %84, %63
  %68 = load i32, ptr %11, align 4, !tbaa !9
  %69 = sext i32 %68 to i64
  %70 = load i64, ptr %8, align 8, !tbaa !5
  %71 = icmp sle i64 %69, %70
  br i1 %71, label %73, label %72

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

73:                                               ; preds = %67
  %74 = load i64, ptr %9, align 8, !tbaa !5
  %75 = load i32, ptr %11, align 4, !tbaa !9
  %76 = sext i32 %75 to i64
  %77 = sub nsw i64 %74, %76
  %78 = add nsw i64 %77, 1000003
  %79 = srem i64 %78, 1000003
  %80 = load i64, ptr %5, align 8, !tbaa !5
  %81 = mul nsw i64 %80, %79
  store i64 %81, ptr %5, align 8, !tbaa !5
  %82 = load i64, ptr %5, align 8, !tbaa !5
  %83 = srem i64 %82, 1000003
  store i64 %83, ptr %5, align 8, !tbaa !5
  br label %84

84:                                               ; preds = %73
  %85 = load i32, ptr %11, align 4, !tbaa !9
  %86 = add nsw i32 %85, 1
  store i32 %86, ptr %11, align 4, !tbaa !9
  br label %67, !llvm.loop !13

87:                                               ; preds = %72
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  store i64 0, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %88 = load i64, ptr %3, align 8, !tbaa !5
  %89 = sub nsw i64 %88, 1
  store i64 %89, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  store i64 2, ptr %14, align 8, !tbaa !5
  br label %90

90:                                               ; preds = %94, %87
  %91 = load i64, ptr %14, align 8, !tbaa !5
  %92 = load i64, ptr %13, align 8, !tbaa !5
  %93 = icmp sle i64 %91, %92
  br i1 %93, label %94, label %102

94:                                               ; preds = %90
  %95 = load i64, ptr %13, align 8, !tbaa !5
  %96 = load i64, ptr %14, align 8, !tbaa !5
  %97 = sdiv i64 %95, %96
  %98 = load i64, ptr %12, align 8, !tbaa !5
  %99 = add nsw i64 %98, %97
  store i64 %99, ptr %12, align 8, !tbaa !5
  %100 = load i64, ptr %14, align 8, !tbaa !5
  %101 = shl i64 %100, 1
  store i64 %101, ptr %14, align 8, !tbaa !5
  br label %90, !llvm.loop !14

102:                                              ; preds = %90
  %103 = load i64, ptr %5, align 8, !tbaa !5
  %104 = load i64, ptr %12, align 8, !tbaa !5
  %105 = call noundef i64 @_Z4fastxxx(i64 noundef 2, i64 noundef %104, i64 noundef 1000003)
  %106 = call noundef i64 @_Z4fastxxx(i64 noundef %105, i64 noundef 1000001, i64 noundef 1000003)
  %107 = mul nsw i64 %103, %106
  %108 = srem i64 %107, 1000003
  store i64 %108, ptr %5, align 8, !tbaa !5
  %109 = load i64, ptr %6, align 8, !tbaa !5
  %110 = load i64, ptr %12, align 8, !tbaa !5
  %111 = call noundef i64 @_Z4fastxxx(i64 noundef 2, i64 noundef %110, i64 noundef 1000003)
  %112 = call noundef i64 @_Z4fastxxx(i64 noundef %111, i64 noundef 1000001, i64 noundef 1000003)
  %113 = mul nsw i64 %109, %112
  %114 = srem i64 %113, 1000003
  store i64 %114, ptr %6, align 8, !tbaa !5
  %115 = load i64, ptr %6, align 8, !tbaa !5
  %116 = load i64, ptr %5, align 8, !tbaa !5
  %117 = sub nsw i64 %115, %116
  %118 = add nsw i64 %117, 1000003
  %119 = srem i64 %118, 1000003
  store i64 %119, ptr %5, align 8, !tbaa !5
  %120 = load i64, ptr %5, align 8, !tbaa !5
  %121 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %120)
  %122 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %121, i8 noundef signext 32)
  %123 = load i64, ptr %6, align 8, !tbaa !5
  %124 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %122, i64 noundef %123)
  %125 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %124, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  br label %126

126:                                              ; preds = %102, %24
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #6
  %127 = load i32, ptr %1, align 4
  ret i32 %127
}

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

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

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 @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #0 align 2

attributes #0 = { 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 #1 = { 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 #2 = { 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 #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #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 = { 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_ostream" = type { ptr, %"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_istream" = type { ptr, i64, %"class.std::basic_ios" }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8

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

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

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #4 {
  %1 = alloca i64, align 8
  %2 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #6
  %3 = 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)
  %4 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %5 = load i64, ptr %1, align 8, !tbaa !5
  %6 = icmp slt i64 %5, 60
  br i1 %6, label %7, label %15

7:                                                ; preds = %0
  %8 = shl nuw nsw i64 1, %5
  %9 = load i64, ptr %2, align 8, !tbaa !5
  %10 = icmp slt i64 %8, %9
  br i1 %10, label %11, label %15

11:                                               ; preds = %7
  %12 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 1)
  %13 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %12, i8 noundef signext 32)
  %14 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %13, i32 noundef 1)
  br label %71

15:                                               ; preds = %7, %0
  %16 = call noundef i64 @_Z4fastxxx(i64 noundef 2, i64 noundef %5, i64 noundef 1000003)
  %17 = load i64, ptr %2, align 8, !tbaa !5
  %18 = add nsw i64 %17, -1
  %19 = call noundef i64 @_Z4fastxxx(i64 noundef %16, i64 noundef %18, i64 noundef 1000003)
  %20 = load i64, ptr %2, align 8, !tbaa !5
  %21 = add nsw i64 %20, -1
  %22 = sdiv i64 %21, 1000003
  %23 = srem i64 %21, 1000003
  %24 = load i64, ptr %1, align 8, !tbaa !5
  %25 = call noundef i64 @_Z4fastxxx(i64 noundef 2, i64 noundef %24, i64 noundef 1000003)
  %26 = add i64 %25, 1000003
  br label %30

27:                                               ; preds = %30
  %28 = call noundef i64 @_Z4fastxxx(i64 noundef %34, i64 noundef %22, i64 noundef 1000003)
  %.not44 = icmp slt i64 %23, 1
  br i1 %.not44, label %._crit_edge, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %27
  %xtraiter = and i64 %23, 1
  %29 = icmp eq i64 %23, 1
  br i1 %29, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph.preheader.new

.lr.ph.preheader.new:                             ; preds = %.lr.ph.preheader
  %unroll_iter = and i64 %23, 9223372036854775806
  br label %.lr.ph

30:                                               ; preds = %35, %15
  %indvars.iv = phi i64 [ 1, %15 ], [ %indvars.iv.next.1, %35 ]
  %.03542 = phi i64 [ 1, %15 ], [ %39, %35 ]
  %31 = sub i64 %26, %indvars.iv
  %32 = srem i64 %31, 1000003
  %33 = mul nsw i64 %32, %.03542
  %34 = srem i64 %33, 1000003
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 1000004
  br i1 %exitcond.not, label %27, label %35, !llvm.loop !9

35:                                               ; preds = %30
  %36 = sub i64 %26, %indvars.iv.next
  %37 = srem i64 %36, 1000003
  %38 = mul nsw i64 %37, %34
  %39 = srem i64 %38, 1000003
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  br label %30

._crit_edge.loopexit.unr-lcssa:                   ; preds = %.lr.ph, %.lr.ph.preheader
  %.lcssa65.ph = phi i64 [ poison, %.lr.ph.preheader ], [ %53, %.lr.ph ]
  %indvars.iv57.unr = phi i64 [ 1, %.lr.ph.preheader ], [ %indvars.iv.next58.1, %.lr.ph ]
  %.145.unr = phi i64 [ %28, %.lr.ph.preheader ], [ %53, %.lr.ph ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge, label %.lr.ph.epil

.lr.ph.epil:                                      ; preds = %._crit_edge.loopexit.unr-lcssa
  %40 = sub i64 %26, %indvars.iv57.unr
  %41 = srem i64 %40, 1000003
  %42 = mul nsw i64 %41, %.145.unr
  %43 = srem i64 %42, 1000003
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph.epil, %._crit_edge.loopexit.unr-lcssa, %27
  %.1.lcssa = phi i64 [ %28, %27 ], [ %.lcssa65.ph, %._crit_edge.loopexit.unr-lcssa ], [ %43, %.lr.ph.epil ]
  %44 = load i64, ptr %2, align 8, !tbaa !5
  %45 = add nsw i64 %44, -1
  %.not40.not47 = icmp sgt i64 %44, 2
  br i1 %.not40.not47, label %.lr.ph51, label %._crit_edge52

.lr.ph:                                           ; preds = %.lr.ph, %.lr.ph.preheader.new
  %indvars.iv57 = phi i64 [ 1, %.lr.ph.preheader.new ], [ %indvars.iv.next58.1, %.lr.ph ]
  %.145 = phi i64 [ %28, %.lr.ph.preheader.new ], [ %53, %.lr.ph ]
  %niter = phi i64 [ 0, %.lr.ph.preheader.new ], [ %niter.next.1, %.lr.ph ]
  %46 = sub i64 %26, %indvars.iv57
  %47 = srem i64 %46, 1000003
  %48 = mul nsw i64 %47, %.145
  %49 = srem i64 %48, 1000003
  %indvars.iv.next58.neg = xor i64 %indvars.iv57, -1
  %50 = add i64 %26, %indvars.iv.next58.neg
  %51 = srem i64 %50, 1000003
  %52 = mul nsw i64 %51, %49
  %53 = srem i64 %52, 1000003
  %indvars.iv.next58.1 = add nuw nsw i64 %indvars.iv57, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph, !llvm.loop !11

.lr.ph51:                                         ; preds = %._crit_edge, %.lr.ph51
  %.049 = phi i64 [ %56, %.lr.ph51 ], [ 2, %._crit_edge ]
  %.03248 = phi i64 [ %55, %.lr.ph51 ], [ 0, %._crit_edge ]
  %54 = sdiv i64 %45, %.049
  %55 = add nsw i64 %54, %.03248
  %56 = shl i64 %.049, 1
  %.not40.not = icmp slt i64 %56, %44
  br i1 %.not40.not, label %.lr.ph51, label %._crit_edge52, !llvm.loop !12

._crit_edge52:                                    ; preds = %.lr.ph51, %._crit_edge
  %.032.lcssa = phi i64 [ 0, %._crit_edge ], [ %55, %.lr.ph51 ]
  %57 = call noundef i64 @_Z4fastxxx(i64 noundef 2, i64 noundef %.032.lcssa, i64 noundef 1000003)
  %58 = call noundef i64 @_Z4fastxxx(i64 noundef %57, i64 noundef 1000001, i64 noundef 1000003)
  %59 = mul nsw i64 %58, %.1.lcssa
  %60 = srem i64 %59, 1000003
  %61 = call noundef i64 @_Z4fastxxx(i64 noundef 2, i64 noundef %.032.lcssa, i64 noundef 1000003)
  %62 = call noundef i64 @_Z4fastxxx(i64 noundef %61, i64 noundef 1000001, i64 noundef 1000003)
  %63 = mul nsw i64 %62, %19
  %64 = srem i64 %63, 1000003
  %65 = sub nsw i64 %64, %60
  %66 = trunc nsw i64 %65 to i32
  %.lhs.trunc = add nsw i32 %66, 1000003
  %67 = srem i32 %.lhs.trunc, 1000003
  %.sext = sext i32 %67 to i64
  %68 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %.sext)
  %69 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %68, i8 noundef signext 32)
  %70 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %69, i64 noundef %64)
  br label %71

71:                                               ; preds = %._crit_edge52, %11
  %.sink = phi ptr [ %70, %._crit_edge52 ], [ %14, %11 ]
  %72 = 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_)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #6
  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 #0 align 2

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

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 @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) local_unnamed_addr #0 align 2

attributes #0 = { 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 #1 = { 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 #2 = { 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 #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #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 = { 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}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}


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