; LLVM IR from eyangch/competitive-programming :: USACOcontests/gold/2013.11 (empty)

; 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
@K = external dso_local global i32, align 4
@c = external dso_local global [3000000 x i32], align 16
@q = external dso_local global i32, align 4
@.str = external hidden unnamed_addr constant [9 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@stdin = external global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@stdout = external global ptr, align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %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 i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %11 = load ptr, ptr @stdin, align 8, !tbaa !5
  %12 = call ptr @freopen(ptr noundef @.str, ptr noundef @.str.1, ptr noundef %11)
  %13 = load ptr, ptr @stdout, align 8, !tbaa !5
  %14 = call ptr @freopen(ptr noundef @.str.2, ptr noundef @.str.3, ptr noundef %13)
  %15 = 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)
  %16 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %15, ptr noundef nonnull align 4 dereferenceable(4) @K)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  store i32 0, ptr %2, align 4, !tbaa !9
  br label %17

17:                                               ; preds = %53, %0
  %18 = load i32, ptr %2, align 4, !tbaa !9
  %19 = load i32, ptr @K, align 4, !tbaa !9
  %20 = icmp slt i32 %18, %19
  br i1 %20, label %22, label %21

21:                                               ; preds = %17
  store i32 2, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  br label %56

22:                                               ; preds = %17
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %23 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %24 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %23, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %25 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %24, ptr noundef nonnull align 8 dereferenceable(8) %6)
  %26 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %25, ptr noundef nonnull align 8 dereferenceable(8) %7)
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 1, ptr %8, align 4, !tbaa !9
  br label %27

27:                                               ; preds = %49, %22
  %28 = load i32, ptr %8, align 4, !tbaa !9
  %29 = sext i32 %28 to i64
  %30 = load i64, ptr %5, align 8, !tbaa !11
  %31 = icmp sle i64 %29, %30
  br i1 %31, label %33, label %32

32:                                               ; preds = %27
  store i32 5, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %52

33:                                               ; preds = %27
  %34 = load i64, ptr %4, align 8, !tbaa !11
  %35 = load i64, ptr %6, align 8, !tbaa !11
  %36 = load i32, ptr %8, align 4, !tbaa !9
  %37 = sext i32 %36 to i64
  %38 = mul nsw i64 %35, %37
  %39 = load i64, ptr %7, align 8, !tbaa !11
  %40 = add nsw i64 %38, %39
  %41 = load i32, ptr @N, align 4, !tbaa !9
  %42 = sext i32 %41 to i64
  %43 = srem i64 %40, %42
  %44 = getelementptr inbounds [3000000 x i32], ptr @c, i64 0, i64 %43
  %45 = load i32, ptr %44, align 4, !tbaa !9
  %46 = sext i32 %45 to i64
  %47 = add nsw i64 %46, %34
  %48 = trunc i64 %47 to i32
  store i32 %48, ptr %44, align 4, !tbaa !9
  br label %49

49:                                               ; preds = %33
  %50 = load i32, ptr %8, align 4, !tbaa !9
  %51 = add nsw i32 %50, 1
  store i32 %51, ptr %8, align 4, !tbaa !9
  br label %27, !llvm.loop !13

52:                                               ; preds = %32
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  br label %53

53:                                               ; preds = %52
  %54 = load i32, ptr %2, align 4, !tbaa !9
  %55 = add nsw i32 %54, 1
  store i32 %55, ptr %2, align 4, !tbaa !9
  br label %17, !llvm.loop !15

56:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %57

57:                                               ; preds = %81, %56
  %58 = load i32, ptr %9, align 4, !tbaa !9
  %59 = load i32, ptr @N, align 4, !tbaa !9
  %60 = icmp slt i32 %58, %59
  br i1 %60, label %62, label %61

61:                                               ; preds = %57
  store i32 8, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %84

62:                                               ; preds = %57
  %63 = load i32, ptr %9, align 4, !tbaa !9
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [3000000 x i32], ptr @c, i64 0, i64 %64
  %66 = load i32, ptr %65, align 4, !tbaa !9
  %67 = load i32, ptr @q, align 4, !tbaa !9
  %68 = add nsw i32 %67, %66
  store i32 %68, ptr @q, align 4, !tbaa !9
  %69 = load i32, ptr %9, align 4, !tbaa !9
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [3000000 x i32], ptr @c, i64 0, i64 %70
  store i32 0, ptr %71, align 4, !tbaa !9
  %72 = load i32, ptr @q, align 4, !tbaa !9
  %73 = icmp ne i32 %72, 0
  br i1 %73, label %74, label %80

74:                                               ; preds = %62
  %75 = load i32, ptr %9, align 4, !tbaa !9
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [3000000 x i32], ptr @c, i64 0, i64 %76
  store i32 1, ptr %77, align 4, !tbaa !9
  %78 = load i32, ptr @q, align 4, !tbaa !9
  %79 = add nsw i32 %78, -1
  store i32 %79, ptr @q, align 4, !tbaa !9
  br label %80

80:                                               ; preds = %74, %62
  br label %81

81:                                               ; preds = %80
  %82 = load i32, ptr %9, align 4, !tbaa !9
  %83 = add nsw i32 %82, 1
  store i32 %83, ptr %9, align 4, !tbaa !9
  br label %57, !llvm.loop !16

84:                                               ; preds = %61
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 0, ptr %10, align 4, !tbaa !9
  br label %85

85:                                               ; preds = %113, %84
  %86 = load i32, ptr %10, align 4, !tbaa !9
  %87 = load i32, ptr @N, align 4, !tbaa !9
  %88 = icmp slt i32 %86, %87
  br i1 %88, label %90, label %89

89:                                               ; preds = %85
  store i32 11, ptr %3, align 4
  br label %116

90:                                               ; preds = %85
  %91 = load i32, ptr @q, align 4, !tbaa !9
  %92 = icmp ne i32 %91, 0
  br i1 %92, label %103, label %93

93:                                               ; preds = %90
  %94 = load i32, ptr %10, align 4, !tbaa !9
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [3000000 x i32], ptr @c, i64 0, i64 %95
  %97 = load i32, ptr %96, align 4, !tbaa !9
  %98 = icmp ne i32 %97, 0
  br i1 %98, label %103, label %99

99:                                               ; preds = %93
  %100 = load i32, ptr %10, align 4, !tbaa !9
  %101 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %100)
  %102 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %101, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 11, ptr %3, align 4
  br label %116

103:                                              ; preds = %93, %90
  %104 = load i32, ptr %10, align 4, !tbaa !9
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [3000000 x i32], ptr @c, i64 0, i64 %105
  %107 = load i32, ptr %106, align 4, !tbaa !9
  %108 = icmp ne i32 %107, 0
  br i1 %108, label %112, label %109

109:                                              ; preds = %103
  %110 = load i32, ptr @q, align 4, !tbaa !9
  %111 = add nsw i32 %110, -1
  store i32 %111, ptr @q, align 4, !tbaa !9
  br label %112

112:                                              ; preds = %109, %103
  br label %113

113:                                              ; preds = %112
  %114 = load i32, ptr %10, align 4, !tbaa !9
  %115 = add nsw i32 %114, 1
  store i32 %115, ptr %10, align 4, !tbaa !9
  br label %85, !llvm.loop !17

116:                                              ; preds = %99, %89
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %117

117:                                              ; preds = %116
  %118 = load i32, ptr %1, align 4
  ret i32 %118
}

declare ptr @freopen(ptr noundef, ptr noundef, ptr noundef) #1

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #1

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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)) #3 align 2

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

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

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

attributes #0 = { 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 #1 = { "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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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" }
attributes #5 = { 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long long", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !14}


; 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
@K = external dso_local global i32, align 4
@c = external dso_local local_unnamed_addr global [3000000 x i32], align 16
@q = external dso_local local_unnamed_addr global i32, align 4
@.str = external hidden unnamed_addr constant [9 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@stdin = external local_unnamed_addr global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@stdout = external local_unnamed_addr global ptr, align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i64, align 8
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = load ptr, ptr @stdin, align 8, !tbaa !5
  %6 = tail call ptr @freopen(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, ptr noundef %5)
  %7 = load ptr, ptr @stdout, align 8, !tbaa !5
  %8 = tail call ptr @freopen(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.3, ptr noundef %7)
  %9 = 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)
  %10 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef nonnull align 4 dereferenceable(4) @K)
  %11 = load i32, ptr @K, align 4, !tbaa !9
  %12 = icmp sgt i32 %11, 0
  br i1 %12, label %.lr.ph30, label %.preheader24

.preheader24:                                     ; preds = %._crit_edge, %0
  %13 = load i32, ptr @N, align 4, !tbaa !9
  %14 = icmp sgt i32 %13, 0
  br i1 %14, label %.lr.ph32.preheader, label %.loopexit

.lr.ph32.preheader:                               ; preds = %.preheader24
  %q.promoted = load i32, ptr @q, align 4, !tbaa !9
  %wide.trip.count = zext nneg i32 %13 to i64
  %xtraiter54 = and i64 %wide.trip.count, 1
  %15 = icmp eq i32 %13, 1
  br i1 %15, label %.preheader.unr-lcssa, label %.lr.ph32.preheader.new

.lr.ph32.preheader.new:                           ; preds = %.lr.ph32.preheader
  %unroll_iter57 = and i64 %wide.trip.count, 2147483646
  br label %.lr.ph32

.lr.ph30:                                         ; preds = %0, %._crit_edge
  %.01828 = phi i32 [ %34, %._crit_edge ], [ 0, %0 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  %16 = 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)
  %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) %2)
  %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) %3)
  %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) %4)
  %20 = load i64, ptr %2, align 8, !tbaa !11
  %.not2326 = icmp slt i64 %20, 1
  br i1 %.not2326, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph30
  %21 = load i64, ptr %1, align 8, !tbaa !11
  %22 = load i64, ptr %3, align 8, !tbaa !11
  %23 = load i64, ptr %4, align 8, !tbaa !11
  %24 = load i32, ptr @N, align 4, !tbaa !9
  %25 = sext i32 %24 to i64
  %26 = trunc i64 %21 to i32
  %xtraiter = and i64 %20, 1
  %27 = icmp eq i64 %20, 1
  br i1 %27, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph.new

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

._crit_edge.loopexit.unr-lcssa:                   ; preds = %37, %.lr.ph
  %indvars.iv.unr = phi i64 [ 1, %.lr.ph ], [ %indvars.iv.next.1, %37 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge, label %._crit_edge.loopexit.epilog-lcssa

._crit_edge.loopexit.epilog-lcssa:                ; preds = %._crit_edge.loopexit.unr-lcssa
  %28 = mul nsw i64 %22, %indvars.iv.unr
  %29 = add nsw i64 %28, %23
  %30 = srem i64 %29, %25
  %31 = getelementptr inbounds [3000000 x i32], ptr @c, i64 0, i64 %30
  %32 = load i32, ptr %31, align 4, !tbaa !9
  %33 = add i32 %32, %26
  store i32 %33, ptr %31, align 4, !tbaa !9
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit.epilog-lcssa, %._crit_edge.loopexit.unr-lcssa, %.lr.ph30
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #5
  %34 = add nuw nsw i32 %.01828, 1
  %35 = load i32, ptr @K, align 4, !tbaa !9
  %36 = icmp slt i32 %34, %35
  br i1 %36, label %.lr.ph30, label %.preheader24, !llvm.loop !13

37:                                               ; preds = %37, %.lr.ph.new
  %indvars.iv = phi i64 [ 1, %.lr.ph.new ], [ %indvars.iv.next.1, %37 ]
  %niter = phi i64 [ 0, %.lr.ph.new ], [ %niter.next.1, %37 ]
  %38 = mul nsw i64 %22, %indvars.iv
  %39 = add nsw i64 %38, %23
  %40 = srem i64 %39, %25
  %41 = getelementptr inbounds [3000000 x i32], ptr @c, i64 0, i64 %40
  %42 = load i32, ptr %41, align 4, !tbaa !9
  %43 = add i32 %42, %26
  store i32 %43, ptr %41, align 4, !tbaa !9
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %44 = mul nsw i64 %22, %indvars.iv.next
  %45 = add nsw i64 %44, %23
  %46 = srem i64 %45, %25
  %47 = getelementptr inbounds [3000000 x i32], ptr @c, i64 0, i64 %46
  %48 = load i32, ptr %47, align 4, !tbaa !9
  %49 = add i32 %48, %26
  store i32 %49, ptr %47, align 4, !tbaa !9
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 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 %37, !llvm.loop !15

.preheader.unr-lcssa:                             ; preds = %67, %.lr.ph32.preheader
  %.lcssa.ph = phi i32 [ poison, %.lr.ph32.preheader ], [ %68, %67 ]
  %indvars.iv39.unr = phi i64 [ 0, %.lr.ph32.preheader ], [ %indvars.iv.next40.1, %67 ]
  %.unr = phi i32 [ %q.promoted, %.lr.ph32.preheader ], [ %68, %67 ]
  %lcmp.mod55.not = icmp eq i64 %xtraiter54, 0
  br i1 %lcmp.mod55.not, label %.preheader, label %.lr.ph32.epil

.lr.ph32.epil:                                    ; preds = %.preheader.unr-lcssa
  %50 = getelementptr inbounds [3000000 x i32], ptr @c, i64 0, i64 %indvars.iv39.unr
  %51 = load i32, ptr %50, align 4, !tbaa !9
  %52 = add nsw i32 %.unr, %51
  store i32 0, ptr %50, align 4, !tbaa !9
  %.not22.epil = icmp eq i32 %52, 0
  br i1 %.not22.epil, label %.preheader, label %53

53:                                               ; preds = %.lr.ph32.epil
  store i32 1, ptr %50, align 4, !tbaa !9
  %54 = add nsw i32 %52, -1
  br label %.preheader

.preheader:                                       ; preds = %.lr.ph32.epil, %53, %.preheader.unr-lcssa
  %.lcssa = phi i32 [ %.lcssa.ph, %.preheader.unr-lcssa ], [ 0, %.lr.ph32.epil ], [ %54, %53 ]
  store i32 %.lcssa, ptr @q, align 4, !tbaa !9
  br i1 %14, label %.lr.ph36.preheader, label %.loopexit

.lr.ph36.preheader:                               ; preds = %.preheader
  %wide.trip.count46 = zext nneg i32 %13 to i64
  br label %.lr.ph36

.lr.ph32:                                         ; preds = %67, %.lr.ph32.preheader.new
  %indvars.iv39 = phi i64 [ 0, %.lr.ph32.preheader.new ], [ %indvars.iv.next40.1, %67 ]
  %55 = phi i32 [ %q.promoted, %.lr.ph32.preheader.new ], [ %68, %67 ]
  %niter58 = phi i64 [ 0, %.lr.ph32.preheader.new ], [ %niter58.next.1, %67 ]
  %56 = getelementptr inbounds [3000000 x i32], ptr @c, i64 0, i64 %indvars.iv39
  %57 = load i32, ptr %56, align 8, !tbaa !9
  %58 = add nsw i32 %55, %57
  store i32 0, ptr %56, align 8, !tbaa !9
  %.not22 = icmp eq i32 %58, 0
  br i1 %.not22, label %.lr.ph32.1, label %59

59:                                               ; preds = %.lr.ph32
  store i32 1, ptr %56, align 8, !tbaa !9
  %60 = add nsw i32 %58, -1
  br label %.lr.ph32.1

.lr.ph32.1:                                       ; preds = %.lr.ph32, %59
  %61 = phi i32 [ 0, %.lr.ph32 ], [ %60, %59 ]
  %indvars.iv.next40 = or disjoint i64 %indvars.iv39, 1
  %62 = getelementptr inbounds [3000000 x i32], ptr @c, i64 0, i64 %indvars.iv.next40
  %63 = load i32, ptr %62, align 4, !tbaa !9
  %64 = add nsw i32 %61, %63
  store i32 0, ptr %62, align 4, !tbaa !9
  %.not22.1 = icmp eq i32 %64, 0
  br i1 %.not22.1, label %67, label %65

65:                                               ; preds = %.lr.ph32.1
  store i32 1, ptr %62, align 4, !tbaa !9
  %66 = add nsw i32 %64, -1
  br label %67

67:                                               ; preds = %65, %.lr.ph32.1
  %68 = phi i32 [ 0, %.lr.ph32.1 ], [ %66, %65 ]
  %indvars.iv.next40.1 = add nuw nsw i64 %indvars.iv39, 2
  %niter58.next.1 = add i64 %niter58, 2
  %niter58.ncmp.1 = icmp eq i64 %niter58.next.1, %unroll_iter57
  br i1 %niter58.ncmp.1, label %.preheader.unr-lcssa, label %.lr.ph32, !llvm.loop !16

.lr.ph36:                                         ; preds = %.lr.ph36.preheader, %.thread
  %indvars.iv43 = phi i64 [ 0, %.lr.ph36.preheader ], [ %indvars.iv.next44, %.thread ]
  %69 = phi i32 [ %.lcssa, %.lr.ph36.preheader ], [ %80, %.thread ]
  %.not = icmp eq i32 %69, 0
  %70 = getelementptr inbounds [3000000 x i32], ptr @c, i64 0, i64 %indvars.iv43
  %71 = load i32, ptr %70, align 4, !tbaa !9
  %.not20 = icmp eq i32 %71, 0
  br i1 %.not, label %72, label %77

72:                                               ; preds = %.lr.ph36
  br i1 %.not20, label %73, label %.thread

73:                                               ; preds = %72
  %74 = trunc nuw nsw i64 %indvars.iv43 to i32
  %75 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %74)
  %76 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %75, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %.loopexit

77:                                               ; preds = %.lr.ph36
  br i1 %.not20, label %78, label %.thread

78:                                               ; preds = %77
  %79 = add nsw i32 %69, -1
  store i32 %79, ptr @q, align 4, !tbaa !9
  br label %.thread

.thread:                                          ; preds = %72, %77, %78
  %80 = phi i32 [ %69, %77 ], [ %79, %78 ], [ 0, %72 ]
  %indvars.iv.next44 = add nuw nsw i64 %indvars.iv43, 1
  %exitcond47.not = icmp eq i64 %indvars.iv.next44, %wide.trip.count46
  br i1 %exitcond47.not, label %.loopexit, label %.lr.ph36, !llvm.loop !17

.loopexit:                                        ; preds = %.thread, %.preheader24, %.preheader, %73
  ret i32 0
}

declare ptr @freopen(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2

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

; 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 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 #1 = { "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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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" }
attributes #5 = { 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long long", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !14}


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