; LLVM IR from Tunghohin/Competitive_Coding :: Daimayuan (491)

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

@p = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@A = external dso_local global i32, align 4
@B = external dso_local global i32, align 4
@C = external dso_local global i32, align 4
@a = external dso_local global [10000010 x i32], align 16
@s = external dso_local global [10000010 x i32], align 16
@sv = external dso_local global [10000010 x i32], align 16
@inv = external dso_local global [10000010 x i32], 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 i32 @_Z5q_powii(i32 noundef, i32 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 i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %8 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %9 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %10 = getelementptr i8, ptr %9, i64 -24
  %11 = load i64, ptr %10, align 8
  %12 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %11
  %13 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %12, ptr noundef null)
  %14 = load ptr, ptr @_ZSt4cout, align 8, !tbaa !5
  %15 = getelementptr i8, ptr %14, i64 -24
  %16 = load i64, ptr %15, align 8
  %17 = getelementptr inbounds i8, ptr @_ZSt4cout, i64 %16
  %18 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %17, ptr noundef null)
  %19 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @p)
  %20 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %19, ptr noundef nonnull align 4 dereferenceable(4) @n)
  %21 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERj(ptr noundef nonnull align 8 dereferenceable(16) %20, ptr noundef nonnull align 4 dereferenceable(4) @A)
  %22 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERj(ptr noundef nonnull align 8 dereferenceable(16) %21, ptr noundef nonnull align 4 dereferenceable(4) @B)
  %23 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERj(ptr noundef nonnull align 8 dereferenceable(16) %22, ptr noundef nonnull align 4 dereferenceable(4) @C)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  store i32 1, ptr %2, align 4, !tbaa !8
  br label %24

24:                                               ; preds = %36, %0
  %25 = load i32, ptr %2, align 4, !tbaa !8
  %26 = load i32, ptr @n, align 4, !tbaa !8
  %27 = icmp sle i32 %25, %26
  br i1 %27, label %29, label %28

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

29:                                               ; preds = %24
  %30 = call noundef i32 @_Z5rng61v()
  %31 = load i32, ptr @p, align 4, !tbaa !8
  %32 = urem i32 %30, %31
  %33 = load i32, ptr %2, align 4, !tbaa !8
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [10000010 x i32], ptr @a, i64 0, i64 %34
  store i32 %32, ptr %35, align 4, !tbaa !8
  br label %36

36:                                               ; preds = %29
  %37 = load i32, ptr %2, align 4, !tbaa !8
  %38 = add nsw i32 %37, 1
  store i32 %38, ptr %2, align 4, !tbaa !8
  br label %24, !llvm.loop !11

39:                                               ; preds = %28
  store i32 1, ptr @s, align 16, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  store i32 1, ptr %3, align 4, !tbaa !8
  br label %40

40:                                               ; preds = %65, %39
  %41 = load i32, ptr %3, align 4, !tbaa !8
  %42 = load i32, ptr @n, align 4, !tbaa !8
  %43 = icmp sle i32 %41, %42
  br i1 %43, label %45, label %44

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

45:                                               ; preds = %40
  %46 = load i32, ptr %3, align 4, !tbaa !8
  %47 = sub nsw i32 %46, 1
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [10000010 x i32], ptr @s, i64 0, i64 %48
  %50 = load i32, ptr %49, align 4, !tbaa !8
  %51 = sext i32 %50 to i64
  %52 = load i32, ptr %3, align 4, !tbaa !8
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [10000010 x i32], ptr @a, i64 0, i64 %53
  %55 = load i32, ptr %54, align 4, !tbaa !8
  %56 = sext i32 %55 to i64
  %57 = mul nsw i64 %51, %56
  %58 = load i32, ptr @p, align 4, !tbaa !8
  %59 = sext i32 %58 to i64
  %60 = srem i64 %57, %59
  %61 = trunc i64 %60 to i32
  %62 = load i32, ptr %3, align 4, !tbaa !8
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [10000010 x i32], ptr @s, i64 0, i64 %63
  store i32 %61, ptr %64, align 4, !tbaa !8
  br label %65

65:                                               ; preds = %45
  %66 = load i32, ptr %3, align 4, !tbaa !8
  %67 = add nsw i32 %66, 1
  store i32 %67, ptr %3, align 4, !tbaa !8
  br label %40, !llvm.loop !13

68:                                               ; preds = %44
  %69 = load i32, ptr @n, align 4, !tbaa !8
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [10000010 x i32], ptr @s, i64 0, i64 %70
  %72 = load i32, ptr %71, align 4, !tbaa !8
  %73 = load i32, ptr @p, align 4, !tbaa !8
  %74 = sub nsw i32 %73, 2
  %75 = call noundef i32 @_Z5q_powii(i32 noundef %72, i32 noundef %74)
  %76 = load i32, ptr @n, align 4, !tbaa !8
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [10000010 x i32], ptr @sv, i64 0, i64 %77
  store i32 %75, ptr %78, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  %79 = load i32, ptr @n, align 4, !tbaa !8
  store i32 %79, ptr %4, align 4, !tbaa !8
  br label %80

80:                                               ; preds = %104, %68
  %81 = load i32, ptr %4, align 4, !tbaa !8
  %82 = icmp sge i32 %81, 1
  br i1 %82, label %84, label %83

83:                                               ; preds = %80
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  br label %107

84:                                               ; preds = %80
  %85 = load i32, ptr %4, align 4, !tbaa !8
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [10000010 x i32], ptr @sv, i64 0, i64 %86
  %88 = load i32, ptr %87, align 4, !tbaa !8
  %89 = sext i32 %88 to i64
  %90 = load i32, ptr %4, align 4, !tbaa !8
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [10000010 x i32], ptr @a, i64 0, i64 %91
  %93 = load i32, ptr %92, align 4, !tbaa !8
  %94 = sext i32 %93 to i64
  %95 = mul nsw i64 %89, %94
  %96 = load i32, ptr @p, align 4, !tbaa !8
  %97 = sext i32 %96 to i64
  %98 = srem i64 %95, %97
  %99 = trunc i64 %98 to i32
  %100 = load i32, ptr %4, align 4, !tbaa !8
  %101 = sub nsw i32 %100, 1
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [10000010 x i32], ptr @sv, i64 0, i64 %102
  store i32 %99, ptr %103, align 4, !tbaa !8
  br label %104

104:                                              ; preds = %84
  %105 = load i32, ptr %4, align 4, !tbaa !8
  %106 = add nsw i32 %105, -1
  store i32 %106, ptr %4, align 4, !tbaa !8
  br label %80, !llvm.loop !14

107:                                              ; preds = %83
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  store i32 1, ptr %5, align 4, !tbaa !8
  br label %108

108:                                              ; preds = %133, %107
  %109 = load i32, ptr %5, align 4, !tbaa !8
  %110 = load i32, ptr @n, align 4, !tbaa !8
  %111 = icmp sle i32 %109, %110
  br i1 %111, label %113, label %112

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

113:                                              ; preds = %108
  %114 = load i32, ptr %5, align 4, !tbaa !8
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [10000010 x i32], ptr @sv, i64 0, i64 %115
  %117 = load i32, ptr %116, align 4, !tbaa !8
  %118 = sext i32 %117 to i64
  %119 = load i32, ptr %5, align 4, !tbaa !8
  %120 = sub nsw i32 %119, 1
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [10000010 x i32], ptr @s, i64 0, i64 %121
  %123 = load i32, ptr %122, align 4, !tbaa !8
  %124 = sext i32 %123 to i64
  %125 = mul nsw i64 %118, %124
  %126 = load i32, ptr @p, align 4, !tbaa !8
  %127 = sext i32 %126 to i64
  %128 = srem i64 %125, %127
  %129 = trunc i64 %128 to i32
  %130 = load i32, ptr %5, align 4, !tbaa !8
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds [10000010 x i32], ptr @inv, i64 0, i64 %131
  store i32 %129, ptr %132, align 4, !tbaa !8
  br label %133

133:                                              ; preds = %113
  %134 = load i32, ptr %5, align 4, !tbaa !8
  %135 = add nsw i32 %134, 1
  store i32 %135, ptr %5, align 4, !tbaa !8
  br label %108, !llvm.loop !15

136:                                              ; preds = %112
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  store i32 0, ptr %6, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  store i32 1, ptr %7, align 4, !tbaa !8
  br label %137

137:                                              ; preds = %149, %136
  %138 = load i32, ptr %7, align 4, !tbaa !8
  %139 = load i32, ptr @n, align 4, !tbaa !8
  %140 = icmp sle i32 %138, %139
  br i1 %140, label %142, label %141

141:                                              ; preds = %137
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  br label %152

142:                                              ; preds = %137
  %143 = load i32, ptr %7, align 4, !tbaa !8
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds [10000010 x i32], ptr @inv, i64 0, i64 %144
  %146 = load i32, ptr %145, align 4, !tbaa !8
  %147 = load i32, ptr %6, align 4, !tbaa !8
  %148 = xor i32 %147, %146
  store i32 %148, ptr %6, align 4, !tbaa !8
  br label %149

149:                                              ; preds = %142
  %150 = load i32, ptr %7, align 4, !tbaa !8
  %151 = add nsw i32 %150, 1
  store i32 %151, ptr %7, align 4, !tbaa !8
  br label %137, !llvm.loop !16

152:                                              ; preds = %141
  %153 = load i32, ptr %6, align 4, !tbaa !8
  %154 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %153)
  %155 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %154, i8 noundef signext 10)
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  %156 = load i32, ptr %1, align 4
  ret i32 %156
}

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

; 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 nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #3

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

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

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

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 = !{!"int", !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}


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

@p = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@A = external dso_local global i32, align 4
@B = external dso_local global i32, align 4
@C = external dso_local global i32, align 4
@a = external dso_local local_unnamed_addr global [10000010 x i32], align 16
@s = external dso_local local_unnamed_addr global [10000010 x i32], align 16
@sv = external dso_local local_unnamed_addr global [10000010 x i32], align 16
@inv = external dso_local local_unnamed_addr global [10000010 x i32], 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 i32 @_Z5q_powii(i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 {
  %1 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %2 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %3 = getelementptr i8, ptr %2, i64 -24
  %4 = load i64, ptr %3, align 8
  %5 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %4
  %6 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %5, ptr noundef null)
  %7 = load ptr, ptr @_ZSt4cout, align 8, !tbaa !5
  %8 = getelementptr i8, ptr %7, i64 -24
  %9 = load i64, ptr %8, align 8
  %10 = getelementptr inbounds i8, ptr @_ZSt4cout, i64 %9
  %11 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %10, ptr noundef null)
  %12 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @p)
  %13 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %12, ptr noundef nonnull align 4 dereferenceable(4) @n)
  %14 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERj(ptr noundef nonnull align 8 dereferenceable(16) %13, ptr noundef nonnull align 4 dereferenceable(4) @A)
  %15 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERj(ptr noundef nonnull align 8 dereferenceable(16) %14, ptr noundef nonnull align 4 dereferenceable(4) @B)
  %16 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERj(ptr noundef nonnull align 8 dereferenceable(16) %15, ptr noundef nonnull align 4 dereferenceable(4) @C)
  %17 = load i32, ptr @n, align 4, !tbaa !8
  %.not34 = icmp slt i32 %17, 1
  br i1 %.not34, label %._crit_edge.thread, label %.lr.ph

._crit_edge.thread:                               ; preds = %0
  %.pre.pre = load i32, ptr @p, align 4, !tbaa !8
  store i32 1, ptr @s, align 16, !tbaa !8
  br label %._crit_edge40

._crit_edge:                                      ; preds = %.lr.ph
  store i32 1, ptr @s, align 16, !tbaa !8
  %.not3036 = icmp slt i32 %25, 1
  br i1 %.not3036, label %._crit_edge40, label %.lr.ph39

.lr.ph39:                                         ; preds = %._crit_edge
  %18 = sext i32 %22 to i64
  %19 = zext nneg i32 %25 to i64
  %xtraiter = and i64 %19, 1
  %20 = icmp eq i32 %25, 1
  br i1 %20, label %._crit_edge40.loopexit.unr-lcssa, label %.lr.ph39.new

.lr.ph39.new:                                     ; preds = %.lr.ph39
  %unroll_iter = and i64 %19, 2147483646
  br label %57

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %0 ]
  %21 = tail call noundef i32 @_Z5rng61v()
  %22 = load i32, ptr @p, align 4, !tbaa !8
  %23 = urem i32 %21, %22
  %24 = getelementptr inbounds [10000010 x i32], ptr @a, i64 0, i64 %indvars.iv
  store i32 %23, ptr %24, align 4, !tbaa !8
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %25 = load i32, ptr @n, align 4, !tbaa !8
  %26 = sext i32 %25 to i64
  %.not.not = icmp slt i64 %indvars.iv, %26
  br i1 %.not.not, label %.lr.ph, label %._crit_edge, !llvm.loop !11

._crit_edge40.loopexit.unr-lcssa.loopexit:        ; preds = %57
  %27 = shl i64 %72, 32
  %28 = ashr exact i64 %27, 32
  br label %._crit_edge40.loopexit.unr-lcssa

._crit_edge40.loopexit.unr-lcssa:                 ; preds = %._crit_edge40.loopexit.unr-lcssa.loopexit, %.lr.ph39
  %.unr = phi i64 [ 1, %.lr.ph39 ], [ %28, %._crit_edge40.loopexit.unr-lcssa.loopexit ]
  %indvars.iv56.unr = phi i64 [ 1, %.lr.ph39 ], [ %indvars.iv.next57.1, %._crit_edge40.loopexit.unr-lcssa.loopexit ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge40, label %._crit_edge40.loopexit.epilog-lcssa

._crit_edge40.loopexit.epilog-lcssa:              ; preds = %._crit_edge40.loopexit.unr-lcssa
  %29 = getelementptr inbounds [10000010 x i32], ptr @a, i64 0, i64 %indvars.iv56.unr
  %30 = load i32, ptr %29, align 4, !tbaa !8
  %31 = sext i32 %30 to i64
  %32 = mul nsw i64 %.unr, %31
  %33 = srem i64 %32, %18
  %34 = trunc nsw i64 %33 to i32
  %35 = getelementptr inbounds [10000010 x i32], ptr @s, i64 0, i64 %indvars.iv56.unr
  store i32 %34, ptr %35, align 4, !tbaa !8
  br label %._crit_edge40

._crit_edge40:                                    ; preds = %._crit_edge40.loopexit.epilog-lcssa, %._crit_edge40.loopexit.unr-lcssa, %._crit_edge.thread, %._crit_edge
  %.lcssa78 = phi i32 [ %17, %._crit_edge.thread ], [ %25, %._crit_edge ], [ %25, %._crit_edge40.loopexit.unr-lcssa ], [ %25, %._crit_edge40.loopexit.epilog-lcssa ]
  %.pre77 = phi i32 [ %.pre.pre, %._crit_edge.thread ], [ %22, %._crit_edge ], [ %22, %._crit_edge40.loopexit.unr-lcssa ], [ %22, %._crit_edge40.loopexit.epilog-lcssa ]
  %36 = sext i32 %.lcssa78 to i64
  %37 = getelementptr inbounds [10000010 x i32], ptr @s, i64 0, i64 %36
  %38 = load i32, ptr %37, align 4, !tbaa !8
  %39 = add nsw i32 %.pre77, -2
  %40 = tail call noundef i32 @_Z5q_powii(i32 noundef %38, i32 noundef %39)
  %41 = load i32, ptr @n, align 4, !tbaa !8
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [10000010 x i32], ptr @sv, i64 0, i64 %42
  store i32 %40, ptr %43, align 4, !tbaa !8
  %44 = icmp sgt i32 %41, 0
  br i1 %44, label %.lr.ph43, label %._crit_edge51

.lr.ph43:                                         ; preds = %._crit_edge40
  %45 = load i32, ptr @p, align 4, !tbaa !8
  %46 = sext i32 %45 to i64
  %47 = zext nneg i32 %41 to i64
  %.phi.trans.insert = getelementptr inbounds [10000010 x i32], ptr @sv, i64 0, i64 %47
  %.pre72 = load i32, ptr %.phi.trans.insert, align 4, !tbaa !8
  %xtraiter93 = and i64 %47, 1
  %lcmp.mod94.not = icmp eq i64 %xtraiter93, 0
  br i1 %lcmp.mod94.not, label %.prol.loopexit, label %.prol.loopexit.unr-lcssa

.prol.loopexit.unr-lcssa:                         ; preds = %.lr.ph43
  %48 = sext i32 %.pre72 to i64
  %49 = getelementptr inbounds [10000010 x i32], ptr @a, i64 0, i64 %47
  %50 = load i32, ptr %49, align 4, !tbaa !8
  %51 = sext i32 %50 to i64
  %52 = mul nsw i64 %51, %48
  %53 = srem i64 %52, %46
  %54 = trunc nsw i64 %53 to i32
  %indvars.iv.next60.prol = add nsw i64 %47, -1
  %55 = getelementptr inbounds [10000010 x i32], ptr @sv, i64 0, i64 %indvars.iv.next60.prol
  store i32 %54, ptr %55, align 4, !tbaa !8
  br label %.prol.loopexit

.prol.loopexit:                                   ; preds = %.prol.loopexit.unr-lcssa, %.lr.ph43
  %.unr95 = phi i32 [ %.pre72, %.lr.ph43 ], [ %54, %.prol.loopexit.unr-lcssa ]
  %indvars.iv59.unr = phi i64 [ %47, %.lr.ph43 ], [ %indvars.iv.next60.prol, %.prol.loopexit.unr-lcssa ]
  %56 = icmp eq i32 %41, 1
  br i1 %56, label %.lr.ph46, label %.lr.ph43.new

57:                                               ; preds = %57, %.lr.ph39.new
  %58 = phi i64 [ 1, %.lr.ph39.new ], [ %72, %57 ]
  %indvars.iv56 = phi i64 [ 1, %.lr.ph39.new ], [ %indvars.iv.next57.1, %57 ]
  %niter = phi i64 [ 0, %.lr.ph39.new ], [ %niter.next.1, %57 ]
  %sext = shl i64 %58, 32
  %59 = ashr exact i64 %sext, 32
  %60 = getelementptr inbounds [10000010 x i32], ptr @a, i64 0, i64 %indvars.iv56
  %61 = load i32, ptr %60, align 4, !tbaa !8
  %62 = sext i32 %61 to i64
  %63 = mul nsw i64 %59, %62
  %64 = srem i64 %63, %18
  %65 = trunc nsw i64 %64 to i32
  %66 = getelementptr inbounds [10000010 x i32], ptr @s, i64 0, i64 %indvars.iv56
  store i32 %65, ptr %66, align 4, !tbaa !8
  %indvars.iv.next57 = add nuw nsw i64 %indvars.iv56, 1
  %sext.1 = shl i64 %64, 32
  %67 = ashr exact i64 %sext.1, 32
  %68 = getelementptr inbounds [10000010 x i32], ptr @a, i64 0, i64 %indvars.iv.next57
  %69 = load i32, ptr %68, align 4, !tbaa !8
  %70 = sext i32 %69 to i64
  %71 = mul nsw i64 %67, %70
  %72 = srem i64 %71, %18
  %73 = trunc nsw i64 %72 to i32
  %74 = getelementptr inbounds [10000010 x i32], ptr @s, i64 0, i64 %indvars.iv.next57
  store i32 %73, ptr %74, align 4, !tbaa !8
  %indvars.iv.next57.1 = add nuw nsw i64 %indvars.iv56, 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_edge40.loopexit.unr-lcssa.loopexit, label %57, !llvm.loop !13

.lr.ph46:                                         ; preds = %.lr.ph43.new, %.prol.loopexit
  %75 = load i32, ptr @p, align 4, !tbaa !8
  %76 = sext i32 %75 to i64
  %77 = zext nneg i32 %41 to i64
  %xtraiter97 = and i64 %77, 1
  %78 = icmp eq i32 %41, 1
  br i1 %78, label %.lr.ph50.preheader.unr-lcssa, label %.lr.ph46.new

.lr.ph46.new:                                     ; preds = %.lr.ph46
  %unroll_iter99 = and i64 %77, 2147483646
  br label %116

.lr.ph43.new:                                     ; preds = %.prol.loopexit, %.lr.ph43.new
  %79 = phi i32 [ %94, %.lr.ph43.new ], [ %.unr95, %.prol.loopexit ]
  %indvars.iv59 = phi i64 [ %indvars.iv.next60.1, %.lr.ph43.new ], [ %indvars.iv59.unr, %.prol.loopexit ]
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [10000010 x i32], ptr @a, i64 0, i64 %indvars.iv59
  %82 = load i32, ptr %81, align 4, !tbaa !8
  %83 = sext i32 %82 to i64
  %84 = mul nsw i64 %83, %80
  %85 = srem i64 %84, %46
  %86 = trunc nsw i64 %85 to i32
  %indvars.iv.next60 = add nsw i64 %indvars.iv59, -1
  %87 = getelementptr inbounds [10000010 x i32], ptr @sv, i64 0, i64 %indvars.iv.next60
  store i32 %86, ptr %87, align 4, !tbaa !8
  %sext101 = shl i64 %85, 32
  %88 = ashr exact i64 %sext101, 32
  %89 = getelementptr inbounds [10000010 x i32], ptr @a, i64 0, i64 %indvars.iv.next60
  %90 = load i32, ptr %89, align 4, !tbaa !8
  %91 = sext i32 %90 to i64
  %92 = mul nsw i64 %88, %91
  %93 = srem i64 %92, %46
  %94 = trunc nsw i64 %93 to i32
  %indvars.iv.next60.1 = add nsw i64 %indvars.iv59, -2
  %95 = getelementptr inbounds [10000010 x i32], ptr @sv, i64 0, i64 %indvars.iv.next60.1
  store i32 %94, ptr %95, align 4, !tbaa !8
  %96 = icmp ugt i64 %indvars.iv.next60, 1
  br i1 %96, label %.lr.ph43.new, label %.lr.ph46, !llvm.loop !14

.lr.ph50.preheader.unr-lcssa:                     ; preds = %116, %.lr.ph46
  %indvars.iv62.unr = phi i64 [ 1, %.lr.ph46 ], [ %indvars.iv.next63.1, %116 ]
  %lcmp.mod98.not = icmp eq i64 %xtraiter97, 0
  br i1 %lcmp.mod98.not, label %.lr.ph50.preheader, label %.lr.ph50.preheader.epilog-lcssa

.lr.ph50.preheader.epilog-lcssa:                  ; preds = %.lr.ph50.preheader.unr-lcssa
  %97 = getelementptr inbounds [10000010 x i32], ptr @sv, i64 0, i64 %indvars.iv62.unr
  %98 = load i32, ptr %97, align 4, !tbaa !8
  %99 = sext i32 %98 to i64
  %100 = add nsw i64 %indvars.iv62.unr, -1
  %101 = getelementptr inbounds [10000010 x i32], ptr @s, i64 0, i64 %100
  %102 = load i32, ptr %101, align 4, !tbaa !8
  %103 = sext i32 %102 to i64
  %104 = mul nsw i64 %103, %99
  %105 = srem i64 %104, %76
  %106 = trunc nsw i64 %105 to i32
  %107 = getelementptr inbounds [10000010 x i32], ptr @inv, i64 0, i64 %indvars.iv62.unr
  store i32 %106, ptr %107, align 4, !tbaa !8
  br label %.lr.ph50.preheader

.lr.ph50.preheader:                               ; preds = %.lr.ph50.preheader.unr-lcssa, %.lr.ph50.preheader.epilog-lcssa
  %108 = add nuw i32 %41, 1
  %wide.trip.count70 = zext i32 %108 to i64
  %109 = zext nneg i32 %41 to i64
  %min.iters.check = icmp ult i32 %41, 8
  br i1 %min.iters.check, label %.lr.ph50.preheader88, label %vector.ph

.lr.ph50.preheader88:                             ; preds = %middle.block, %.lr.ph50.preheader
  %indvars.iv67.ph = phi i64 [ 1, %.lr.ph50.preheader ], [ %ind.end, %middle.block ]
  %.02448.ph = phi i32 [ 0, %.lr.ph50.preheader ], [ %115, %middle.block ]
  br label %.lr.ph50

vector.ph:                                        ; preds = %.lr.ph50.preheader
  %n.vec = and i64 %109, 2147483640
  %ind.end = or disjoint i64 %n.vec, 1
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %112, %vector.body ]
  %vec.phi86 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %113, %vector.body ]
  %offset.idx = or disjoint i64 %index, 1
  %110 = getelementptr inbounds [10000010 x i32], ptr @inv, i64 0, i64 %offset.idx
  %111 = getelementptr inbounds i8, ptr %110, i64 16
  %wide.load = load <4 x i32>, ptr %110, align 4, !tbaa !8
  %wide.load87 = load <4 x i32>, ptr %111, align 4, !tbaa !8
  %112 = xor <4 x i32> %wide.load, %vec.phi
  %113 = xor <4 x i32> %wide.load87, %vec.phi86
  %index.next = add nuw i64 %index, 8
  %114 = icmp eq i64 %index.next, %n.vec
  br i1 %114, label %middle.block, label %vector.body, !llvm.loop !15

middle.block:                                     ; preds = %vector.body
  %bin.rdx = xor <4 x i32> %113, %112
  %115 = tail call i32 @llvm.vector.reduce.xor.v4i32(<4 x i32> %bin.rdx)
  %cmp.n = icmp eq i64 %n.vec, %109
  br i1 %cmp.n, label %._crit_edge51, label %.lr.ph50.preheader88

116:                                              ; preds = %116, %.lr.ph46.new
  %indvars.iv62 = phi i64 [ 1, %.lr.ph46.new ], [ %indvars.iv.next63.1, %116 ]
  %niter100 = phi i64 [ 0, %.lr.ph46.new ], [ %niter100.next.1, %116 ]
  %117 = getelementptr inbounds [10000010 x i32], ptr @sv, i64 0, i64 %indvars.iv62
  %118 = load i32, ptr %117, align 4, !tbaa !8
  %119 = sext i32 %118 to i64
  %120 = add nsw i64 %indvars.iv62, -1
  %121 = getelementptr inbounds [10000010 x i32], ptr @s, i64 0, i64 %120
  %122 = load i32, ptr %121, align 4, !tbaa !8
  %123 = sext i32 %122 to i64
  %124 = mul nsw i64 %123, %119
  %125 = srem i64 %124, %76
  %126 = trunc nsw i64 %125 to i32
  %127 = getelementptr inbounds [10000010 x i32], ptr @inv, i64 0, i64 %indvars.iv62
  store i32 %126, ptr %127, align 4, !tbaa !8
  %indvars.iv.next63 = add nuw nsw i64 %indvars.iv62, 1
  %128 = getelementptr inbounds [10000010 x i32], ptr @sv, i64 0, i64 %indvars.iv.next63
  %129 = load i32, ptr %128, align 4, !tbaa !8
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [10000010 x i32], ptr @s, i64 0, i64 %indvars.iv62
  %132 = load i32, ptr %131, align 4, !tbaa !8
  %133 = sext i32 %132 to i64
  %134 = mul nsw i64 %133, %130
  %135 = srem i64 %134, %76
  %136 = trunc nsw i64 %135 to i32
  %137 = getelementptr inbounds [10000010 x i32], ptr @inv, i64 0, i64 %indvars.iv.next63
  store i32 %136, ptr %137, align 4, !tbaa !8
  %indvars.iv.next63.1 = add nuw nsw i64 %indvars.iv62, 2
  %niter100.next.1 = add i64 %niter100, 2
  %niter100.ncmp.1 = icmp eq i64 %niter100.next.1, %unroll_iter99
  br i1 %niter100.ncmp.1, label %.lr.ph50.preheader.unr-lcssa, label %116, !llvm.loop !18

._crit_edge51:                                    ; preds = %.lr.ph50, %middle.block, %._crit_edge40
  %.024.lcssa = phi i32 [ 0, %._crit_edge40 ], [ %115, %middle.block ], [ %142, %.lr.ph50 ]
  %138 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %.024.lcssa)
  %139 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %138, i8 noundef signext 10)
  ret i32 0

.lr.ph50:                                         ; preds = %.lr.ph50.preheader88, %.lr.ph50
  %indvars.iv67 = phi i64 [ %indvars.iv.next68, %.lr.ph50 ], [ %indvars.iv67.ph, %.lr.ph50.preheader88 ]
  %.02448 = phi i32 [ %142, %.lr.ph50 ], [ %.02448.ph, %.lr.ph50.preheader88 ]
  %140 = getelementptr inbounds [10000010 x i32], ptr @inv, i64 0, i64 %indvars.iv67
  %141 = load i32, ptr %140, align 4, !tbaa !8
  %142 = xor i32 %141, %.02448
  %indvars.iv.next68 = add nuw nsw i64 %indvars.iv67, 1
  %exitcond71.not = icmp eq i64 %indvars.iv.next68, %wide.trip.count70
  br i1 %exitcond71.not, label %._crit_edge51, label %.lr.ph50, !llvm.loop !19
}

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

; 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 nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z5rng61v() local_unnamed_addr #4

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.xor.v4i32(<4 x i32>) #6

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 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 #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 = { 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 #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }

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

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


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