; LLVM IR from upupming/algorithm :: acwing/算法竞赛进阶指南/0x25-广度优先搜索/172. 立体推箱子.ll (Z11parse_st_edv)

; 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.rec = type { i32, i32, i32 }

@s = external dso_local global [510 x [510 x i8]], align 16
@st = external dso_local global %struct.rec, align 4
@ed = external dso_local global %struct.rec, align 4
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@_ZL2dx = external hidden constant [4 x i32], align 16
@_ZL2dy = external hidden constant [4 x i32], align 16

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z5validii(i32 noundef, i32 noundef) #0

; 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: mustprogress uwtable
define dso_local void @_Z11parse_st_edv() #2 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca %struct.rec, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca %struct.rec, align 4
  %9 = alloca %struct.rec, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #5
  store i32 1, ptr %1, align 4, !tbaa !5
  br label %10

10:                                               ; preds = %139, %0
  %11 = load i32, ptr %1, align 4, !tbaa !5
  %12 = load i32, ptr @n, align 4, !tbaa !5
  %13 = icmp sle i32 %11, %12
  br i1 %13, label %15, label %14

14:                                               ; preds = %10
  store i32 2, ptr %2, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #5
  br label %142

15:                                               ; preds = %10
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %16

16:                                               ; preds = %135, %15
  %17 = load i32, ptr %3, align 4, !tbaa !5
  %18 = load i32, ptr @m, align 4, !tbaa !5
  %19 = icmp sle i32 %17, %18
  br i1 %19, label %21, label %20

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

21:                                               ; preds = %16
  %22 = load i32, ptr %1, align 4, !tbaa !5
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds [510 x [510 x i8]], ptr @s, i64 0, i64 %23
  %25 = load i32, ptr %3, align 4, !tbaa !5
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds [510 x i8], ptr %24, i64 0, i64 %26
  %28 = load i8, ptr %27, align 1, !tbaa !9
  %29 = sext i8 %28 to i32
  %30 = icmp eq i32 %29, 79
  br i1 %30, label %31, label %43

31:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 12, ptr %4) #5
  %32 = getelementptr inbounds %struct.rec, ptr %4, i32 0, i32 0
  %33 = load i32, ptr %1, align 4, !tbaa !5
  store i32 %33, ptr %32, align 4, !tbaa !10
  %34 = getelementptr inbounds %struct.rec, ptr %4, i32 0, i32 1
  %35 = load i32, ptr %3, align 4, !tbaa !5
  store i32 %35, ptr %34, align 4, !tbaa !12
  %36 = getelementptr inbounds %struct.rec, ptr %4, i32 0, i32 2
  store i32 0, ptr %36, align 4, !tbaa !13
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 @ed, ptr align 4 %4, i64 12, i1 false), !tbaa.struct !14
  %37 = load i32, ptr %1, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [510 x [510 x i8]], ptr @s, i64 0, i64 %38
  %40 = load i32, ptr %3, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [510 x i8], ptr %39, i64 0, i64 %41
  store i8 46, ptr %42, align 1, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 12, ptr %4) #5
  br label %134

43:                                               ; preds = %21
  %44 = load i32, ptr %1, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [510 x [510 x i8]], ptr @s, i64 0, i64 %45
  %47 = load i32, ptr %3, align 4, !tbaa !5
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [510 x i8], ptr %46, i64 0, i64 %48
  %50 = load i8, ptr %49, align 1, !tbaa !9
  %51 = sext i8 %50 to i32
  %52 = icmp eq i32 %51, 88
  br i1 %52, label %53, label %133

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

54:                                               ; preds = %112, %53
  %55 = load i32, ptr %5, align 4, !tbaa !5
  %56 = icmp slt i32 %55, 4
  br i1 %56, label %58, label %57

57:                                               ; preds = %54
  store i32 8, ptr %2, align 4
  br label %115

58:                                               ; preds = %54
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  %59 = load i32, ptr %1, align 4, !tbaa !5
  %60 = load i32, ptr %5, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [4 x i32], ptr @_ZL2dx, i64 0, i64 %61
  %63 = load i32, ptr %62, align 4, !tbaa !5
  %64 = add nsw i32 %59, %63
  store i32 %64, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  %65 = load i32, ptr %3, align 4, !tbaa !5
  %66 = load i32, ptr %5, align 4, !tbaa !5
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [4 x i32], ptr @_ZL2dy, i64 0, i64 %67
  %69 = load i32, ptr %68, align 4, !tbaa !5
  %70 = add nsw i32 %65, %69
  store i32 %70, ptr %7, align 4, !tbaa !5
  %71 = load i32, ptr %6, align 4, !tbaa !5
  %72 = load i32, ptr %7, align 4, !tbaa !5
  %73 = call noundef zeroext i1 @_Z5validii(i32 noundef %71, i32 noundef %72)
  br i1 %73, label %74, label %108

74:                                               ; preds = %58
  %75 = load i32, ptr %6, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [510 x [510 x i8]], ptr @s, i64 0, i64 %76
  %78 = load i32, ptr %7, align 4, !tbaa !5
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [510 x i8], ptr %77, i64 0, i64 %79
  %81 = load i8, ptr %80, align 1, !tbaa !9
  %82 = sext i8 %81 to i32
  %83 = icmp eq i32 %82, 88
  br i1 %83, label %84, label %108

84:                                               ; preds = %74
  call void @llvm.lifetime.start.p0(i64 12, ptr %8) #5
  %85 = getelementptr inbounds %struct.rec, ptr %8, i32 0, i32 0
  %86 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %87 = load i32, ptr %86, align 4, !tbaa !5
  store i32 %87, ptr %85, align 4, !tbaa !10
  %88 = getelementptr inbounds %struct.rec, ptr %8, i32 0, i32 1
  %89 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %90 = load i32, ptr %89, align 4, !tbaa !5
  store i32 %90, ptr %88, align 4, !tbaa !12
  %91 = getelementptr inbounds %struct.rec, ptr %8, i32 0, i32 2
  %92 = load i32, ptr %5, align 4, !tbaa !5
  %93 = icmp slt i32 %92, 2
  %94 = zext i1 %93 to i64
  %95 = select i1 %93, i32 1, i32 2
  store i32 %95, ptr %91, align 4, !tbaa !13
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 @st, ptr align 4 %8, i64 12, i1 false), !tbaa.struct !14
  call void @llvm.lifetime.end.p0(i64 12, ptr %8) #5
  %96 = load i32, ptr %6, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [510 x [510 x i8]], ptr @s, i64 0, i64 %97
  %99 = load i32, ptr %7, align 4, !tbaa !5
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [510 x i8], ptr %98, i64 0, i64 %100
  store i8 46, ptr %101, align 1, !tbaa !9
  %102 = load i32, ptr %1, align 4, !tbaa !5
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds [510 x [510 x i8]], ptr @s, i64 0, i64 %103
  %105 = load i32, ptr %3, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [510 x i8], ptr %104, i64 0, i64 %106
  store i8 46, ptr %107, align 1, !tbaa !9
  store i32 8, ptr %2, align 4
  br label %109

108:                                              ; preds = %74, %58
  store i32 0, ptr %2, align 4
  br label %109

109:                                              ; preds = %108, %84
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  %110 = load i32, ptr %2, align 4
  switch i32 %110, label %115 [
    i32 0, label %111
  ]

111:                                              ; preds = %109
  br label %112

112:                                              ; preds = %111
  %113 = load i32, ptr %5, align 4, !tbaa !5
  %114 = add nsw i32 %113, 1
  store i32 %114, ptr %5, align 4, !tbaa !5
  br label %54, !llvm.loop !15

115:                                              ; preds = %109, %57
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br label %116

116:                                              ; preds = %115
  %117 = load i32, ptr %1, align 4, !tbaa !5
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [510 x [510 x i8]], ptr @s, i64 0, i64 %118
  %120 = load i32, ptr %3, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [510 x i8], ptr %119, i64 0, i64 %121
  %123 = load i8, ptr %122, align 1, !tbaa !9
  %124 = sext i8 %123 to i32
  %125 = icmp eq i32 %124, 88
  br i1 %125, label %126, label %132

126:                                              ; preds = %116
  call void @llvm.lifetime.start.p0(i64 12, ptr %9) #5
  %127 = getelementptr inbounds %struct.rec, ptr %9, i32 0, i32 0
  %128 = load i32, ptr %1, align 4, !tbaa !5
  store i32 %128, ptr %127, align 4, !tbaa !10
  %129 = getelementptr inbounds %struct.rec, ptr %9, i32 0, i32 1
  %130 = load i32, ptr %3, align 4, !tbaa !5
  store i32 %130, ptr %129, align 4, !tbaa !12
  %131 = getelementptr inbounds %struct.rec, ptr %9, i32 0, i32 2
  store i32 0, ptr %131, align 4, !tbaa !13
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 @st, ptr align 4 %9, i64 12, i1 false), !tbaa.struct !14
  call void @llvm.lifetime.end.p0(i64 12, ptr %9) #5
  br label %132

132:                                              ; preds = %126, %116
  br label %133

133:                                              ; preds = %132, %43
  br label %134

134:                                              ; preds = %133, %31
  br label %135

135:                                              ; preds = %134
  %136 = load i32, ptr %3, align 4, !tbaa !5
  %137 = add nsw i32 %136, 1
  store i32 %137, ptr %3, align 4, !tbaa !5
  br label %16, !llvm.loop !17

138:                                              ; preds = %20
  br label %139

139:                                              ; preds = %138
  %140 = load i32, ptr %1, align 4, !tbaa !5
  %141 = add nsw i32 %140, 1
  store i32 %141, ptr %1, align 4, !tbaa !5
  br label %10, !llvm.loop !18

142:                                              ; preds = %14
  ret void
}

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

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

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


; 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.rec = type { i32, i32, i32 }

@s = external dso_local local_unnamed_addr global [510 x [510 x i8]], align 16
@st = external dso_local local_unnamed_addr global %struct.rec, align 4
@ed = external dso_local local_unnamed_addr global %struct.rec, align 4
@n = external dso_local local_unnamed_addr global i32, align 4
@m = external dso_local local_unnamed_addr global i32, align 4
@_ZL2dx = external hidden local_unnamed_addr constant [4 x i32], align 16
@_ZL2dy = external hidden local_unnamed_addr constant [4 x i32], align 16

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z5validii(i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_Z11parse_st_edv() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #3
  store i32 1, ptr %1, align 4, !tbaa !5
  %5 = load i32, ptr @n, align 4, !tbaa !5
  %.not21 = icmp slt i32 %5, 1
  br i1 %.not21, label %._crit_edge24, label %.lr.ph23

.lr.ph23:                                         ; preds = %0
  %6 = load i32, ptr @m, align 4, !tbaa !5
  %7 = icmp slt i32 %6, 1
  br i1 %7, label %._crit_edge24, label %.lr.ph23.split.preheader

.lr.ph23.split.preheader:                         ; preds = %.lr.ph23
  %8 = load i32, ptr @_ZL2dx, align 16
  %9 = load i32, ptr @_ZL2dy, align 16
  %10 = load i32, ptr getelementptr inbounds (i8, ptr @_ZL2dx, i64 4), align 4
  %11 = load i32, ptr getelementptr inbounds (i8, ptr @_ZL2dy, i64 4), align 4
  %12 = load i32, ptr getelementptr inbounds (i8, ptr @_ZL2dx, i64 8), align 8
  %13 = load i32, ptr getelementptr inbounds (i8, ptr @_ZL2dy, i64 8), align 8
  %14 = load i32, ptr getelementptr inbounds (i8, ptr @_ZL2dx, i64 12), align 4
  %15 = load i32, ptr getelementptr inbounds (i8, ptr @_ZL2dy, i64 12), align 4
  br label %.lr.ph23.split

._crit_edge24:                                    ; preds = %._crit_edge, %.lr.ph23, %0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #3
  ret void

.lr.ph23.split:                                   ; preds = %.lr.ph23.split.preheader, %._crit_edge
  %16 = phi i32 [ %5, %.lr.ph23.split.preheader ], [ %19, %._crit_edge ]
  %17 = phi i32 [ 1, %.lr.ph23.split.preheader ], [ %22, %._crit_edge ]
  %18 = phi i32 [ %6, %.lr.ph23.split.preheader ], [ %21, %._crit_edge ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #3
  store i32 1, ptr %2, align 4, !tbaa !5
  %.not1619 = icmp slt i32 %18, 1
  br i1 %.not1619, label %._crit_edge, label %.lr.ph

._crit_edge.loopexit:                             ; preds = %97
  %.pre31 = load i32, ptr @n, align 4, !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.lr.ph23.split
  %19 = phi i32 [ %.pre31, %._crit_edge.loopexit ], [ %16, %.lr.ph23.split ]
  %20 = phi i32 [ %99, %._crit_edge.loopexit ], [ %17, %.lr.ph23.split ]
  %21 = phi i32 [ %101, %._crit_edge.loopexit ], [ %18, %.lr.ph23.split ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #3
  %22 = add nsw i32 %20, 1
  store i32 %22, ptr %1, align 4, !tbaa !5
  %.not.not = icmp slt i32 %20, %19
  br i1 %.not.not, label %.lr.ph23.split, label %._crit_edge24, !llvm.loop !9

.lr.ph:                                           ; preds = %.lr.ph23.split, %97
  %23 = phi i32 [ %99, %97 ], [ %17, %.lr.ph23.split ]
  %24 = phi i32 [ %100, %97 ], [ 1, %.lr.ph23.split ]
  %25 = sext i32 %23 to i64
  %26 = sext i32 %24 to i64
  %27 = getelementptr inbounds [510 x [510 x i8]], ptr @s, i64 0, i64 %25, i64 %26
  %28 = load i8, ptr %27, align 1, !tbaa !12
  switch i8 %28, label %97 [
    i8 79, label %32
    i8 88, label %.preheader.preheader
  ]

.preheader.preheader:                             ; preds = %.lr.ph
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #3
  %29 = add nsw i32 %8, %23
  store i32 %29, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #3
  %30 = add nsw i32 %9, %24
  store i32 %30, ptr %4, align 4, !tbaa !5
  %31 = call noundef zeroext i1 @_Z5validii(i32 noundef %29, i32 noundef %30)
  br i1 %31, label %33, label %.preheader.1

32:                                               ; preds = %.lr.ph
  store i32 %23, ptr @ed, align 4, !tbaa !5
  store i32 %24, ptr getelementptr inbounds (i8, ptr @ed, i64 4), align 4, !tbaa !5
  store i32 0, ptr getelementptr inbounds (i8, ptr @ed, i64 8), align 4, !tbaa !5
  store i8 46, ptr %27, align 1, !tbaa !12
  br label %97

33:                                               ; preds = %.preheader.preheader
  %34 = load i32, ptr %3, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = load i32, ptr %4, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [510 x [510 x i8]], ptr @s, i64 0, i64 %35, i64 %37
  %39 = load i8, ptr %38, align 1, !tbaa !12
  %40 = icmp eq i8 %39, 88
  br i1 %40, label %.loopexit.thread, label %.preheader.1

.loopexit.thread:                                 ; preds = %33, %61, %74, %87
  %41 = phi i32 [ 1, %33 ], [ 1, %61 ], [ 2, %74 ], [ 2, %87 ]
  %42 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %43 = load i32, ptr %42, align 4, !tbaa !5
  %44 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %45 = load i32, ptr %44, align 4, !tbaa !5
  store i32 %43, ptr @st, align 4, !tbaa !5
  store i32 %45, ptr getelementptr inbounds (i8, ptr @st, i64 4), align 4, !tbaa !5
  store i32 %41, ptr getelementptr inbounds (i8, ptr @st, i64 8), align 4, !tbaa !5
  %46 = load i32, ptr %3, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = load i32, ptr %4, align 4, !tbaa !5
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [510 x [510 x i8]], ptr @s, i64 0, i64 %47, i64 %49
  store i8 46, ptr %50, align 1, !tbaa !12
  %51 = load i32, ptr %1, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = load i32, ptr %2, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [510 x [510 x i8]], ptr @s, i64 0, i64 %52, i64 %54
  store i8 46, ptr %55, align 1, !tbaa !12
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #3
  br label %97

.preheader.1:                                     ; preds = %.preheader.preheader, %33
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #3
  %56 = load i32, ptr %1, align 4, !tbaa !5
  %57 = add nsw i32 %10, %56
  store i32 %57, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #3
  %58 = load i32, ptr %2, align 4, !tbaa !5
  %59 = add nsw i32 %11, %58
  store i32 %59, ptr %4, align 4, !tbaa !5
  %60 = call noundef zeroext i1 @_Z5validii(i32 noundef %57, i32 noundef %59)
  br i1 %60, label %61, label %.preheader.2

61:                                               ; preds = %.preheader.1
  %62 = load i32, ptr %3, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = load i32, ptr %4, align 4, !tbaa !5
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [510 x [510 x i8]], ptr @s, i64 0, i64 %63, i64 %65
  %67 = load i8, ptr %66, align 1, !tbaa !12
  %68 = icmp eq i8 %67, 88
  br i1 %68, label %.loopexit.thread, label %.preheader.2

.preheader.2:                                     ; preds = %61, %.preheader.1
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #3
  %69 = load i32, ptr %1, align 4, !tbaa !5
  %70 = add nsw i32 %12, %69
  store i32 %70, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #3
  %71 = load i32, ptr %2, align 4, !tbaa !5
  %72 = add nsw i32 %13, %71
  store i32 %72, ptr %4, align 4, !tbaa !5
  %73 = call noundef zeroext i1 @_Z5validii(i32 noundef %70, i32 noundef %72)
  br i1 %73, label %74, label %.preheader.3

74:                                               ; preds = %.preheader.2
  %75 = load i32, ptr %3, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = load i32, ptr %4, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [510 x [510 x i8]], ptr @s, i64 0, i64 %76, i64 %78
  %80 = load i8, ptr %79, align 1, !tbaa !12
  %81 = icmp eq i8 %80, 88
  br i1 %81, label %.loopexit.thread, label %.preheader.3

.preheader.3:                                     ; preds = %74, %.preheader.2
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #3
  %82 = load i32, ptr %1, align 4, !tbaa !5
  %83 = add nsw i32 %14, %82
  store i32 %83, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #3
  %84 = load i32, ptr %2, align 4, !tbaa !5
  %85 = add nsw i32 %15, %84
  store i32 %85, ptr %4, align 4, !tbaa !5
  %86 = call noundef zeroext i1 @_Z5validii(i32 noundef %83, i32 noundef %85)
  br i1 %86, label %87, label %.loopexit

87:                                               ; preds = %.preheader.3
  %88 = load i32, ptr %3, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %90 = load i32, ptr %4, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [510 x [510 x i8]], ptr @s, i64 0, i64 %89, i64 %91
  %93 = load i8, ptr %92, align 1, !tbaa !12
  %94 = icmp eq i8 %93, 88
  br i1 %94, label %.loopexit.thread, label %.loopexit

.loopexit:                                        ; preds = %.preheader.3, %87
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #3
  %.pre = load i32, ptr %1, align 4, !tbaa !5
  %.pre27 = load i32, ptr %2, align 4, !tbaa !5
  %.phi.trans.insert = sext i32 %.pre to i64
  %.phi.trans.insert28 = sext i32 %.pre27 to i64
  %.phi.trans.insert29 = getelementptr inbounds [510 x [510 x i8]], ptr @s, i64 0, i64 %.phi.trans.insert, i64 %.phi.trans.insert28
  %.pre30 = load i8, ptr %.phi.trans.insert29, align 1, !tbaa !12
  %95 = icmp eq i8 %.pre30, 88
  br i1 %95, label %96, label %97

96:                                               ; preds = %.loopexit
  store i32 %.pre, ptr @st, align 4, !tbaa !5
  store i32 %.pre27, ptr getelementptr inbounds (i8, ptr @st, i64 4), align 4, !tbaa !5
  store i32 0, ptr getelementptr inbounds (i8, ptr @st, i64 8), align 4, !tbaa !5
  br label %97

97:                                               ; preds = %.loopexit.thread, %.lr.ph, %32, %.loopexit, %96
  %98 = phi i32 [ %24, %.lr.ph ], [ %24, %32 ], [ %.pre27, %.loopexit ], [ %.pre27, %96 ], [ %53, %.loopexit.thread ]
  %99 = phi i32 [ %23, %.lr.ph ], [ %23, %32 ], [ %.pre, %.loopexit ], [ %.pre, %96 ], [ %51, %.loopexit.thread ]
  %100 = add nsw i32 %98, 1
  store i32 %100, ptr %2, align 4, !tbaa !5
  %101 = load i32, ptr @m, align 4, !tbaa !5
  %.not16.not = icmp slt i32 %98, %101
  br i1 %.not16.not, label %.lr.ph, label %._crit_edge.loopexit, !llvm.loop !13
}

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

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

; 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 #2

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 nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { 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, !11}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.unswitch.partial.disable"}
!12 = !{!7, !7, i64 0}
!13 = distinct !{!13, !10}


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