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

; 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.Node = type { i32, [5 x i32], [5 x i32] }

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@a = external dso_local global [5 x i32], align 16
@tot = external dso_local global i32, align 4
@seq = external dso_local global [100001 x %struct.Node], align 16
@pat = external dso_local global %struct.Node, align 4
@vis = external dso_local global [5 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z3pfsii(i32 noundef %0, i32 noundef %1) #0 {
  %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
  store i32 %0, ptr %3, align 4, !tbaa !5
  store i32 %1, ptr %4, align 4, !tbaa !5
  %10 = load i32, ptr %3, align 4, !tbaa !5
  %11 = load i32, ptr @m, align 4, !tbaa !5
  %12 = icmp eq i32 %10, %11
  br i1 %12, label %13, label %18

13:                                               ; preds = %2
  %14 = load i32, ptr @tot, align 4, !tbaa !5
  %15 = add nsw i32 %14, 1
  store i32 %15, ptr @tot, align 4, !tbaa !5
  %16 = sext i32 %14 to i64
  %17 = getelementptr inbounds [100001 x %struct.Node], ptr @seq, i64 0, i64 %16
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %17, ptr align 4 @pat, i64 44, i1 false), !tbaa.struct !9
  br label %137

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

19:                                               ; preds = %61, %18
  %20 = load i32, ptr %5, align 4, !tbaa !5
  %21 = load i32, ptr @m, align 4, !tbaa !5
  %22 = icmp slt i32 %20, %21
  br i1 %22, label %24, label %23

23:                                               ; preds = %19
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  br label %64

24:                                               ; preds = %19
  %25 = load i32, ptr %5, align 4, !tbaa !5
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds [5 x i8], ptr @vis, i64 0, i64 %26
  %28 = load i8, ptr %27, align 1, !tbaa !11, !range !13, !noundef !14
  %29 = trunc i8 %28 to i1
  br i1 %29, label %60, label %30

30:                                               ; preds = %24
  %31 = load i32, ptr %5, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [5 x i32], ptr @a, i64 0, i64 %32
  %34 = load i32, ptr %33, align 4, !tbaa !5
  %35 = load i32, ptr @pat, align 4, !tbaa !15
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [5 x i32], ptr getelementptr inbounds (%struct.Node, ptr @pat, i32 0, i32 2), i64 0, i64 %36
  store i32 %34, ptr %37, align 4, !tbaa !5
  %38 = load i32, ptr @pat, align 4, !tbaa !15
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds [5 x i32], ptr getelementptr inbounds (%struct.Node, ptr @pat, i32 0, i32 1), i64 0, i64 %39
  store i32 %34, ptr %40, align 4, !tbaa !5
  %41 = load i32, ptr @pat, align 4, !tbaa !15
  %42 = add nsw i32 %41, 1
  store i32 %42, ptr @pat, align 4, !tbaa !15
  %43 = load i32, ptr %5, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [5 x i8], ptr @vis, i64 0, i64 %44
  store i8 1, ptr %45, align 1, !tbaa !11
  %46 = load i32, ptr %3, align 4, !tbaa !5
  %47 = add nsw i32 %46, 1
  %48 = load i32, ptr %5, align 4, !tbaa !5
  call void @_Z3pfsii(i32 noundef %47, i32 noundef %48)
  %49 = load i32, ptr %5, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [5 x i8], ptr @vis, i64 0, i64 %50
  store i8 0, ptr %51, align 1, !tbaa !11
  %52 = load i32, ptr @pat, align 4, !tbaa !15
  %53 = add nsw i32 %52, -1
  store i32 %53, ptr @pat, align 4, !tbaa !15
  %54 = load i32, ptr @pat, align 4, !tbaa !15
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [5 x i32], ptr getelementptr inbounds (%struct.Node, ptr @pat, i32 0, i32 2), i64 0, i64 %55
  store i32 0, ptr %56, align 4, !tbaa !5
  %57 = load i32, ptr @pat, align 4, !tbaa !15
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [5 x i32], ptr getelementptr inbounds (%struct.Node, ptr @pat, i32 0, i32 1), i64 0, i64 %58
  store i32 0, ptr %59, align 4, !tbaa !5
  br label %60

60:                                               ; preds = %30, %24
  br label %61

61:                                               ; preds = %60
  %62 = load i32, ptr %5, align 4, !tbaa !5
  %63 = add nsw i32 %62, 1
  store i32 %63, ptr %5, align 4, !tbaa !5
  br label %19, !llvm.loop !17

64:                                               ; preds = %23
  %65 = load i32, ptr @pat, align 4, !tbaa !15
  %66 = icmp ne i32 %65, 0
  br i1 %66, label %68, label %67

67:                                               ; preds = %64
  br label %137

68:                                               ; preds = %64
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  %69 = load i32, ptr %4, align 4, !tbaa !5
  %70 = add nsw i32 %69, 1
  store i32 %70, ptr %6, align 4, !tbaa !5
  br label %71

71:                                               ; preds = %134, %68
  %72 = load i32, ptr %6, align 4, !tbaa !5
  %73 = load i32, ptr @m, align 4, !tbaa !5
  %74 = icmp slt i32 %72, %73
  br i1 %74, label %76, label %75

75:                                               ; preds = %71
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  br label %137

76:                                               ; preds = %71
  %77 = load i32, ptr %6, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [5 x i8], ptr @vis, i64 0, i64 %78
  %80 = load i8, ptr %79, align 1, !tbaa !11, !range !13, !noundef !14
  %81 = trunc i8 %80 to i1
  br i1 %81, label %133, label %82

82:                                               ; preds = %76
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  %83 = load i32, ptr @pat, align 4, !tbaa !15
  %84 = sub nsw i32 %83, 1
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [5 x i32], ptr getelementptr inbounds (%struct.Node, ptr @pat, i32 0, i32 1), i64 0, i64 %85
  %87 = load i32, ptr %86, align 4, !tbaa !5
  store i32 %87, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  %88 = load i32, ptr @pat, align 4, !tbaa !15
  %89 = sub nsw i32 %88, 1
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [5 x i32], ptr getelementptr inbounds (%struct.Node, ptr @pat, i32 0, i32 2), i64 0, i64 %90
  %92 = load i32, ptr %91, align 4, !tbaa !5
  store i32 %92, ptr %8, align 4, !tbaa !5
  %93 = load i32, ptr %6, align 4, !tbaa !5
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [5 x i32], ptr @a, i64 0, i64 %94
  %96 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %95)
  %97 = load i32, ptr %96, align 4, !tbaa !5
  %98 = load i32, ptr @pat, align 4, !tbaa !15
  %99 = sub nsw i32 %98, 1
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [5 x i32], ptr getelementptr inbounds (%struct.Node, ptr @pat, i32 0, i32 1), i64 0, i64 %100
  store i32 %97, ptr %101, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  %102 = load i32, ptr %8, align 4, !tbaa !5
  %103 = load i32, ptr %6, align 4, !tbaa !5
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [5 x i32], ptr @a, i64 0, i64 %104
  %106 = load i32, ptr %105, align 4, !tbaa !5
  %107 = add nsw i32 %102, %106
  store i32 %107, ptr %9, align 4, !tbaa !5
  %108 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %9, ptr noundef nonnull align 4 dereferenceable(4) @n)
  %109 = load i32, ptr %108, align 4, !tbaa !5
  %110 = load i32, ptr @pat, align 4, !tbaa !15
  %111 = sub nsw i32 %110, 1
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [5 x i32], ptr getelementptr inbounds (%struct.Node, ptr @pat, i32 0, i32 2), i64 0, i64 %112
  store i32 %109, ptr %113, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  %114 = load i32, ptr %6, align 4, !tbaa !5
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [5 x i8], ptr @vis, i64 0, i64 %115
  store i8 1, ptr %116, align 1, !tbaa !11
  %117 = load i32, ptr %3, align 4, !tbaa !5
  %118 = add nsw i32 %117, 1
  %119 = load i32, ptr %6, align 4, !tbaa !5
  call void @_Z3pfsii(i32 noundef %118, i32 noundef %119)
  %120 = load i32, ptr %6, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [5 x i8], ptr @vis, i64 0, i64 %121
  store i8 0, ptr %122, align 1, !tbaa !11
  %123 = load i32, ptr %7, align 4, !tbaa !5
  %124 = load i32, ptr @pat, align 4, !tbaa !15
  %125 = sub nsw i32 %124, 1
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds [5 x i32], ptr getelementptr inbounds (%struct.Node, ptr @pat, i32 0, i32 1), i64 0, i64 %126
  store i32 %123, ptr %127, align 4, !tbaa !5
  %128 = load i32, ptr %8, align 4, !tbaa !5
  %129 = load i32, ptr @pat, align 4, !tbaa !15
  %130 = sub nsw i32 %129, 1
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds [5 x i32], ptr getelementptr inbounds (%struct.Node, ptr @pat, i32 0, i32 2), i64 0, i64 %131
  store i32 %128, ptr %132, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %133

133:                                              ; preds = %82, %76
  br label %134

134:                                              ; preds = %133
  %135 = load i32, ptr %6, align 4, !tbaa !5
  %136 = add nsw i32 %135, 1
  store i32 %136, ptr %6, align 4, !tbaa !5
  br label %71, !llvm.loop !19

137:                                              ; preds = %75, %67, %13
  ret void
}

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #3

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


; 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.Node = type { i32, [5 x i32], [5 x i32] }

@n = external dso_local global i32, align 4
@m = external dso_local local_unnamed_addr global i32, align 4
@a = external dso_local global [5 x i32], align 16
@tot = external dso_local local_unnamed_addr global i32, align 4
@seq = external dso_local local_unnamed_addr global [100001 x %struct.Node], align 16
@pat = external dso_local local_unnamed_addr global %struct.Node, align 4
@vis = external dso_local local_unnamed_addr global [5 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_Z3pfsii(i32 noundef %0, i32 noundef %1) local_unnamed_addr #0 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = load i32, ptr @m, align 4, !tbaa !5
  %6 = icmp eq i32 %5, %0
  br i1 %6, label %9, label %.preheader23

.preheader23:                                     ; preds = %2
  %7 = icmp sgt i32 %5, 0
  br i1 %7, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader23
  %8 = add nsw i32 %0, 1
  br label %19

9:                                                ; preds = %2
  %10 = load i32, ptr @tot, align 4, !tbaa !5
  %11 = add nsw i32 %10, 1
  store i32 %11, ptr @tot, align 4, !tbaa !5
  %12 = sext i32 %10 to i64
  %13 = getelementptr inbounds [100001 x %struct.Node], ptr @seq, i64 0, i64 %12
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(44) %13, ptr noundef nonnull align 4 dereferenceable(44) @pat, i64 44, i1 false), !tbaa.struct !9
  br label %.loopexit

._crit_edge:                                      ; preds = %43, %.preheader23
  %14 = phi i32 [ %5, %.preheader23 ], [ %44, %43 ]
  %15 = load i32, ptr @pat, align 4, !tbaa !11
  %.not = icmp eq i32 %15, 0
  br i1 %.not, label %.loopexit, label %.preheader

.preheader:                                       ; preds = %._crit_edge
  %.02125 = add nsw i32 %1, 1
  %16 = icmp slt i32 %.02125, %14
  br i1 %16, label %.lr.ph27, label %.loopexit

.lr.ph27:                                         ; preds = %.preheader
  %17 = add nsw i32 %0, 1
  %18 = sext i32 %.02125 to i64
  br label %47

19:                                               ; preds = %.lr.ph, %43
  %20 = phi i32 [ %5, %.lr.ph ], [ %44, %43 ]
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %43 ]
  %21 = getelementptr inbounds [5 x i8], ptr @vis, i64 0, i64 %indvars.iv
  %22 = load i8, ptr %21, align 1, !tbaa !13, !range !15, !noundef !16
  %23 = trunc nuw i8 %22 to i1
  br i1 %23, label %43, label %24

24:                                               ; preds = %19
  %25 = getelementptr inbounds [5 x i32], ptr @a, i64 0, i64 %indvars.iv
  %26 = load i32, ptr %25, align 4, !tbaa !5
  %27 = load i32, ptr @pat, align 4, !tbaa !11
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds [5 x i32], ptr getelementptr inbounds (i8, ptr @pat, i64 24), i64 0, i64 %28
  store i32 %26, ptr %29, align 4, !tbaa !5
  %30 = load i32, ptr @pat, align 4, !tbaa !11
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [5 x i32], ptr getelementptr inbounds (i8, ptr @pat, i64 4), i64 0, i64 %31
  store i32 %26, ptr %32, align 4, !tbaa !5
  %33 = load i32, ptr @pat, align 4, !tbaa !11
  %34 = add nsw i32 %33, 1
  store i32 %34, ptr @pat, align 4, !tbaa !11
  store i8 1, ptr %21, align 1, !tbaa !13
  %35 = trunc nuw nsw i64 %indvars.iv to i32
  tail call void @_Z3pfsii(i32 noundef %8, i32 noundef %35)
  store i8 0, ptr %21, align 1, !tbaa !13
  %36 = load i32, ptr @pat, align 4, !tbaa !11
  %37 = add nsw i32 %36, -1
  store i32 %37, ptr @pat, align 4, !tbaa !11
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [5 x i32], ptr getelementptr inbounds (i8, ptr @pat, i64 24), i64 0, i64 %38
  store i32 0, ptr %39, align 4, !tbaa !5
  %40 = load i32, ptr @pat, align 4, !tbaa !11
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [5 x i32], ptr getelementptr inbounds (i8, ptr @pat, i64 4), i64 0, i64 %41
  store i32 0, ptr %42, align 4, !tbaa !5
  %.pre = load i32, ptr @m, align 4, !tbaa !5
  br label %43

43:                                               ; preds = %19, %24
  %44 = phi i32 [ %20, %19 ], [ %.pre, %24 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %45 = sext i32 %44 to i64
  %46 = icmp slt i64 %indvars.iv.next, %45
  br i1 %46, label %19, label %._crit_edge, !llvm.loop !17

47:                                               ; preds = %.lr.ph27, %85
  %48 = phi i32 [ %14, %.lr.ph27 ], [ %86, %85 ]
  %indvars.iv29 = phi i64 [ %18, %.lr.ph27 ], [ %indvars.iv.next30, %85 ]
  %49 = getelementptr inbounds [5 x i8], ptr @vis, i64 0, i64 %indvars.iv29
  %50 = load i8, ptr %49, align 1, !tbaa !13, !range !15, !noundef !16
  %51 = trunc nuw i8 %50 to i1
  br i1 %51, label %85, label %52

52:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #4
  %53 = load i32, ptr @pat, align 4, !tbaa !11
  %54 = add nsw i32 %53, -1
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [5 x i32], ptr getelementptr inbounds (i8, ptr @pat, i64 4), i64 0, i64 %55
  %57 = load i32, ptr %56, align 4, !tbaa !5
  store i32 %57, ptr %3, align 4, !tbaa !5
  %58 = getelementptr inbounds [5 x i32], ptr getelementptr inbounds (i8, ptr @pat, i64 24), i64 0, i64 %55
  %59 = load i32, ptr %58, align 4, !tbaa !5
  %60 = getelementptr inbounds [5 x i32], ptr @a, i64 0, i64 %indvars.iv29
  %61 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %60)
  %62 = load i32, ptr %61, align 4, !tbaa !5
  %63 = load i32, ptr @pat, align 4, !tbaa !11
  %64 = add nsw i32 %63, -1
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [5 x i32], ptr getelementptr inbounds (i8, ptr @pat, i64 4), i64 0, i64 %65
  store i32 %62, ptr %66, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #4
  %67 = load i32, ptr %60, align 4, !tbaa !5
  %68 = add nsw i32 %67, %59
  store i32 %68, ptr %4, align 4, !tbaa !5
  %69 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) @n)
  %70 = load i32, ptr %69, align 4, !tbaa !5
  %71 = load i32, ptr @pat, align 4, !tbaa !11
  %72 = add nsw i32 %71, -1
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [5 x i32], ptr getelementptr inbounds (i8, ptr @pat, i64 24), i64 0, i64 %73
  store i32 %70, ptr %74, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #4
  store i8 1, ptr %49, align 1, !tbaa !13
  %75 = trunc nsw i64 %indvars.iv29 to i32
  call void @_Z3pfsii(i32 noundef %17, i32 noundef %75)
  store i8 0, ptr %49, align 1, !tbaa !13
  %76 = load i32, ptr %3, align 4, !tbaa !5
  %77 = load i32, ptr @pat, align 4, !tbaa !11
  %78 = add nsw i32 %77, -1
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [5 x i32], ptr getelementptr inbounds (i8, ptr @pat, i64 4), i64 0, i64 %79
  store i32 %76, ptr %80, align 4, !tbaa !5
  %81 = load i32, ptr @pat, align 4, !tbaa !11
  %82 = add nsw i32 %81, -1
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [5 x i32], ptr getelementptr inbounds (i8, ptr @pat, i64 24), i64 0, i64 %83
  store i32 %59, ptr %84, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #4
  %.pre32 = load i32, ptr @m, align 4, !tbaa !5
  br label %85

85:                                               ; preds = %47, %52
  %86 = phi i32 [ %48, %47 ], [ %.pre32, %52 ]
  %indvars.iv.next30 = add nsw i64 %indvars.iv29, 1
  %87 = sext i32 %86 to i64
  %88 = icmp slt i64 %indvars.iv.next30, %87
  br i1 %88, label %47, label %.loopexit, !llvm.loop !19

.loopexit:                                        ; preds = %85, %.preheader, %._crit_edge, %9
  ret void
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3

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


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