; LLVM IR from VastoLorde95/Competitive-Programming :: CodeChef/LONG/JULY15/ADDMUL (brute)

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

@n = external dso_local global i32, align 4
@q = 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
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = external hidden unnamed_addr constant [6 x i8], align 1

; 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 i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i64, align 8
  %11 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %12 = 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 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %12, ptr noundef nonnull align 4 dereferenceable(4) @q)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %14

14:                                               ; preds = %24, %0
  %15 = load i32, ptr %2, align 4, !tbaa !5
  %16 = load i32, ptr @n, align 4, !tbaa !5
  %17 = icmp slt i32 %15, %16
  br i1 %17, label %19, label %18

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

19:                                               ; preds = %14
  %20 = load i32, ptr %2, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds [100100 x i64], ptr @a, i64 0, i64 %21
  %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) %22)
  br label %24

24:                                               ; preds = %19
  %25 = load i32, ptr %2, align 4, !tbaa !5
  %26 = add nsw i32 %25, 1
  store i32 %26, ptr %2, align 4, !tbaa !5
  br label %14, !llvm.loop !9

27:                                               ; preds = %18
  br label %28

28:                                               ; preds = %158, %27
  %29 = load i32, ptr @q, align 4, !tbaa !5
  %30 = add nsw i32 %29, -1
  store i32 %30, ptr @q, align 4, !tbaa !5
  %31 = icmp ne i32 %29, 0
  br i1 %31, label %32, label %159

32:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  %33 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %34 = load i32, ptr %3, align 4, !tbaa !5
  %35 = icmp eq i32 %34, 1
  br i1 %35, label %36, label %67

36:                                               ; preds = %32
  %37 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %38 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %37, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %39 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %38, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %40 = load i32, ptr %4, align 4, !tbaa !5
  %41 = add nsw i32 %40, -1
  store i32 %41, ptr %4, align 4, !tbaa !5
  %42 = load i32, ptr %5, align 4, !tbaa !5
  %43 = add nsw i32 %42, -1
  store i32 %43, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  %44 = load i32, ptr %4, align 4, !tbaa !5
  store i32 %44, ptr %7, align 4, !tbaa !5
  br label %45

45:                                               ; preds = %63, %36
  %46 = load i32, ptr %7, align 4, !tbaa !5
  %47 = load i32, ptr %5, align 4, !tbaa !5
  %48 = icmp sle i32 %46, %47
  br i1 %48, label %50, label %49

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

50:                                               ; preds = %45
  %51 = load i32, ptr %7, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [100100 x i64], ptr @a, i64 0, i64 %52
  %54 = load i64, ptr %53, align 8, !tbaa !11
  %55 = load i32, ptr %6, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = add nsw i64 %54, %56
  %58 = load i64, ptr @MOD, align 8, !tbaa !11
  %59 = srem i64 %57, %58
  %60 = load i32, ptr %7, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [100100 x i64], ptr @a, i64 0, i64 %61
  store i64 %59, ptr %62, align 8, !tbaa !11
  br label %63

63:                                               ; preds = %50
  %64 = load i32, ptr %7, align 4, !tbaa !5
  %65 = add nsw i32 %64, 1
  store i32 %65, ptr %7, align 4, !tbaa !5
  br label %45, !llvm.loop !13

66:                                               ; preds = %49
  br label %158

67:                                               ; preds = %32
  %68 = load i32, ptr %3, align 4, !tbaa !5
  %69 = icmp eq i32 %68, 2
  br i1 %69, label %70, label %101

70:                                               ; preds = %67
  %71 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %72 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %71, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %73 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %72, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %74 = load i32, ptr %4, align 4, !tbaa !5
  %75 = add nsw i32 %74, -1
  store i32 %75, ptr %4, align 4, !tbaa !5
  %76 = load i32, ptr %5, align 4, !tbaa !5
  %77 = add nsw i32 %76, -1
  store i32 %77, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  %78 = load i32, ptr %4, align 4, !tbaa !5
  store i32 %78, ptr %8, align 4, !tbaa !5
  br label %79

79:                                               ; preds = %97, %70
  %80 = load i32, ptr %8, align 4, !tbaa !5
  %81 = load i32, ptr %5, align 4, !tbaa !5
  %82 = icmp sle i32 %80, %81
  br i1 %82, label %84, label %83

83:                                               ; preds = %79
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  br label %100

84:                                               ; preds = %79
  %85 = load i32, ptr %8, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [100100 x i64], ptr @a, i64 0, i64 %86
  %88 = load i64, ptr %87, align 8, !tbaa !11
  %89 = load i32, ptr %6, align 4, !tbaa !5
  %90 = sext i32 %89 to i64
  %91 = mul nsw i64 %88, %90
  %92 = load i64, ptr @MOD, align 8, !tbaa !11
  %93 = srem i64 %91, %92
  %94 = load i32, ptr %8, align 4, !tbaa !5
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [100100 x i64], ptr @a, i64 0, i64 %95
  store i64 %93, ptr %96, align 8, !tbaa !11
  br label %97

97:                                               ; preds = %84
  %98 = load i32, ptr %8, align 4, !tbaa !5
  %99 = add nsw i32 %98, 1
  store i32 %99, ptr %8, align 4, !tbaa !5
  br label %79, !llvm.loop !14

100:                                              ; preds = %83
  br label %157

101:                                              ; preds = %67
  %102 = load i32, ptr %3, align 4, !tbaa !5
  %103 = icmp eq i32 %102, 3
  br i1 %103, label %104, label %128

104:                                              ; preds = %101
  %105 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %106 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %105, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %107 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %106, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %108 = load i32, ptr %4, align 4, !tbaa !5
  %109 = add nsw i32 %108, -1
  store i32 %109, ptr %4, align 4, !tbaa !5
  %110 = load i32, ptr %5, align 4, !tbaa !5
  %111 = add nsw i32 %110, -1
  store i32 %111, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  %112 = load i32, ptr %4, align 4, !tbaa !5
  store i32 %112, ptr %9, align 4, !tbaa !5
  br label %113

113:                                              ; preds = %124, %104
  %114 = load i32, ptr %9, align 4, !tbaa !5
  %115 = load i32, ptr %5, align 4, !tbaa !5
  %116 = icmp sle i32 %114, %115
  br i1 %116, label %118, label %117

117:                                              ; preds = %113
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  br label %127

118:                                              ; preds = %113
  %119 = load i32, ptr %6, align 4, !tbaa !5
  %120 = sext i32 %119 to i64
  %121 = load i32, ptr %9, align 4, !tbaa !5
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds [100100 x i64], ptr @a, i64 0, i64 %122
  store i64 %120, ptr %123, align 8, !tbaa !11
  br label %124

124:                                              ; preds = %118
  %125 = load i32, ptr %9, align 4, !tbaa !5
  %126 = add nsw i32 %125, 1
  store i32 %126, ptr %9, align 4, !tbaa !5
  br label %113, !llvm.loop !15

127:                                              ; preds = %117
  br label %156

128:                                              ; preds = %101
  %129 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %130 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %129, ptr noundef nonnull align 4 dereferenceable(4) %5)
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  store i64 0, ptr %10, align 8, !tbaa !11
  %131 = load i32, ptr %4, align 4, !tbaa !5
  %132 = add nsw i32 %131, -1
  store i32 %132, ptr %4, align 4, !tbaa !5
  %133 = load i32, ptr %5, align 4, !tbaa !5
  %134 = add nsw i32 %133, -1
  store i32 %134, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  %135 = load i32, ptr %4, align 4, !tbaa !5
  store i32 %135, ptr %11, align 4, !tbaa !5
  br label %136

136:                                              ; preds = %150, %128
  %137 = load i32, ptr %11, align 4, !tbaa !5
  %138 = load i32, ptr %5, align 4, !tbaa !5
  %139 = icmp sle i32 %137, %138
  br i1 %139, label %141, label %140

140:                                              ; preds = %136
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  br label %153

141:                                              ; preds = %136
  %142 = load i64, ptr %10, align 8, !tbaa !11
  %143 = load i32, ptr %11, align 4, !tbaa !5
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds [100100 x i64], ptr @a, i64 0, i64 %144
  %146 = load i64, ptr %145, align 8, !tbaa !11
  %147 = add nsw i64 %142, %146
  %148 = load i64, ptr @MOD, align 8, !tbaa !11
  %149 = srem i64 %147, %148
  store i64 %149, ptr %10, align 8, !tbaa !11
  br label %150

150:                                              ; preds = %141
  %151 = load i32, ptr %11, align 4, !tbaa !5
  %152 = add nsw i32 %151, 1
  store i32 %152, ptr %11, align 4, !tbaa !5
  br label %136, !llvm.loop !16

153:                                              ; preds = %140
  %154 = load i64, ptr %10, align 8, !tbaa !11
  %155 = call i32 (ptr, ...) @printf(ptr noundef @.str, i64 noundef %154)
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  br label %156

156:                                              ; preds = %153, %127
  br label %157

157:                                              ; preds = %156, %100
  br label %158

158:                                              ; preds = %157, %66
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  br label %28, !llvm.loop !17

159:                                              ; preds = %28
  ret i32 0
}

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 i32 @printf(ptr noundef, ...) #1

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 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"long long", !7, i64 0}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}


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

@n = external dso_local global i32, align 4
@q = external dso_local global i32, align 4
@a = external dso_local global [100100 x i64], align 16
@MOD = external dso_local local_unnamed_addr global i64, align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = 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)
  %6 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 4 dereferenceable(4) @q)
  %7 = load i32, ptr @n, align 4, !tbaa !5
  %8 = icmp sgt i32 %7, 0
  br i1 %8, label %.lr.ph, label %.preheader

.preheader:                                       ; preds = %.lr.ph, %0
  %9 = load i32, ptr @q, align 4, !tbaa !5
  %10 = add nsw i32 %9, -1
  store i32 %10, ptr @q, align 4, !tbaa !5
  %.not45 = icmp eq i32 %9, 0
  br i1 %.not45, label %._crit_edge47, label %.lr.ph46

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %11 = getelementptr inbounds [100100 x i64], ptr @a, i64 0, i64 %indvars.iv
  %12 = 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) %11)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %13 = load i32, ptr @n, align 4, !tbaa !5
  %14 = sext i32 %13 to i64
  %15 = icmp slt i64 %indvars.iv.next, %14
  br i1 %15, label %.lr.ph, label %.preheader, !llvm.loop !9

.lr.ph46:                                         ; preds = %.preheader, %.loopexit
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #5
  %16 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %17 = load i32, ptr %1, align 4, !tbaa !5
  %18 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %19 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %18, ptr noundef nonnull align 4 dereferenceable(4) %3)
  switch i32 %17, label %83 [
    i32 1, label %20
    i32 2, label %44
    i32 3, label %68
  ]

20:                                               ; preds = %.lr.ph46
  %21 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %19, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %22 = load i32, ptr %2, align 4, !tbaa !5
  %23 = load i32, ptr %3, align 4, !tbaa !5
  %.not28.not38.not = icmp sgt i32 %22, %23
  br i1 %.not28.not38.not, label %.loopexit, label %.lr.ph40

.lr.ph40:                                         ; preds = %20
  %24 = add i32 %22, -1
  %25 = load i32, ptr %4, align 4, !tbaa !5
  %26 = sext i32 %25 to i64
  %27 = load i64, ptr @MOD, align 8, !tbaa !11
  %28 = sext i32 %24 to i64
  %29 = add i32 %23, %22
  %30 = and i32 %29, 1
  %lcmp.mod78.not.not = icmp eq i32 %30, 0
  br i1 %lcmp.mod78.not.not, label %.prol.loopexit76.unr-lcssa, label %.prol.loopexit76

.prol.loopexit76.unr-lcssa:                       ; preds = %.lr.ph40
  %31 = getelementptr inbounds [100100 x i64], ptr @a, i64 0, i64 %28
  %32 = load i64, ptr %31, align 8, !tbaa !11
  %33 = add nsw i64 %32, %26
  %34 = srem i64 %33, %27
  store i64 %34, ptr %31, align 8, !tbaa !11
  %indvars.iv.next60.prol = add nsw i64 %28, 1
  br label %.prol.loopexit76

.prol.loopexit76:                                 ; preds = %.prol.loopexit76.unr-lcssa, %.lr.ph40
  %indvars.iv59.unr = phi i64 [ %28, %.lr.ph40 ], [ %indvars.iv.next60.prol, %.prol.loopexit76.unr-lcssa ]
  %35 = icmp eq i32 %23, %22
  br i1 %35, label %.loopexit, label %.lr.ph40.new

.lr.ph40.new:                                     ; preds = %.prol.loopexit76, %.lr.ph40.new
  %indvars.iv59 = phi i64 [ %indvars.iv.next60.1, %.lr.ph40.new ], [ %indvars.iv59.unr, %.prol.loopexit76 ]
  %36 = getelementptr inbounds [100100 x i64], ptr @a, i64 0, i64 %indvars.iv59
  %37 = load i64, ptr %36, align 8, !tbaa !11
  %38 = add nsw i64 %37, %26
  %39 = srem i64 %38, %27
  store i64 %39, ptr %36, align 8, !tbaa !11
  %indvars.iv.next60 = add nsw i64 %indvars.iv59, 1
  %40 = getelementptr inbounds [100100 x i64], ptr @a, i64 0, i64 %indvars.iv.next60
  %41 = load i64, ptr %40, align 8, !tbaa !11
  %42 = add nsw i64 %41, %26
  %43 = srem i64 %42, %27
  store i64 %43, ptr %40, align 8, !tbaa !11
  %indvars.iv.next60.1 = add nsw i64 %indvars.iv59, 2
  %lftr.wideiv62.1 = trunc i64 %indvars.iv.next60.1 to i32
  %exitcond63.not.1 = icmp eq i32 %23, %lftr.wideiv62.1
  br i1 %exitcond63.not.1, label %.loopexit, label %.lr.ph40.new, !llvm.loop !13

44:                                               ; preds = %.lr.ph46
  %45 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %19, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %46 = load i32, ptr %2, align 4, !tbaa !5
  %47 = load i32, ptr %3, align 4, !tbaa !5
  %.not27.not35.not = icmp sgt i32 %46, %47
  br i1 %.not27.not35.not, label %.loopexit, label %.lr.ph37

.lr.ph37:                                         ; preds = %44
  %48 = add i32 %46, -1
  %49 = load i32, ptr %4, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = load i64, ptr @MOD, align 8, !tbaa !11
  %52 = sext i32 %48 to i64
  %53 = add i32 %47, %46
  %54 = and i32 %53, 1
  %lcmp.mod.not.not = icmp eq i32 %54, 0
  br i1 %lcmp.mod.not.not, label %.prol.loopexit.unr-lcssa, label %.prol.loopexit

.prol.loopexit.unr-lcssa:                         ; preds = %.lr.ph37
  %55 = getelementptr inbounds [100100 x i64], ptr @a, i64 0, i64 %52
  %56 = load i64, ptr %55, align 8, !tbaa !11
  %57 = mul nsw i64 %56, %50
  %58 = srem i64 %57, %51
  store i64 %58, ptr %55, align 8, !tbaa !11
  %indvars.iv.next55.prol = add nsw i64 %52, 1
  br label %.prol.loopexit

.prol.loopexit:                                   ; preds = %.prol.loopexit.unr-lcssa, %.lr.ph37
  %indvars.iv54.unr = phi i64 [ %52, %.lr.ph37 ], [ %indvars.iv.next55.prol, %.prol.loopexit.unr-lcssa ]
  %59 = icmp eq i32 %47, %46
  br i1 %59, label %.loopexit, label %.lr.ph37.new

.lr.ph37.new:                                     ; preds = %.prol.loopexit, %.lr.ph37.new
  %indvars.iv54 = phi i64 [ %indvars.iv.next55.1, %.lr.ph37.new ], [ %indvars.iv54.unr, %.prol.loopexit ]
  %60 = getelementptr inbounds [100100 x i64], ptr @a, i64 0, i64 %indvars.iv54
  %61 = load i64, ptr %60, align 8, !tbaa !11
  %62 = mul nsw i64 %61, %50
  %63 = srem i64 %62, %51
  store i64 %63, ptr %60, align 8, !tbaa !11
  %indvars.iv.next55 = add nsw i64 %indvars.iv54, 1
  %64 = getelementptr inbounds [100100 x i64], ptr @a, i64 0, i64 %indvars.iv.next55
  %65 = load i64, ptr %64, align 8, !tbaa !11
  %66 = mul nsw i64 %65, %50
  %67 = srem i64 %66, %51
  store i64 %67, ptr %64, align 8, !tbaa !11
  %indvars.iv.next55.1 = add nsw i64 %indvars.iv54, 2
  %lftr.wideiv57.1 = trunc i64 %indvars.iv.next55.1 to i32
  %exitcond58.not.1 = icmp eq i32 %47, %lftr.wideiv57.1
  br i1 %exitcond58.not.1, label %.loopexit, label %.lr.ph37.new, !llvm.loop !14

68:                                               ; preds = %.lr.ph46
  %69 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %19, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %70 = load i32, ptr %2, align 4, !tbaa !5
  %71 = load i32, ptr %3, align 4, !tbaa !5
  %.not26.not32.not = icmp sgt i32 %70, %71
  br i1 %.not26.not32.not, label %.loopexit, label %.lr.ph34

.lr.ph34:                                         ; preds = %68
  %72 = add i32 %70, -1
  %73 = load i32, ptr %4, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = sext i32 %72 to i64
  %76 = sub i32 %71, %70
  %77 = zext i32 %76 to i64
  %78 = add nuw nsw i64 %77, 1
  %min.iters.check = icmp ult i32 %76, 3
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph34
  %n.vec = and i64 %78, 8589934588
  %ind.end = add nsw i64 %n.vec, %75
  %broadcast.splatinsert = insertelement <2 x i64> poison, i64 %74, i64 0
  %broadcast.splat = shufflevector <2 x i64> %broadcast.splatinsert, <2 x i64> poison, <2 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %offset.idx = add i64 %index, %75
  %79 = getelementptr inbounds [100100 x i64], ptr @a, i64 0, i64 %offset.idx
  %80 = getelementptr inbounds i8, ptr %79, i64 16
  store <2 x i64> %broadcast.splat, ptr %79, align 8, !tbaa !11
  store <2 x i64> %broadcast.splat, ptr %80, align 8, !tbaa !11
  %index.next = add nuw i64 %index, 4
  %81 = icmp eq i64 %index.next, %n.vec
  br i1 %81, label %middle.block, label %vector.body, !llvm.loop !15

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %78, %n.vec
  br i1 %cmp.n, label %.loopexit, label %scalar.ph.preheader

scalar.ph.preheader:                              ; preds = %middle.block, %.lr.ph34
  %indvars.iv51.ph = phi i64 [ %75, %.lr.ph34 ], [ %ind.end, %middle.block ]
  br label %scalar.ph

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv51 = phi i64 [ %indvars.iv.next52, %scalar.ph ], [ %indvars.iv51.ph, %scalar.ph.preheader ]
  %82 = getelementptr inbounds [100100 x i64], ptr @a, i64 0, i64 %indvars.iv51
  store i64 %74, ptr %82, align 8, !tbaa !11
  %indvars.iv.next52 = add nsw i64 %indvars.iv51, 1
  %lftr.wideiv = trunc i64 %indvars.iv.next52 to i32
  %exitcond.not = icmp eq i32 %71, %lftr.wideiv
  br i1 %exitcond.not, label %.loopexit, label %scalar.ph, !llvm.loop !18

83:                                               ; preds = %.lr.ph46
  %84 = load i32, ptr %2, align 4, !tbaa !5
  %85 = add i32 %84, -1
  store i32 %85, ptr %2, align 4, !tbaa !5
  %86 = load i32, ptr %3, align 4, !tbaa !5
  %87 = add nsw i32 %86, -1
  store i32 %87, ptr %3, align 4, !tbaa !5
  %.not25.not41.not = icmp sgt i32 %84, %86
  br i1 %.not25.not41.not, label %._crit_edge, label %.lr.ph44

.lr.ph44:                                         ; preds = %83
  %88 = load i64, ptr @MOD, align 8, !tbaa !11
  %89 = sext i32 %85 to i64
  %90 = add i32 %86, 1
  %91 = sub i32 %90, %84
  %xtraiter79 = and i32 %91, 1
  %92 = icmp eq i32 %86, %84
  br i1 %92, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph44.new

.lr.ph44.new:                                     ; preds = %.lr.ph44
  %unroll_iter = and i32 %91, -2
  br label %98

._crit_edge.loopexit.unr-lcssa:                   ; preds = %98, %.lr.ph44
  %.lcssa.ph = phi i64 [ poison, %.lr.ph44 ], [ %106, %98 ]
  %indvars.iv64.unr = phi i64 [ %89, %.lr.ph44 ], [ %indvars.iv.next65.1, %98 ]
  %.01942.unr = phi i64 [ 0, %.lr.ph44 ], [ %106, %98 ]
  %lcmp.mod80.not = icmp eq i32 %xtraiter79, 0
  br i1 %lcmp.mod80.not, label %._crit_edge, label %._crit_edge.loopexit.epilog-lcssa

._crit_edge.loopexit.epilog-lcssa:                ; preds = %._crit_edge.loopexit.unr-lcssa
  %93 = getelementptr inbounds [100100 x i64], ptr @a, i64 0, i64 %indvars.iv64.unr
  %94 = load i64, ptr %93, align 8, !tbaa !11
  %95 = add nsw i64 %94, %.01942.unr
  %96 = srem i64 %95, %88
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit.epilog-lcssa, %._crit_edge.loopexit.unr-lcssa, %83
  %.019.lcssa = phi i64 [ 0, %83 ], [ %.lcssa.ph, %._crit_edge.loopexit.unr-lcssa ], [ %96, %._crit_edge.loopexit.epilog-lcssa ]
  %97 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %.019.lcssa)
  br label %.loopexit

98:                                               ; preds = %98, %.lr.ph44.new
  %indvars.iv64 = phi i64 [ %89, %.lr.ph44.new ], [ %indvars.iv.next65.1, %98 ]
  %.01942 = phi i64 [ 0, %.lr.ph44.new ], [ %106, %98 ]
  %niter = phi i32 [ 0, %.lr.ph44.new ], [ %niter.next.1, %98 ]
  %99 = getelementptr inbounds [100100 x i64], ptr @a, i64 0, i64 %indvars.iv64
  %100 = load i64, ptr %99, align 8, !tbaa !11
  %101 = add nsw i64 %100, %.01942
  %102 = srem i64 %101, %88
  %indvars.iv.next65 = add nsw i64 %indvars.iv64, 1
  %103 = getelementptr inbounds [100100 x i64], ptr @a, i64 0, i64 %indvars.iv.next65
  %104 = load i64, ptr %103, align 8, !tbaa !11
  %105 = add nsw i64 %104, %102
  %106 = srem i64 %105, %88
  %indvars.iv.next65.1 = add nsw i64 %indvars.iv64, 2
  %niter.next.1 = add i32 %niter, 2
  %niter.ncmp.1 = icmp eq i32 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge.loopexit.unr-lcssa, label %98, !llvm.loop !19

.loopexit:                                        ; preds = %scalar.ph, %.prol.loopexit, %.lr.ph37.new, %.prol.loopexit76, %.lr.ph40.new, %middle.block, %68, %44, %20, %._crit_edge
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  %107 = load i32, ptr @q, align 4, !tbaa !5
  %108 = add nsw i32 %107, -1
  store i32 %108, ptr @q, align 4, !tbaa !5
  %.not = icmp eq i32 %107, 0
  br i1 %.not, label %._crit_edge47, label %.lr.ph46, !llvm.loop !20

._crit_edge47:                                    ; preds = %.loopexit, %.preheader
  ret i32 0
}

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

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #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 = { nofree nounwind "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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"long long", !7, i64 0}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10, !16, !17}
!16 = !{!"llvm.loop.isvectorized", i32 1}
!17 = !{!"llvm.loop.unroll.runtime.disable"}
!18 = distinct !{!18, !10, !17, !16}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10}


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