; LLVM IR from tangjz/acm-icpc :: codeforces/gym/100959A.ll (Z3pfsixi)

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

%"struct.std::pair" = type { i64, i64 }
%struct.Exp = type { i32, i32, [15 x i32] }

@pr = external dso_local global [101 x i32], align 16
@ctr = external dso_local global i32, align 4
@ord = external dso_local global [32751 x i32], align 16
@fir = external dso_local global [32751 x %"struct.std::pair"], align 16
@plim = external dso_local global [101 x i64], align 16
@seq = external dso_local global [32751 x %struct.Exp], align 16
@pat = external dso_local global %struct.Exp, align 4

; 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 uwtable
define dso_local void @_Z3pfsixi(i32 noundef %0, i64 noundef %1, i32 noundef %2) #1 {
  %4 = alloca i32, align 4
  %5 = alloca i64, align 8
  %6 = alloca i32, align 4
  %7 = alloca i64, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i64, align 8
  %11 = alloca %"struct.std::pair", align 8
  %12 = alloca i32, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store i64 %1, ptr %5, align 8, !tbaa !9
  store i32 %2, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  store i64 1000000000000000001, ptr %7, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  store i32 0, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  br label %13

13:                                               ; preds = %86, %3
  %14 = load i32, ptr %8, align 4, !tbaa !5
  %15 = load i32, ptr getelementptr inbounds (%struct.Exp, ptr @pat, i32 0, i32 1), align 4, !tbaa !11
  %16 = icmp slt i32 %14, %15
  br i1 %16, label %18, label %17

17:                                               ; preds = %13
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  br label %89

18:                                               ; preds = %13
  %19 = load i32, ptr %8, align 4, !tbaa !5
  %20 = sext i32 %19 to i64
  %21 = getelementptr inbounds [15 x i32], ptr getelementptr inbounds (%struct.Exp, ptr @pat, i32 0, i32 2), i64 0, i64 %20
  %22 = load i32, ptr %21, align 4, !tbaa !5
  %23 = load i32, ptr %8, align 4, !tbaa !5
  %24 = add nsw i32 %23, 1
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds [15 x i32], ptr getelementptr inbounds (%struct.Exp, ptr @pat, i32 0, i32 2), i64 0, i64 %25
  %27 = load i32, ptr %26, align 4, !tbaa !5
  %28 = icmp sgt i32 %22, %27
  br i1 %28, label %29, label %85

29:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %30 = load i64, ptr %5, align 8, !tbaa !9
  store i64 %30, ptr %10, align 8, !tbaa !9
  %31 = load i32, ptr %8, align 4, !tbaa !5
  %32 = add nsw i32 %31, 1
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [15 x i32], ptr getelementptr inbounds (%struct.Exp, ptr @pat, i32 0, i32 2), i64 0, i64 %33
  %35 = load i32, ptr %34, align 4, !tbaa !5
  store i32 %35, ptr %9, align 4, !tbaa !5
  br label %36

36:                                               ; preds = %60, %29
  %37 = load i32, ptr %9, align 4, !tbaa !5
  %38 = load i32, ptr %8, align 4, !tbaa !5
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds [15 x i32], ptr getelementptr inbounds (%struct.Exp, ptr @pat, i32 0, i32 2), i64 0, i64 %39
  %41 = load i32, ptr %40, align 4, !tbaa !5
  %42 = icmp slt i32 %37, %41
  br i1 %42, label %43, label %57

43:                                               ; preds = %36
  %44 = load i32, ptr %8, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [101 x i32], ptr @pr, i64 0, i64 %45
  %47 = load i32, ptr %46, align 4, !tbaa !5
  %48 = sext i32 %47 to i64
  %49 = load i64, ptr %10, align 8, !tbaa !9
  %50 = sdiv i64 %49, %48
  store i64 %50, ptr %10, align 8, !tbaa !9
  %51 = load i32, ptr %8, align 4, !tbaa !5
  %52 = add nsw i32 %51, 1
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [101 x i64], ptr @plim, i64 0, i64 %53
  %55 = load i64, ptr %54, align 8, !tbaa !9
  %56 = icmp sle i64 %50, %55
  br label %57

57:                                               ; preds = %43, %36
  %58 = phi i1 [ false, %36 ], [ %56, %43 ]
  br i1 %58, label %59, label %71

59:                                               ; preds = %57
  br label %60

60:                                               ; preds = %59
  %61 = load i32, ptr %9, align 4, !tbaa !5
  %62 = add nsw i32 %61, 1
  store i32 %62, ptr %9, align 4, !tbaa !5
  %63 = load i32, ptr %8, align 4, !tbaa !5
  %64 = add nsw i32 %63, 1
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [101 x i32], ptr @pr, i64 0, i64 %65
  %67 = load i32, ptr %66, align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %69 = load i64, ptr %10, align 8, !tbaa !9
  %70 = mul nsw i64 %69, %68
  store i64 %70, ptr %10, align 8, !tbaa !9
  br label %36, !llvm.loop !13

71:                                               ; preds = %57
  %72 = load i32, ptr %9, align 4, !tbaa !5
  %73 = load i32, ptr %8, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [15 x i32], ptr getelementptr inbounds (%struct.Exp, ptr @pat, i32 0, i32 2), i64 0, i64 %74
  %76 = load i32, ptr %75, align 4, !tbaa !5
  %77 = icmp eq i32 %72, %76
  br i1 %77, label %78, label %84

78:                                               ; preds = %71
  %79 = load i64, ptr %10, align 8, !tbaa !9
  %80 = load i64, ptr %7, align 8, !tbaa !9
  %81 = icmp slt i64 %79, %80
  br i1 %81, label %82, label %84

82:                                               ; preds = %78
  %83 = load i64, ptr %10, align 8, !tbaa !9
  store i64 %83, ptr %7, align 8, !tbaa !9
  br label %84

84:                                               ; preds = %82, %78, %71
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  br label %85

85:                                               ; preds = %84, %18
  br label %86

86:                                               ; preds = %85
  %87 = load i32, ptr %8, align 4, !tbaa !5
  %88 = add nsw i32 %87, 1
  store i32 %88, ptr %8, align 4, !tbaa !5
  br label %13, !llvm.loop !15

89:                                               ; preds = %17
  %90 = load i32, ptr @ctr, align 4, !tbaa !5
  %91 = load i32, ptr @ctr, align 4, !tbaa !5
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [32751 x i32], ptr @ord, i64 0, i64 %92
  store i32 %90, ptr %93, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %11) #4
  %94 = call { i64, i64 } @_ZSt9make_pairIRxS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %7)
  %95 = getelementptr inbounds { i64, i64 }, ptr %11, i32 0, i32 0
  %96 = extractvalue { i64, i64 } %94, 0
  store i64 %96, ptr %95, align 8
  %97 = getelementptr inbounds { i64, i64 }, ptr %11, i32 0, i32 1
  %98 = extractvalue { i64, i64 } %94, 1
  store i64 %98, ptr %97, align 8
  %99 = load i32, ptr @ctr, align 4, !tbaa !5
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [32751 x %"struct.std::pair"], ptr @fir, i64 0, i64 %100
  %102 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt4pairIxxEaSEOS0_(ptr noundef nonnull align 8 dereferenceable(16) %101, ptr noundef nonnull align 8 dereferenceable(16) %11) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #4
  %103 = load i32, ptr @ctr, align 4, !tbaa !5
  %104 = add nsw i32 %103, 1
  store i32 %104, ptr @ctr, align 4, !tbaa !5
  %105 = sext i32 %103 to i64
  %106 = getelementptr inbounds [32751 x %struct.Exp], ptr @seq, i64 0, i64 %105
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %106, ptr align 4 @pat, i64 68, i1 false), !tbaa.struct !16
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  store i32 1, ptr %12, align 4, !tbaa !5
  br label %107

107:                                              ; preds = %151, %89
  %108 = load i32, ptr %12, align 4, !tbaa !5
  %109 = load i32, ptr %6, align 4, !tbaa !5
  %110 = icmp sle i32 %108, %109
  br i1 %110, label %111, label %120

111:                                              ; preds = %107
  %112 = load i64, ptr %5, align 8, !tbaa !9
  %113 = load i32, ptr %4, align 4, !tbaa !5
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [101 x i32], ptr @pr, i64 0, i64 %114
  %116 = load i32, ptr %115, align 4, !tbaa !5
  %117 = sext i32 %116 to i64
  %118 = sdiv i64 1000000000000000000, %117
  %119 = icmp sle i64 %112, %118
  br label %120

120:                                              ; preds = %111, %107
  %121 = phi i1 [ false, %107 ], [ %119, %111 ]
  br i1 %121, label %123, label %122

122:                                              ; preds = %120
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  br label %154

123:                                              ; preds = %120
  %124 = load i32, ptr %12, align 4, !tbaa !5
  %125 = add nsw i32 %124, 1
  %126 = load i32, ptr @pat, align 4, !tbaa !18
  %127 = mul nsw i32 %126, %125
  store i32 %127, ptr @pat, align 4, !tbaa !18
  %128 = load i32, ptr %12, align 4, !tbaa !5
  %129 = load i32, ptr getelementptr inbounds (%struct.Exp, ptr @pat, i32 0, i32 1), align 4, !tbaa !11
  %130 = add nsw i32 %129, 1
  store i32 %130, ptr getelementptr inbounds (%struct.Exp, ptr @pat, i32 0, i32 1), align 4, !tbaa !11
  %131 = sext i32 %129 to i64
  %132 = getelementptr inbounds [15 x i32], ptr getelementptr inbounds (%struct.Exp, ptr @pat, i32 0, i32 2), i64 0, i64 %131
  store i32 %128, ptr %132, align 4, !tbaa !5
  %133 = load i32, ptr %4, align 4, !tbaa !5
  %134 = add nsw i32 %133, 1
  %135 = load i32, ptr %4, align 4, !tbaa !5
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds [101 x i32], ptr @pr, i64 0, i64 %136
  %138 = load i32, ptr %137, align 4, !tbaa !5
  %139 = sext i32 %138 to i64
  %140 = load i64, ptr %5, align 8, !tbaa !9
  %141 = mul nsw i64 %140, %139
  store i64 %141, ptr %5, align 8, !tbaa !9
  %142 = load i32, ptr %12, align 4, !tbaa !5
  call void @_Z3pfsixi(i32 noundef %134, i64 noundef %141, i32 noundef %142)
  %143 = load i32, ptr %12, align 4, !tbaa !5
  %144 = add nsw i32 %143, 1
  %145 = load i32, ptr @pat, align 4, !tbaa !18
  %146 = sdiv i32 %145, %144
  store i32 %146, ptr @pat, align 4, !tbaa !18
  %147 = load i32, ptr getelementptr inbounds (%struct.Exp, ptr @pat, i32 0, i32 1), align 4, !tbaa !11
  %148 = add nsw i32 %147, -1
  store i32 %148, ptr getelementptr inbounds (%struct.Exp, ptr @pat, i32 0, i32 1), align 4, !tbaa !11
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds [15 x i32], ptr getelementptr inbounds (%struct.Exp, ptr @pat, i32 0, i32 2), i64 0, i64 %149
  store i32 0, ptr %150, align 4, !tbaa !5
  br label %151

151:                                              ; preds = %123
  %152 = load i32, ptr %12, align 4, !tbaa !5
  %153 = add nsw i32 %152, 1
  store i32 %153, ptr %12, align 4, !tbaa !5
  br label %107, !llvm.loop !19

154:                                              ; preds = %122
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i64 } @_ZSt9make_pairIRxS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #1

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = !{!12, !6, i64 4}
!12 = !{!"_ZTS3Exp", !6, i64 0, !6, i64 4, !7, i64 8}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = !{i64 0, i64 4, !5, i64 4, i64 4, !5, i64 8, i64 60, !17}
!17 = !{!7, !7, i64 0}
!18 = !{!12, !6, i64 0}
!19 = distinct !{!19, !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"

%"struct.std::pair" = type { i64, i64 }
%struct.Exp = type { i32, i32, [15 x i32] }

@pr = external dso_local local_unnamed_addr global [101 x i32], align 16
@ctr = external dso_local local_unnamed_addr global i32, align 4
@ord = external dso_local local_unnamed_addr global [32751 x i32], align 16
@fir = external dso_local global [32751 x %"struct.std::pair"], align 16
@plim = external dso_local local_unnamed_addr global [101 x i64], align 16
@seq = external dso_local local_unnamed_addr global [32751 x %struct.Exp], align 16
@pat = external dso_local local_unnamed_addr global %struct.Exp, align 4

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z3pfsixi(i32 noundef %0, i64 noundef %1, i32 noundef %2) local_unnamed_addr #1 {
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca %"struct.std::pair", align 8
  store i64 %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  %7 = load i32, ptr getelementptr inbounds (i8, ptr @pat, i64 4), align 4, !tbaa !9
  %8 = icmp sgt i32 %7, 0
  br i1 %8, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %3
  %wide.trip.count = zext nneg i32 %7 to i64
  %.pre = load i32, ptr getelementptr inbounds (i8, ptr @pat, i64 8), align 4, !tbaa !12
  br label %.lr.ph

._crit_edge:                                      ; preds = %47, %3
  %.lcssa = phi i64 [ 1000000000000000001, %3 ], [ %48, %47 ]
  store i64 %.lcssa, ptr %5, align 8
  %9 = load i32, ptr @ctr, align 4, !tbaa !12
  %10 = sext i32 %9 to i64
  %11 = getelementptr inbounds [32751 x i32], ptr @ord, i64 0, i64 %10
  store i32 %9, ptr %11, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #5
  %12 = call { i64, i64 } @_ZSt9make_pairIRxS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %13 = extractvalue { i64, i64 } %12, 0
  store i64 %13, ptr %6, align 8
  %14 = getelementptr inbounds i8, ptr %6, i64 8
  %15 = extractvalue { i64, i64 } %12, 1
  store i64 %15, ptr %14, align 8
  %16 = load i32, ptr @ctr, align 4, !tbaa !12
  %17 = sext i32 %16 to i64
  %18 = getelementptr inbounds [32751 x %"struct.std::pair"], ptr @fir, i64 0, i64 %17
  %19 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt4pairIxxEaSEOS0_(ptr noundef nonnull align 8 dereferenceable(16) %18, ptr noundef nonnull align 8 dereferenceable(16) %6) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #5
  %20 = load i32, ptr @ctr, align 4, !tbaa !12
  %21 = add nsw i32 %20, 1
  store i32 %21, ptr @ctr, align 4, !tbaa !12
  %22 = sext i32 %20 to i64
  %23 = getelementptr inbounds [32751 x %struct.Exp], ptr @seq, i64 0, i64 %22
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(68) %23, ptr noundef nonnull align 4 dereferenceable(68) @pat, i64 68, i1 false), !tbaa.struct !13
  %.not41 = icmp slt i32 %2, 1
  br i1 %.not41, label %.critedge2, label %.lr.ph44

.lr.ph44:                                         ; preds = %._crit_edge
  %24 = sext i32 %0 to i64
  %25 = getelementptr inbounds [101 x i32], ptr @pr, i64 0, i64 %24
  %26 = add nsw i32 %0, 1
  br label %49

.lr.ph:                                           ; preds = %.lr.ph.preheader, %47
  %27 = phi i32 [ %.pre, %.lr.ph.preheader ], [ %30, %47 ]
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %47 ]
  %28 = phi i64 [ 1000000000000000001, %.lr.ph.preheader ], [ %48, %47 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %29 = getelementptr inbounds [15 x i32], ptr getelementptr inbounds (i8, ptr @pat, i64 8), i64 0, i64 %indvars.iv.next
  %30 = load i32, ptr %29, align 4, !tbaa !12
  %31 = icmp sgt i32 %27, %30
  br i1 %31, label %.preheader, label %47

.preheader:                                       ; preds = %.lr.ph
  %32 = getelementptr inbounds [101 x i32], ptr @pr, i64 0, i64 %indvars.iv
  %33 = load i32, ptr %32, align 4, !tbaa !12
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [101 x i64], ptr @plim, i64 0, i64 %indvars.iv.next
  %36 = load i64, ptr %35, align 8, !tbaa !5
  %37 = getelementptr inbounds [101 x i32], ptr @pr, i64 0, i64 %indvars.iv.next
  br label %38

38:                                               ; preds = %.preheader, %40
  %.02939 = phi i64 [ %1, %.preheader ], [ %44, %40 ]
  %.03038 = phi i32 [ %30, %.preheader ], [ %41, %40 ]
  %39 = sdiv i64 %.02939, %34
  %.not36 = icmp sgt i64 %39, %36
  br i1 %.not36, label %.critedge, label %40

40:                                               ; preds = %38
  %41 = add nsw i32 %.03038, 1
  %42 = load i32, ptr %37, align 4, !tbaa !12
  %43 = sext i32 %42 to i64
  %44 = mul nsw i64 %39, %43
  %exitcond.not = icmp eq i32 %41, %27
  br i1 %exitcond.not, label %.critedge, label %38, !llvm.loop !15

.critedge:                                        ; preds = %40, %38
  %.030.lcssa = phi i32 [ %27, %40 ], [ %.03038, %38 ]
  %.1 = phi i64 [ %44, %40 ], [ %39, %38 ]
  %45 = icmp eq i32 %.030.lcssa, %27
  %46 = tail call i64 @llvm.smin.i64(i64 %.1, i64 %28)
  %spec.select = select i1 %45, i64 %46, i64 %28
  br label %47

47:                                               ; preds = %.critedge, %.lr.ph
  %48 = phi i64 [ %28, %.lr.ph ], [ %spec.select, %.critedge ]
  %exitcond48.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond48.not, label %._crit_edge, label %.lr.ph, !llvm.loop !17

49:                                               ; preds = %.lr.ph44, %54
  %.042 = phi i32 [ 1, %.lr.ph44 ], [ %55, %54 ]
  %50 = load i64, ptr %4, align 8, !tbaa !5
  %51 = load i32, ptr %25, align 4, !tbaa !12
  %52 = sext i32 %51 to i64
  %53 = sdiv i64 1000000000000000000, %52
  %.not35 = icmp sgt i64 %50, %53
  br i1 %.not35, label %.critedge2, label %54

.critedge2:                                       ; preds = %49, %54, %._crit_edge
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  ret void

54:                                               ; preds = %49
  %55 = add nuw i32 %.042, 1
  %56 = load i32, ptr @pat, align 4, !tbaa !18
  %57 = mul nsw i32 %56, %55
  store i32 %57, ptr @pat, align 4, !tbaa !18
  %58 = load i32, ptr getelementptr inbounds (i8, ptr @pat, i64 4), align 4, !tbaa !9
  %59 = add nsw i32 %58, 1
  store i32 %59, ptr getelementptr inbounds (i8, ptr @pat, i64 4), align 4, !tbaa !9
  %60 = sext i32 %58 to i64
  %61 = getelementptr inbounds [15 x i32], ptr getelementptr inbounds (i8, ptr @pat, i64 8), i64 0, i64 %60
  store i32 %.042, ptr %61, align 4, !tbaa !12
  %62 = mul nsw i64 %50, %52
  store i64 %62, ptr %4, align 8, !tbaa !5
  call void @_Z3pfsixi(i32 noundef %26, i64 noundef %62, i32 noundef %.042)
  %63 = load i32, ptr @pat, align 4, !tbaa !18
  %64 = sdiv i32 %63, %55
  store i32 %64, ptr @pat, align 4, !tbaa !18
  %65 = load i32, ptr getelementptr inbounds (i8, ptr @pat, i64 4), align 4, !tbaa !9
  %66 = add nsw i32 %65, -1
  store i32 %66, ptr getelementptr inbounds (i8, ptr @pat, i64 4), align 4, !tbaa !9
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [15 x i32], ptr getelementptr inbounds (i8, ptr @pat, i64 8), i64 0, i64 %67
  store i32 0, ptr %68, align 4, !tbaa !12
  %exitcond49.not = icmp eq i32 %.042, %2
  br i1 %exitcond49.not, label %.critedge2, label %49, !llvm.loop !19
}

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i64 } @_ZSt9make_pairIRxS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt4pairIxxEaSEOS0_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #4

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !11, i64 4}
!10 = !{!"_ZTS3Exp", !11, i64 0, !11, i64 4, !7, i64 8}
!11 = !{!"int", !7, i64 0}
!12 = !{!11, !11, i64 0}
!13 = !{i64 0, i64 4, !12, i64 4, i64 4, !12, i64 8, i64 60, !14}
!14 = !{!7, !7, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}
!18 = !{!10, !11, i64 0}
!19 = distinct !{!19, !16}


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