; LLVM IR from VastoLorde95/Competitive-Programming :: Hackerrank/Company Contests/Sears 2016/Problem G (G)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@n = external dso_local global i32, align 4
@a = external dso_local global [100100 x i64], align 16
@mod = external dso_local global i64, align 8
@dp1 = external dso_local global [100100 x i64], align 16
@dp2 = external dso_local global [100100 x i64], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_Z6getfibx(i64 noundef) #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 i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %10 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %11 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %12 = getelementptr i8, ptr %11, i64 -24
  %13 = load i64, ptr %12, align 8
  %14 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %13
  %15 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %14, ptr noundef null)
  %16 = load ptr, ptr @_ZSt4cout, align 8, !tbaa !5
  %17 = getelementptr i8, ptr %16, i64 -24
  %18 = load i64, ptr %17, align 8
  %19 = getelementptr inbounds i8, ptr @_ZSt4cout, i64 %18
  %20 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %19, ptr noundef null)
  %21 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @n)
  %22 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %21, ptr noundef nonnull align 8 dereferenceable(8) @mod)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 1, ptr %2, align 4, !tbaa !8
  br label %23

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

27:                                               ; preds = %23
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  br label %36

28:                                               ; preds = %23
  %29 = load i32, ptr %2, align 4, !tbaa !8
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds [100100 x i64], ptr @a, i64 0, i64 %30
  %32 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %31)
  br label %33

33:                                               ; preds = %28
  %34 = load i32, ptr %2, align 4, !tbaa !8
  %35 = add nsw i32 %34, 1
  store i32 %35, ptr %2, align 4, !tbaa !8
  br label %23, !llvm.loop !11

36:                                               ; preds = %27
  %37 = load i32, ptr @n, align 4, !tbaa !8
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [100100 x i64], ptr @a, i64 0, i64 %38
  %40 = load i64, ptr %39, align 8, !tbaa !13
  %41 = add nsw i64 %40, 1
  %42 = call noundef i64 @_Z6getfibx(i64 noundef %41)
  %43 = load i32, ptr @n, align 4, !tbaa !8
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [100100 x i64], ptr @dp1, i64 0, i64 %44
  store i64 %42, ptr %45, align 8, !tbaa !13
  %46 = load i32, ptr @n, align 4, !tbaa !8
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [100100 x i64], ptr @a, i64 0, i64 %47
  %49 = load i64, ptr %48, align 8, !tbaa !13
  %50 = call noundef i64 @_Z6getfibx(i64 noundef %49)
  %51 = load i32, ptr @n, align 4, !tbaa !8
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [100100 x i64], ptr @dp2, i64 0, i64 %52
  store i64 %50, ptr %53, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  %54 = load i32, ptr @n, align 4, !tbaa !8
  %55 = sub nsw i32 %54, 1
  store i32 %55, ptr %3, align 4, !tbaa !8
  br label %56

56:                                               ; preds = %138, %36
  %57 = load i32, ptr %3, align 4, !tbaa !8
  %58 = icmp sgt i32 %57, 0
  br i1 %58, label %60, label %59

59:                                               ; preds = %56
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  br label %141

60:                                               ; preds = %56
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  %61 = load i32, ptr %3, align 4, !tbaa !8
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [100100 x i64], ptr @a, i64 0, i64 %62
  %64 = load i64, ptr %63, align 8, !tbaa !13
  %65 = add nsw i64 %64, 1
  %66 = call noundef i64 @_Z6getfibx(i64 noundef %65)
  store i64 %66, ptr %4, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  %67 = load i32, ptr %3, align 4, !tbaa !8
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [100100 x i64], ptr @a, i64 0, i64 %68
  %70 = load i64, ptr %69, align 8, !tbaa !13
  %71 = call noundef i64 @_Z6getfibx(i64 noundef %70)
  store i64 %71, ptr %5, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  %72 = load i32, ptr %3, align 4, !tbaa !8
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [100100 x i64], ptr @a, i64 0, i64 %73
  %75 = load i64, ptr %74, align 8, !tbaa !13
  %76 = sub nsw i64 %75, 1
  %77 = call noundef i64 @_Z6getfibx(i64 noundef %76)
  store i64 %77, ptr %6, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %78 = load i32, ptr %3, align 4, !tbaa !8
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [100100 x i64], ptr @a, i64 0, i64 %79
  %81 = load i64, ptr %80, align 8, !tbaa !13
  %82 = sub nsw i64 %81, 2
  %83 = call noundef i64 @_Z6getfibx(i64 noundef %82)
  store i64 %83, ptr %7, align 8, !tbaa !13
  %84 = load i64, ptr %4, align 8, !tbaa !13
  %85 = load i64, ptr %5, align 8, !tbaa !13
  %86 = load i32, ptr %3, align 4, !tbaa !8
  %87 = add nsw i32 %86, 1
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [100100 x i64], ptr @dp1, i64 0, i64 %88
  %90 = load i64, ptr %89, align 8, !tbaa !13
  %91 = mul nsw i64 %85, %90
  %92 = load i64, ptr @mod, align 8, !tbaa !13
  %93 = srem i64 %91, %92
  %94 = load i64, ptr %6, align 8, !tbaa !13
  %95 = load i32, ptr %3, align 4, !tbaa !8
  %96 = add nsw i32 %95, 1
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [100100 x i64], ptr @dp2, i64 0, i64 %97
  %99 = load i64, ptr %98, align 8, !tbaa !13
  %100 = mul nsw i64 %94, %99
  %101 = load i64, ptr @mod, align 8, !tbaa !13
  %102 = srem i64 %100, %101
  %103 = add nsw i64 %93, %102
  %104 = load i64, ptr @mod, align 8, !tbaa !13
  %105 = srem i64 %103, %104
  %106 = add nsw i64 %84, %105
  %107 = load i64, ptr @mod, align 8, !tbaa !13
  %108 = srem i64 %106, %107
  %109 = load i32, ptr %3, align 4, !tbaa !8
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [100100 x i64], ptr @dp1, i64 0, i64 %110
  store i64 %108, ptr %111, align 8, !tbaa !13
  %112 = load i64, ptr %5, align 8, !tbaa !13
  %113 = load i64, ptr %6, align 8, !tbaa !13
  %114 = load i32, ptr %3, align 4, !tbaa !8
  %115 = add nsw i32 %114, 1
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds [100100 x i64], ptr @dp1, i64 0, i64 %116
  %118 = load i64, ptr %117, align 8, !tbaa !13
  %119 = mul nsw i64 %113, %118
  %120 = load i64, ptr @mod, align 8, !tbaa !13
  %121 = srem i64 %119, %120
  %122 = add nsw i64 %112, %121
  %123 = load i64, ptr %7, align 8, !tbaa !13
  %124 = load i32, ptr %3, align 4, !tbaa !8
  %125 = add nsw i32 %124, 1
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds [100100 x i64], ptr @dp2, i64 0, i64 %126
  %128 = load i64, ptr %127, align 8, !tbaa !13
  %129 = mul nsw i64 %123, %128
  %130 = load i64, ptr @mod, align 8, !tbaa !13
  %131 = srem i64 %129, %130
  %132 = add nsw i64 %122, %131
  %133 = load i64, ptr @mod, align 8, !tbaa !13
  %134 = srem i64 %132, %133
  %135 = load i32, ptr %3, align 4, !tbaa !8
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds [100100 x i64], ptr @dp2, i64 0, i64 %136
  store i64 %134, ptr %137, align 8, !tbaa !13
  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
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  br label %138

138:                                              ; preds = %60
  %139 = load i32, ptr %3, align 4, !tbaa !8
  %140 = add nsw i32 %139, -1
  store i32 %140, ptr %3, align 4, !tbaa !8
  br label %56, !llvm.loop !15

141:                                              ; preds = %59
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  store i64 0, ptr %8, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 1, ptr %9, align 4, !tbaa !8
  br label %142

142:                                              ; preds = %177, %141
  %143 = load i32, ptr %9, align 4, !tbaa !8
  %144 = load i32, ptr @n, align 4, !tbaa !8
  %145 = icmp sle i32 %143, %144
  br i1 %145, label %147, label %146

146:                                              ; preds = %142
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %180

147:                                              ; preds = %142
  %148 = load i32, ptr %9, align 4, !tbaa !8
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds [100100 x i64], ptr @dp2, i64 0, i64 %149
  %151 = load i64, ptr %150, align 8, !tbaa !13
  %152 = mul nsw i64 2, %151
  %153 = load i64, ptr @mod, align 8, !tbaa !13
  %154 = srem i64 %152, %153
  %155 = load i32, ptr @n, align 4, !tbaa !8
  %156 = load i32, ptr %9, align 4, !tbaa !8
  %157 = sub nsw i32 %155, %156
  %158 = add nsw i32 %157, 1
  %159 = sext i32 %158 to i64
  %160 = sub nsw i64 %154, %159
  %161 = load i64, ptr @mod, align 8, !tbaa !13
  %162 = srem i64 %160, %161
  %163 = load i64, ptr @mod, align 8, !tbaa !13
  %164 = add nsw i64 %162, %163
  %165 = load i64, ptr @mod, align 8, !tbaa !13
  %166 = srem i64 %164, %165
  %167 = load i64, ptr %8, align 8, !tbaa !13
  %168 = add nsw i64 %167, %166
  store i64 %168, ptr %8, align 8, !tbaa !13
  %169 = load i64, ptr %8, align 8, !tbaa !13
  %170 = load i64, ptr @mod, align 8, !tbaa !13
  %171 = icmp sge i64 %169, %170
  br i1 %171, label %172, label %176

172:                                              ; preds = %147
  %173 = load i64, ptr @mod, align 8, !tbaa !13
  %174 = load i64, ptr %8, align 8, !tbaa !13
  %175 = sub nsw i64 %174, %173
  store i64 %175, ptr %8, align 8, !tbaa !13
  br label %176

176:                                              ; preds = %172, %147
  br label %177

177:                                              ; preds = %176
  %178 = load i32, ptr %9, align 4, !tbaa !8
  %179 = add nsw i32 %178, 1
  store i32 %179, ptr %9, align 4, !tbaa !8
  br label %142, !llvm.loop !16

180:                                              ; preds = %146
  %181 = load i64, ptr %8, align 8, !tbaa !13
  %182 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %181)
  %183 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %182, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  ret i32 0
}

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

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 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 = { 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 = !{!14, !14, i64 0}
!14 = !{!"long long", !10, i64 0}
!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" }

@n = external dso_local global i32, align 4
@a = external dso_local global [100100 x i64], align 16
@mod = external dso_local global i64, align 8
@dp1 = external dso_local local_unnamed_addr global [100100 x i64], align 16
@dp2 = external dso_local local_unnamed_addr global [100100 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 @_Z6getfibx(i64 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) @n)
  %13 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %12, ptr noundef nonnull align 8 dereferenceable(8) @mod)
  %14 = load i32, ptr @n, align 4, !tbaa !8
  %.not39 = icmp slt i32 %14, 1
  br i1 %.not39, label %.._crit_edge_crit_edge, label %.lr.ph

.._crit_edge_crit_edge:                           ; preds = %0
  %.pre59 = sext i32 %14 to i64
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.._crit_edge_crit_edge
  %.pre-phi = phi i64 [ %.pre59, %.._crit_edge_crit_edge ], [ %33, %.lr.ph ]
  %15 = getelementptr inbounds [100100 x i64], ptr @a, i64 0, i64 %.pre-phi
  %16 = load i64, ptr %15, align 8, !tbaa !11
  %17 = add nsw i64 %16, 1
  %18 = tail call noundef i64 @_Z6getfibx(i64 noundef %17)
  %19 = load i32, ptr @n, align 4, !tbaa !8
  %20 = sext i32 %19 to i64
  %21 = getelementptr inbounds [100100 x i64], ptr @dp1, i64 0, i64 %20
  store i64 %18, ptr %21, align 8, !tbaa !11
  %22 = getelementptr inbounds [100100 x i64], ptr @a, i64 0, i64 %20
  %23 = load i64, ptr %22, align 8, !tbaa !11
  %24 = tail call noundef i64 @_Z6getfibx(i64 noundef %23)
  %25 = load i32, ptr @n, align 4, !tbaa !8
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds [100100 x i64], ptr @dp2, i64 0, i64 %26
  store i64 %24, ptr %27, align 8, !tbaa !11
  %28 = icmp sgt i32 %25, 1
  br i1 %28, label %.lr.ph43.preheader, label %.preheader

.lr.ph43.preheader:                               ; preds = %._crit_edge
  %29 = zext nneg i32 %25 to i64
  br label %.lr.ph43

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %0 ]
  %30 = getelementptr inbounds [100100 x i64], ptr @a, i64 0, i64 %indvars.iv
  %31 = 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) %30)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %32 = load i32, ptr @n, align 4, !tbaa !8
  %33 = sext i32 %32 to i64
  %.not.not = icmp slt i64 %indvars.iv, %33
  br i1 %.not.not, label %.lr.ph, label %._crit_edge, !llvm.loop !13

.preheader.loopexit:                              ; preds = %.lr.ph43
  %.pre = load i32, ptr @n, align 4, !tbaa !8
  br label %.preheader

.preheader:                                       ; preds = %.preheader.loopexit, %._crit_edge
  %34 = phi i32 [ %.pre, %.preheader.loopexit ], [ %25, %._crit_edge ]
  %.not3744 = icmp slt i32 %34, 1
  br i1 %.not3744, label %._crit_edge48, label %.lr.ph47

.lr.ph47:                                         ; preds = %.preheader
  %35 = load i64, ptr @mod, align 8, !tbaa !11
  %36 = add nuw i32 %34, 1
  %wide.trip.count = zext i32 %36 to i64
  br label %74

.lr.ph43:                                         ; preds = %.lr.ph43.preheader, %.lr.ph43
  %indvars.iv52 = phi i64 [ %29, %.lr.ph43.preheader ], [ %indvars.iv.next53, %.lr.ph43 ]
  %indvars.iv.next53 = add nsw i64 %indvars.iv52, -1
  %37 = getelementptr inbounds [100100 x i64], ptr @a, i64 0, i64 %indvars.iv.next53
  %38 = load i64, ptr %37, align 8, !tbaa !11
  %39 = add nsw i64 %38, 1
  %40 = tail call noundef i64 @_Z6getfibx(i64 noundef %39)
  %41 = load i64, ptr %37, align 8, !tbaa !11
  %42 = tail call noundef i64 @_Z6getfibx(i64 noundef %41)
  %43 = load i64, ptr %37, align 8, !tbaa !11
  %44 = add nsw i64 %43, -1
  %45 = tail call noundef i64 @_Z6getfibx(i64 noundef %44)
  %46 = load i64, ptr %37, align 8, !tbaa !11
  %47 = add nsw i64 %46, -2
  %48 = tail call noundef i64 @_Z6getfibx(i64 noundef %47)
  %49 = getelementptr inbounds [100100 x i64], ptr @dp1, i64 0, i64 %indvars.iv52
  %50 = load i64, ptr %49, align 8, !tbaa !11
  %51 = mul nsw i64 %50, %42
  %52 = load i64, ptr @mod, align 8, !tbaa !11
  %53 = srem i64 %51, %52
  %54 = getelementptr inbounds [100100 x i64], ptr @dp2, i64 0, i64 %indvars.iv52
  %55 = load i64, ptr %54, align 8, !tbaa !11
  %56 = mul nsw i64 %55, %45
  %57 = srem i64 %56, %52
  %58 = add nsw i64 %57, %53
  %59 = srem i64 %58, %52
  %60 = add nsw i64 %59, %40
  %61 = srem i64 %60, %52
  %62 = getelementptr inbounds [100100 x i64], ptr @dp1, i64 0, i64 %indvars.iv.next53
  store i64 %61, ptr %62, align 8, !tbaa !11
  %63 = mul nsw i64 %50, %45
  %64 = srem i64 %63, %52
  %65 = add nsw i64 %64, %42
  %66 = mul nsw i64 %55, %48
  %67 = srem i64 %66, %52
  %68 = add nsw i64 %65, %67
  %69 = srem i64 %68, %52
  %70 = getelementptr inbounds [100100 x i64], ptr @dp2, i64 0, i64 %indvars.iv.next53
  store i64 %69, ptr %70, align 8, !tbaa !11
  %71 = icmp ugt i64 %indvars.iv52, 2
  br i1 %71, label %.lr.ph43, label %.preheader.loopexit, !llvm.loop !15

._crit_edge48:                                    ; preds = %74, %.preheader
  %.029.lcssa = phi i64 [ 0, %.preheader ], [ %spec.select, %74 ]
  %72 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %.029.lcssa)
  %73 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %72, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  ret i32 0

74:                                               ; preds = %.lr.ph47, %74
  %indvars.iv55 = phi i64 [ 1, %.lr.ph47 ], [ %indvars.iv.next56, %74 ]
  %.02945 = phi i64 [ 0, %.lr.ph47 ], [ %spec.select, %74 ]
  %75 = getelementptr inbounds [100100 x i64], ptr @dp2, i64 0, i64 %indvars.iv55
  %76 = load i64, ptr %75, align 8, !tbaa !11
  %77 = shl nsw i64 %76, 1
  %78 = srem i64 %77, %35
  %79 = trunc i64 %indvars.iv55 to i32
  %80 = sub i32 %34, %79
  %81 = add i32 %80, 1
  %82 = sext i32 %81 to i64
  %83 = sub nsw i64 %78, %82
  %84 = srem i64 %83, %35
  %85 = add nsw i64 %84, %35
  %86 = srem i64 %85, %35
  %87 = add nsw i64 %86, %.02945
  %.not38 = icmp slt i64 %87, %35
  %88 = select i1 %.not38, i64 0, i64 %35
  %spec.select = sub nsw i64 %87, %88
  %indvars.iv.next56 = add nuw nsw i64 %indvars.iv55, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next56, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge48, label %74, !llvm.loop !16
}

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

; 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: 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)) #4

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

!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 = !{!12, !12, i64 0}
!12 = !{!"long long", !10, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}


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