; LLVM IR from tangjz/acm-icpc :: self_training/2015-09-24/H.ll (Z2KMv)

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

@n = external dso_local global i32, align 4
@cur_e = external dso_local global ptr, align 8
@lx = external dso_local global [51 x i32], align 16
@ly = external dso_local global [51 x i32], align 16
@sx = external dso_local global [51 x i8], align 16
@sy = external dso_local global [51 x i8], align 16

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z2KMv() #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
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #4
  store i32 1, ptr %1, align 4, !tbaa !5
  br label %10

10:                                               ; preds = %44, %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) #4
  br label %47

15:                                               ; preds = %10
  %16 = load i32, ptr %1, align 4, !tbaa !5
  %17 = sext i32 %16 to i64
  %18 = getelementptr inbounds [51 x i32], ptr @lx, i64 0, i64 %17
  store i32 1061109567, ptr %18, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %19

19:                                               ; preds = %40, %15
  %20 = load i32, ptr %3, align 4, !tbaa !5
  %21 = load i32, ptr @n, align 4, !tbaa !5
  %22 = icmp sle i32 %20, %21
  br i1 %22, label %24, label %23

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

24:                                               ; preds = %19
  %25 = load i32, ptr %1, align 4, !tbaa !5
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds [51 x i32], ptr @lx, i64 0, i64 %26
  %28 = load ptr, ptr @cur_e, align 8, !tbaa !9
  %29 = load i32, ptr %1, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds [51 x i32], ptr %28, i64 %30
  %32 = load i32, ptr %3, align 4, !tbaa !5
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [51 x i32], ptr %31, i64 0, i64 %33
  %35 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %27, ptr noundef nonnull align 4 dereferenceable(4) %34)
  %36 = load i32, ptr %35, align 4, !tbaa !5
  %37 = load i32, ptr %1, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [51 x i32], ptr @lx, i64 0, i64 %38
  store i32 %36, ptr %39, align 4, !tbaa !5
  br label %40

40:                                               ; preds = %24
  %41 = load i32, ptr %3, align 4, !tbaa !5
  %42 = add nsw i32 %41, 1
  store i32 %42, ptr %3, align 4, !tbaa !5
  br label %19, !llvm.loop !11

43:                                               ; preds = %23
  br label %44

44:                                               ; preds = %43
  %45 = load i32, ptr %1, align 4, !tbaa !5
  %46 = add nsw i32 %45, 1
  store i32 %46, ptr %1, align 4, !tbaa !5
  br label %10, !llvm.loop !13

47:                                               ; preds = %14
  %48 = load i32, ptr @n, align 4, !tbaa !5
  %49 = sext i32 %48 to i64
  %50 = mul i64 %49, 4
  call void @llvm.memset.p0.i64(ptr align 4 getelementptr inbounds (i32, ptr @ly, i64 1), i8 0, i64 %50, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  store i32 1, ptr %4, align 4, !tbaa !5
  br label %51

51:                                               ; preds = %160, %47
  %52 = load i32, ptr %4, align 4, !tbaa !5
  %53 = load i32, ptr @n, align 4, !tbaa !5
  %54 = icmp sle i32 %52, %53
  br i1 %54, label %56, label %55

55:                                               ; preds = %51
  store i32 8, ptr %2, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  br label %163

56:                                               ; preds = %51
  br label %57

57:                                               ; preds = %158, %56
  br label %58

58:                                               ; preds = %57
  %59 = load i32, ptr @n, align 4, !tbaa !5
  %60 = sext i32 %59 to i64
  %61 = mul i64 %60, 1
  call void @llvm.memset.p0.i64(ptr align 1 getelementptr inbounds (i8, ptr @sx, i64 1), i8 0, i64 %61, i1 false)
  %62 = load i32, ptr @n, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = mul i64 %63, 1
  call void @llvm.memset.p0.i64(ptr align 1 getelementptr inbounds (i8, ptr @sy, i64 1), i8 0, i64 %64, i1 false)
  %65 = load i32, ptr %4, align 4, !tbaa !5
  %66 = call noundef zeroext i1 @_Z4pathi(i32 noundef %65)
  br i1 %66, label %67, label %68

67:                                               ; preds = %58
  br label %159

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

69:                                               ; preds = %119, %68
  %70 = load i32, ptr %6, align 4, !tbaa !5
  %71 = load i32, ptr @n, align 4, !tbaa !5
  %72 = icmp sle i32 %70, %71
  br i1 %72, label %74, label %73

73:                                               ; preds = %69
  store i32 13, ptr %2, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  br label %122

74:                                               ; preds = %69
  %75 = load i32, ptr %6, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [51 x i8], ptr @sx, i64 0, i64 %76
  %78 = load i8, ptr %77, align 1, !tbaa !14, !range !16, !noundef !17
  %79 = trunc i8 %78 to i1
  br i1 %79, label %81, label %80

80:                                               ; preds = %74
  br label %119

81:                                               ; preds = %74
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  store i32 1, ptr %7, align 4, !tbaa !5
  br label %82

82:                                               ; preds = %115, %81
  %83 = load i32, ptr %7, align 4, !tbaa !5
  %84 = load i32, ptr @n, align 4, !tbaa !5
  %85 = icmp sle i32 %83, %84
  br i1 %85, label %87, label %86

86:                                               ; preds = %82
  store i32 16, ptr %2, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %118

87:                                               ; preds = %82
  %88 = load i32, ptr %7, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [51 x i8], ptr @sy, i64 0, i64 %89
  %91 = load i8, ptr %90, align 1, !tbaa !14, !range !16, !noundef !17
  %92 = trunc i8 %91 to i1
  br i1 %92, label %114, label %93

93:                                               ; preds = %87
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  %94 = load ptr, ptr @cur_e, align 8, !tbaa !9
  %95 = load i32, ptr %6, align 4, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [51 x i32], ptr %94, i64 %96
  %98 = load i32, ptr %7, align 4, !tbaa !5
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [51 x i32], ptr %97, i64 0, i64 %99
  %101 = load i32, ptr %100, align 4, !tbaa !5
  %102 = load i32, ptr %6, align 4, !tbaa !5
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds [51 x i32], ptr @lx, i64 0, i64 %103
  %105 = load i32, ptr %104, align 4, !tbaa !5
  %106 = sub nsw i32 %101, %105
  %107 = load i32, ptr %7, align 4, !tbaa !5
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [51 x i32], ptr @ly, i64 0, i64 %108
  %110 = load i32, ptr %109, align 4, !tbaa !5
  %111 = sub nsw i32 %106, %110
  store i32 %111, ptr %8, align 4, !tbaa !5
  %112 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %8)
  %113 = load i32, ptr %112, align 4, !tbaa !5
  store i32 %113, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  br label %114

114:                                              ; preds = %93, %87
  br label %115

115:                                              ; preds = %114
  %116 = load i32, ptr %7, align 4, !tbaa !5
  %117 = add nsw i32 %116, 1
  store i32 %117, ptr %7, align 4, !tbaa !5
  br label %82, !llvm.loop !18

118:                                              ; preds = %86
  br label %119

119:                                              ; preds = %118, %80
  %120 = load i32, ptr %6, align 4, !tbaa !5
  %121 = add nsw i32 %120, 1
  store i32 %121, ptr %6, align 4, !tbaa !5
  br label %69, !llvm.loop !19

122:                                              ; preds = %73
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  store i32 1, ptr %9, align 4, !tbaa !5
  br label %123

123:                                              ; preds = %155, %122
  %124 = load i32, ptr %9, align 4, !tbaa !5
  %125 = load i32, ptr @n, align 4, !tbaa !5
  %126 = icmp sle i32 %124, %125
  br i1 %126, label %128, label %127

127:                                              ; preds = %123
  store i32 19, ptr %2, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  br label %158

128:                                              ; preds = %123
  %129 = load i32, ptr %9, align 4, !tbaa !5
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [51 x i8], ptr @sx, i64 0, i64 %130
  %132 = load i8, ptr %131, align 1, !tbaa !14, !range !16, !noundef !17
  %133 = trunc i8 %132 to i1
  br i1 %133, label %134, label %141

134:                                              ; preds = %128
  %135 = load i32, ptr %5, align 4, !tbaa !5
  %136 = load i32, ptr %9, align 4, !tbaa !5
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds [51 x i32], ptr @lx, i64 0, i64 %137
  %139 = load i32, ptr %138, align 4, !tbaa !5
  %140 = add nsw i32 %139, %135
  store i32 %140, ptr %138, align 4, !tbaa !5
  br label %141

141:                                              ; preds = %134, %128
  %142 = load i32, ptr %9, align 4, !tbaa !5
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds [51 x i8], ptr @sy, i64 0, i64 %143
  %145 = load i8, ptr %144, align 1, !tbaa !14, !range !16, !noundef !17
  %146 = trunc i8 %145 to i1
  br i1 %146, label %147, label %154

147:                                              ; preds = %141
  %148 = load i32, ptr %5, align 4, !tbaa !5
  %149 = load i32, ptr %9, align 4, !tbaa !5
  %150 = sext i32 %149 to i64
  %151 = getelementptr inbounds [51 x i32], ptr @ly, i64 0, i64 %150
  %152 = load i32, ptr %151, align 4, !tbaa !5
  %153 = sub nsw i32 %152, %148
  store i32 %153, ptr %151, align 4, !tbaa !5
  br label %154

154:                                              ; preds = %147, %141
  br label %155

155:                                              ; preds = %154
  %156 = load i32, ptr %9, align 4, !tbaa !5
  %157 = add nsw i32 %156, 1
  store i32 %157, ptr %9, align 4, !tbaa !5
  br label %123, !llvm.loop !20

158:                                              ; preds = %127
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  br label %57, !llvm.loop !21

159:                                              ; preds = %67
  br label %160

160:                                              ; preds = %159
  %161 = load i32, ptr %4, align 4, !tbaa !5
  %162 = add nsw i32 %161, 1
  store i32 %162, ptr %4, align 4, !tbaa !5
  br label %51, !llvm.loop !22

163:                                              ; preds = %55
  ret void
}

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #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 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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 = !{!"any pointer", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = !{!15, !15, i64 0}
!15 = !{!"bool", !7, i64 0}
!16 = !{i8 0, i8 2}
!17 = !{}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12}
!21 = distinct !{!21, !12}
!22 = distinct !{!22, !12}


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

@n = external dso_local local_unnamed_addr global i32, align 4
@cur_e = external dso_local local_unnamed_addr global ptr, align 8
@lx = external dso_local global [51 x i32], align 16
@ly = external dso_local local_unnamed_addr global [51 x i32], align 16
@sx = external dso_local local_unnamed_addr global [51 x i8], align 16
@sy = external dso_local local_unnamed_addr global [51 x i8], align 16

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

; 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: mustprogress uwtable
define dso_local void @_Z2KMv() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = load i32, ptr @n, align 4, !tbaa !5
  %.not46 = icmp slt i32 %3, 1
  br i1 %.not46, label %._crit_edge50.thread, label %.lr.ph49.split

._crit_edge50.thread:                             ; preds = %0
  %4 = sext i32 %3 to i64
  %5 = shl nsw i64 %4, 2
  tail call void @llvm.memset.p0.i64(ptr nonnull align 4 getelementptr inbounds (i8, ptr @ly, i64 4), i8 0, i64 %5, i1 false)
  br label %._crit_edge67

._crit_edge50:                                    ; preds = %._crit_edge
  %6 = sext i32 %10 to i64
  %7 = shl nsw i64 %6, 2
  tail call void @llvm.memset.p0.i64(ptr nonnull align 4 getelementptr inbounds (i8, ptr @ly, i64 4), i8 0, i64 %7, i1 false)
  %.not3465 = icmp slt i32 %10, 1
  br i1 %.not3465, label %._crit_edge67, label %.preheader42

.lr.ph49.split:                                   ; preds = %0, %._crit_edge
  %8 = phi i32 [ %10, %._crit_edge ], [ %3, %0 ]
  %indvars.iv73 = phi i64 [ %indvars.iv.next74, %._crit_edge ], [ 1, %0 ]
  %9 = getelementptr inbounds [51 x i32], ptr @lx, i64 0, i64 %indvars.iv73
  store i32 1061109567, ptr %9, align 4, !tbaa !5
  %.not3844 = icmp slt i32 %8, 1
  br i1 %.not3844, label %.lr.ph49.split.._crit_edge_crit_edge, label %.lr.ph

.lr.ph49.split.._crit_edge_crit_edge:             ; preds = %.lr.ph49.split
  %.pre88 = sext i32 %8 to i64
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.lr.ph49.split.._crit_edge_crit_edge
  %.pre-phi = phi i64 [ %.pre88, %.lr.ph49.split.._crit_edge_crit_edge ], [ %16, %.lr.ph ]
  %10 = phi i32 [ %8, %.lr.ph49.split.._crit_edge_crit_edge ], [ %15, %.lr.ph ]
  %indvars.iv.next74 = add nuw nsw i64 %indvars.iv73, 1
  %.not.not = icmp slt i64 %indvars.iv73, %.pre-phi
  br i1 %.not.not, label %.lr.ph49.split, label %._crit_edge50, !llvm.loop !9

.lr.ph:                                           ; preds = %.lr.ph49.split, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %.lr.ph49.split ]
  %11 = load ptr, ptr @cur_e, align 8, !tbaa !12
  %12 = getelementptr inbounds [51 x i32], ptr %11, i64 %indvars.iv73, i64 %indvars.iv
  %13 = tail 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) %12)
  %14 = load i32, ptr %13, align 4, !tbaa !5
  store i32 %14, ptr %9, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %15 = load i32, ptr @n, align 4, !tbaa !5
  %16 = sext i32 %15 to i64
  %.not38.not = icmp slt i64 %indvars.iv, %16
  br i1 %.not38.not, label %.lr.ph, label %._crit_edge, !llvm.loop !14

.preheader42:                                     ; preds = %._crit_edge50, %._crit_edge64
  %17 = phi i32 [ %75, %._crit_edge64 ], [ %10, %._crit_edge50 ]
  %.03066 = phi i32 [ %74, %._crit_edge64 ], [ 1, %._crit_edge50 ]
  %18 = sext i32 %17 to i64
  call void @llvm.memset.p0.i64(ptr nonnull align 1 getelementptr inbounds (i8, ptr @sx, i64 1), i8 0, i64 %18, i1 false)
  call void @llvm.memset.p0.i64(ptr nonnull align 1 getelementptr inbounds (i8, ptr @sy, i64 1), i8 0, i64 %18, i1 false)
  %19 = call noundef zeroext i1 @_Z4pathi(i32 noundef %.03066)
  br i1 %19, label %._crit_edge64, label %.lr.ph63

._crit_edge67:                                    ; preds = %._crit_edge64, %._crit_edge50.thread, %._crit_edge50
  ret void

.lr.ph63:                                         ; preds = %.preheader42, %._crit_edge62
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #4
  store i32 1061109567, ptr %1, align 4, !tbaa !5
  %20 = load i32, ptr @n, align 4
  %.not3554 = icmp slt i32 %20, 1
  br i1 %.not3554, label %._crit_edge62, label %.lr.ph57

.preheader41:                                     ; preds = %.loopexit
  %.not3659 = icmp slt i32 %52, 1
  br i1 %.not3659, label %._crit_edge62, label %.lr.ph61

.lr.ph61:                                         ; preds = %.preheader41
  %21 = add nuw i32 %52, 1
  %wide.trip.count = zext i32 %21 to i64
  br label %57

.lr.ph57:                                         ; preds = %.lr.ph63, %.loopexit
  %22 = phi i32 [ %51, %.loopexit ], [ 1061109567, %.lr.ph63 ]
  %23 = phi i32 [ %52, %.loopexit ], [ %20, %.lr.ph63 ]
  %indvars.iv82 = phi i64 [ %indvars.iv.next83, %.loopexit ], [ 1, %.lr.ph63 ]
  %24 = getelementptr inbounds [51 x i8], ptr @sx, i64 0, i64 %indvars.iv82
  %25 = load i8, ptr %24, align 1, !tbaa !15, !range !17, !noundef !18
  %26 = trunc nuw i8 %25 to i1
  %.not3751 = icmp sgt i32 %23, 0
  %or.cond.not = and i1 %.not3751, %26
  br i1 %or.cond.not, label %.lr.ph53, label %.loopexit

.lr.ph53:                                         ; preds = %.lr.ph57
  %27 = getelementptr inbounds [51 x i32], ptr @lx, i64 0, i64 %indvars.iv82
  br label %28

28:                                               ; preds = %.lr.ph53, %46
  %29 = phi i32 [ %22, %.lr.ph53 ], [ %47, %46 ]
  %30 = phi i32 [ %23, %.lr.ph53 ], [ %48, %46 ]
  %31 = phi i32 [ %23, %.lr.ph53 ], [ %49, %46 ]
  %indvars.iv79 = phi i64 [ 1, %.lr.ph53 ], [ %indvars.iv.next80, %46 ]
  %32 = getelementptr inbounds [51 x i8], ptr @sy, i64 0, i64 %indvars.iv79
  %33 = load i8, ptr %32, align 1, !tbaa !15, !range !17, !noundef !18
  %34 = trunc nuw i8 %33 to i1
  br i1 %34, label %46, label %35

35:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #4
  %36 = load ptr, ptr @cur_e, align 8, !tbaa !12
  %37 = getelementptr inbounds [51 x i32], ptr %36, i64 %indvars.iv82, i64 %indvars.iv79
  %38 = load i32, ptr %37, align 4, !tbaa !5
  %39 = load i32, ptr %27, align 4, !tbaa !5
  %40 = getelementptr inbounds [51 x i32], ptr @ly, i64 0, i64 %indvars.iv79
  %41 = load i32, ptr %40, align 4, !tbaa !5
  %42 = add i32 %39, %41
  %43 = sub i32 %38, %42
  store i32 %43, ptr %2, align 4, !tbaa !5
  %44 = 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) %2)
  %45 = load i32, ptr %44, align 4, !tbaa !5
  store i32 %45, ptr %1, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #4
  %.pre = load i32, ptr @n, align 4
  br label %46

46:                                               ; preds = %28, %35
  %47 = phi i32 [ %29, %28 ], [ %45, %35 ]
  %48 = phi i32 [ %30, %28 ], [ %.pre, %35 ]
  %49 = phi i32 [ %31, %28 ], [ %.pre, %35 ]
  %indvars.iv.next80 = add nuw nsw i64 %indvars.iv79, 1
  %50 = sext i32 %49 to i64
  %.not37.not = icmp slt i64 %indvars.iv79, %50
  br i1 %.not37.not, label %28, label %.loopexit, !llvm.loop !19

.loopexit:                                        ; preds = %46, %.lr.ph57
  %51 = phi i32 [ %22, %.lr.ph57 ], [ %47, %46 ]
  %52 = phi i32 [ %23, %.lr.ph57 ], [ %48, %46 ]
  %indvars.iv.next83 = add nuw nsw i64 %indvars.iv82, 1
  %53 = sext i32 %52 to i64
  %.not35.not = icmp slt i64 %indvars.iv82, %53
  br i1 %.not35.not, label %.lr.ph57, label %.preheader41, !llvm.loop !20

._crit_edge62:                                    ; preds = %73, %.lr.ph63, %.preheader41
  %54 = phi i32 [ %52, %.preheader41 ], [ %20, %.lr.ph63 ], [ %52, %73 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #4
  %55 = sext i32 %54 to i64
  call void @llvm.memset.p0.i64(ptr nonnull align 1 getelementptr inbounds (i8, ptr @sx, i64 1), i8 0, i64 %55, i1 false)
  call void @llvm.memset.p0.i64(ptr nonnull align 1 getelementptr inbounds (i8, ptr @sy, i64 1), i8 0, i64 %55, i1 false)
  %56 = call noundef zeroext i1 @_Z4pathi(i32 noundef %.03066)
  br i1 %56, label %._crit_edge64, label %.lr.ph63, !llvm.loop !21

57:                                               ; preds = %.lr.ph61, %73
  %indvars.iv85 = phi i64 [ 1, %.lr.ph61 ], [ %indvars.iv.next86, %73 ]
  %58 = getelementptr inbounds [51 x i8], ptr @sx, i64 0, i64 %indvars.iv85
  %59 = load i8, ptr %58, align 1, !tbaa !15, !range !17, !noundef !18
  %60 = trunc nuw i8 %59 to i1
  br i1 %60, label %61, label %65

61:                                               ; preds = %57
  %62 = getelementptr inbounds [51 x i32], ptr @lx, i64 0, i64 %indvars.iv85
  %63 = load i32, ptr %62, align 4, !tbaa !5
  %64 = add nsw i32 %63, %51
  store i32 %64, ptr %62, align 4, !tbaa !5
  br label %65

65:                                               ; preds = %61, %57
  %66 = getelementptr inbounds [51 x i8], ptr @sy, i64 0, i64 %indvars.iv85
  %67 = load i8, ptr %66, align 1, !tbaa !15, !range !17, !noundef !18
  %68 = trunc nuw i8 %67 to i1
  br i1 %68, label %69, label %73

69:                                               ; preds = %65
  %70 = getelementptr inbounds [51 x i32], ptr @ly, i64 0, i64 %indvars.iv85
  %71 = load i32, ptr %70, align 4, !tbaa !5
  %72 = sub nsw i32 %71, %51
  store i32 %72, ptr %70, align 4, !tbaa !5
  br label %73

73:                                               ; preds = %65, %69
  %indvars.iv.next86 = add nuw nsw i64 %indvars.iv85, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next86, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge62, label %57, !llvm.loop !22

._crit_edge64:                                    ; preds = %._crit_edge62, %.preheader42
  %74 = add nuw nsw i32 %.03066, 1
  %75 = load i32, ptr @n, align 4, !tbaa !5
  %.not34.not = icmp slt i32 %.03066, %75
  br i1 %.not34.not, label %.preheader42, label %._crit_edge67, !llvm.loop !23
}

; 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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #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 = { 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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, !11}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.unswitch.partial.disable"}
!12 = !{!13, !13, i64 0}
!13 = !{!"any pointer", !7, i64 0}
!14 = distinct !{!14, !10}
!15 = !{!16, !16, i64 0}
!16 = !{!"bool", !7, i64 0}
!17 = !{i8 0, i8 2}
!18 = !{}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10}
!21 = distinct !{!21, !10}
!22 = distinct !{!22, !10}
!23 = distinct !{!23, !10}


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