; LLVM IR from tangjz/acm-icpc :: codeforces/complete (662C)

; 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
@m = external dso_local global i32, align 4
@val = external dso_local global [100000 x i32], align 16
@len = external dso_local global i32, align 4
@inv_len = external dso_local global i32, align 4
@x = external dso_local global [1048576 x i32], align 16
@sz = external dso_local global [1048576 x i32], align 16
@str = external dso_local global [100001 x i8], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @m)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %13

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

17:                                               ; preds = %13
  store i32 2, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #4
  br label %48

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

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

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

25:                                               ; preds = %20
  %26 = load i32, ptr %4, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [100001 x i8], ptr @str, i64 0, i64 %27
  %29 = load i8, ptr %28, align 1, !tbaa !9
  %30 = sext i8 %29 to i32
  %31 = icmp eq i32 %30, 49
  br i1 %31, label %32, label %40

32:                                               ; preds = %25
  %33 = load i32, ptr %2, align 4, !tbaa !5
  %34 = shl i32 1, %33
  %35 = load i32, ptr %4, align 4, !tbaa !5
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [100000 x i32], ptr @val, i64 0, i64 %36
  %38 = load i32, ptr %37, align 4, !tbaa !5
  %39 = or i32 %38, %34
  store i32 %39, ptr %37, align 4, !tbaa !5
  br label %40

40:                                               ; preds = %32, %25
  br label %41

41:                                               ; preds = %40
  %42 = load i32, ptr %4, align 4, !tbaa !5
  %43 = add nsw i32 %42, 1
  store i32 %43, ptr %4, align 4, !tbaa !5
  br label %20, !llvm.loop !10

44:                                               ; preds = %24
  br label %45

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

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

49:                                               ; preds = %63, %48
  %50 = load i32, ptr %5, align 4, !tbaa !5
  %51 = load i32, ptr @m, align 4, !tbaa !5
  %52 = icmp slt i32 %50, %51
  br i1 %52, label %54, label %53

53:                                               ; preds = %49
  store i32 8, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  br label %66

54:                                               ; preds = %49
  %55 = load i32, ptr %5, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [100000 x i32], ptr @val, i64 0, i64 %56
  %58 = load i32, ptr %57, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [1048576 x i32], ptr @x, i64 0, i64 %59
  %61 = load i32, ptr %60, align 4, !tbaa !5
  %62 = add nsw i32 %61, 1
  store i32 %62, ptr %60, align 4, !tbaa !5
  br label %63

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

66:                                               ; preds = %53
  %67 = load i32, ptr @n, align 4, !tbaa !5
  %68 = shl i32 1, %67
  store i32 %68, ptr @len, align 4, !tbaa !5
  store i32 1, ptr @inv_len, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %69

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

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

74:                                               ; preds = %69
  %75 = load i32, ptr @inv_len, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = mul nsw i64 %76, 500000004
  %78 = srem i64 %77, 1000000007
  %79 = trunc i64 %78 to i32
  store i32 %79, ptr @inv_len, align 4, !tbaa !5
  br label %80

80:                                               ; preds = %74
  %81 = load i32, ptr %6, align 4, !tbaa !5
  %82 = add nsw i32 %81, 1
  store i32 %82, ptr %6, align 4, !tbaa !5
  br label %69, !llvm.loop !14

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

84:                                               ; preds = %101, %83
  %85 = load i32, ptr %7, align 4, !tbaa !5
  %86 = load i32, ptr @len, align 4, !tbaa !5
  %87 = icmp slt i32 %85, %86
  br i1 %87, label %89, label %88

88:                                               ; preds = %84
  store i32 14, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %104

89:                                               ; preds = %84
  %90 = load i32, ptr %7, align 4, !tbaa !5
  %91 = ashr i32 %90, 1
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [1048576 x i32], ptr @sz, i64 0, i64 %92
  %94 = load i32, ptr %93, align 4, !tbaa !5
  %95 = load i32, ptr %7, align 4, !tbaa !5
  %96 = and i32 %95, 1
  %97 = add nsw i32 %94, %96
  %98 = load i32, ptr %7, align 4, !tbaa !5
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [1048576 x i32], ptr @sz, i64 0, i64 %99
  store i32 %97, ptr %100, align 4, !tbaa !5
  br label %101

101:                                              ; preds = %89
  %102 = load i32, ptr %7, align 4, !tbaa !5
  %103 = add nsw i32 %102, 1
  store i32 %103, ptr %7, align 4, !tbaa !5
  br label %84, !llvm.loop !15

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

105:                                              ; preds = %133, %104
  %106 = load i32, ptr %8, align 4, !tbaa !5
  %107 = load i32, ptr @len, align 4, !tbaa !5
  %108 = icmp slt i32 %106, %107
  br i1 %108, label %110, label %109

109:                                              ; preds = %105
  store i32 17, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  br label %136

110:                                              ; preds = %105
  %111 = load i32, ptr %8, align 4, !tbaa !5
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [1048576 x i32], ptr @sz, i64 0, i64 %112
  %114 = load i32, ptr %113, align 4, !tbaa !5
  %115 = load i32, ptr @n, align 4, !tbaa !5
  %116 = load i32, ptr %8, align 4, !tbaa !5
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds [1048576 x i32], ptr @sz, i64 0, i64 %117
  %119 = load i32, ptr %118, align 4, !tbaa !5
  %120 = sub nsw i32 %115, %119
  %121 = icmp sgt i32 %114, %120
  br i1 %121, label %122, label %132

122:                                              ; preds = %110
  %123 = load i32, ptr @n, align 4, !tbaa !5
  %124 = load i32, ptr %8, align 4, !tbaa !5
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [1048576 x i32], ptr @sz, i64 0, i64 %125
  %127 = load i32, ptr %126, align 4, !tbaa !5
  %128 = sub nsw i32 %123, %127
  %129 = load i32, ptr %8, align 4, !tbaa !5
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [1048576 x i32], ptr @sz, i64 0, i64 %130
  store i32 %128, ptr %131, align 4, !tbaa !5
  br label %132

132:                                              ; preds = %122, %110
  br label %133

133:                                              ; preds = %132
  %134 = load i32, ptr %8, align 4, !tbaa !5
  %135 = add nsw i32 %134, 1
  store i32 %135, ptr %8, align 4, !tbaa !5
  br label %105, !llvm.loop !16

136:                                              ; preds = %109
  %137 = load i32, ptr @len, align 4, !tbaa !5
  call void @_Z3FWTPiii(ptr noundef @x, i32 noundef %137, i32 noundef 0)
  %138 = load i32, ptr @len, align 4, !tbaa !5
  call void @_Z3FWTPiii(ptr noundef @sz, i32 noundef %138, i32 noundef 0)
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %139

139:                                              ; preds = %161, %136
  %140 = load i32, ptr %9, align 4, !tbaa !5
  %141 = load i32, ptr @len, align 4, !tbaa !5
  %142 = icmp slt i32 %140, %141
  br i1 %142, label %144, label %143

143:                                              ; preds = %139
  store i32 20, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  br label %164

144:                                              ; preds = %139
  %145 = load i32, ptr %9, align 4, !tbaa !5
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds [1048576 x i32], ptr @x, i64 0, i64 %146
  %148 = load i32, ptr %147, align 4, !tbaa !5
  %149 = sext i32 %148 to i64
  %150 = load i32, ptr %9, align 4, !tbaa !5
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds [1048576 x i32], ptr @sz, i64 0, i64 %151
  %153 = load i32, ptr %152, align 4, !tbaa !5
  %154 = sext i32 %153 to i64
  %155 = mul nsw i64 %149, %154
  %156 = srem i64 %155, 1000000007
  %157 = trunc i64 %156 to i32
  %158 = load i32, ptr %9, align 4, !tbaa !5
  %159 = sext i32 %158 to i64
  %160 = getelementptr inbounds [1048576 x i32], ptr @x, i64 0, i64 %159
  store i32 %157, ptr %160, align 4, !tbaa !5
  br label %161

161:                                              ; preds = %144
  %162 = load i32, ptr %9, align 4, !tbaa !5
  %163 = add nsw i32 %162, 1
  store i32 %163, ptr %9, align 4, !tbaa !5
  br label %139, !llvm.loop !17

164:                                              ; preds = %143
  %165 = load i32, ptr @len, align 4, !tbaa !5
  call void @_Z3FWTPiii(ptr noundef @x, i32 noundef %165, i32 noundef 1)
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  %166 = load i32, ptr @n, align 4, !tbaa !5
  %167 = load i32, ptr @m, align 4, !tbaa !5
  %168 = mul nsw i32 %166, %167
  store i32 %168, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %169

169:                                              ; preds = %187, %164
  %170 = load i32, ptr %11, align 4, !tbaa !5
  %171 = load i32, ptr @len, align 4, !tbaa !5
  %172 = icmp slt i32 %170, %171
  br i1 %172, label %174, label %173

173:                                              ; preds = %169
  store i32 23, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  br label %190

174:                                              ; preds = %169
  %175 = load i32, ptr %10, align 4, !tbaa !5
  %176 = load i32, ptr %11, align 4, !tbaa !5
  %177 = sext i32 %176 to i64
  %178 = getelementptr inbounds [1048576 x i32], ptr @x, i64 0, i64 %177
  %179 = load i32, ptr %178, align 4, !tbaa !5
  %180 = icmp sgt i32 %175, %179
  br i1 %180, label %181, label %186

181:                                              ; preds = %174
  %182 = load i32, ptr %11, align 4, !tbaa !5
  %183 = sext i32 %182 to i64
  %184 = getelementptr inbounds [1048576 x i32], ptr @x, i64 0, i64 %183
  %185 = load i32, ptr %184, align 4, !tbaa !5
  store i32 %185, ptr %10, align 4, !tbaa !5
  br label %186

186:                                              ; preds = %181, %174
  br label %187

187:                                              ; preds = %186
  %188 = load i32, ptr %11, align 4, !tbaa !5
  %189 = add nsw i32 %188, 1
  store i32 %189, ptr %11, align 4, !tbaa !5
  br label %169, !llvm.loop !18

190:                                              ; preds = %173
  %191 = load i32, ptr %10, align 4, !tbaa !5
  %192 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %191)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  %193 = load i32, ptr %1, align 4
  ret i32 %193
}

declare i32 @__isoc99_scanf(ptr noundef, ...) #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 uwtable
declare dso_local void @_Z3FWTPiii(ptr noundef, i32 noundef, i32 noundef) #3

declare i32 @printf(ptr noundef, ...) #1

attributes #0 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
!13 = distinct !{!13, !11}
!14 = distinct !{!14, !11}
!15 = distinct !{!15, !11}
!16 = distinct !{!16, !11}
!17 = distinct !{!17, !11}
!18 = distinct !{!18, !11}


; 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 global i32, align 4
@m = external dso_local global i32, align 4
@val = external dso_local local_unnamed_addr global [100000 x i32], align 16
@len = external dso_local local_unnamed_addr global i32, align 4
@inv_len = external dso_local local_unnamed_addr global i32, align 4
@x = external dso_local global [1048576 x i32], align 16
@sz = external dso_local global [1048576 x i32], align 16
@str = external dso_local global [100001 x i8], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @m)
  %2 = load i32, ptr @n, align 4, !tbaa !5
  %3 = icmp sgt i32 %2, 0
  br i1 %3, label %.lr.ph53, label %..preheader48_crit_edge

..preheader48_crit_edge:                          ; preds = %0
  %.pre = load i32, ptr @m, align 4, !tbaa !5
  br label %.preheader48

.preheader48:                                     ; preds = %._crit_edge, %..preheader48_crit_edge
  %4 = phi i32 [ %.pre, %..preheader48_crit_edge ], [ %8, %._crit_edge ]
  %.lcssa49 = phi i32 [ %2, %..preheader48_crit_edge ], [ %20, %._crit_edge ]
  %5 = icmp sgt i32 %4, 0
  br i1 %5, label %.lr.ph55.preheader, label %._crit_edge56

.lr.ph55.preheader:                               ; preds = %.preheader48
  %wide.trip.count82 = zext nneg i32 %4 to i64
  %xtraiter145 = and i64 %wide.trip.count82, 3
  %6 = icmp ult i32 %4, 4
  br i1 %6, label %._crit_edge56.loopexit.unr-lcssa, label %.lr.ph55.preheader.new

.lr.ph55.preheader.new:                           ; preds = %.lr.ph55.preheader
  %unroll_iter147 = and i64 %wide.trip.count82, 2147483644
  br label %.lr.ph55

.lr.ph53:                                         ; preds = %0, %._crit_edge
  %.04251 = phi i32 [ %19, %._crit_edge ], [ 0, %0 ]
  %7 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @str)
  %8 = load i32, ptr @m, align 4, !tbaa !5
  %9 = icmp sgt i32 %8, 0
  br i1 %9, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.lr.ph53
  %10 = shl nuw i32 1, %.04251
  %wide.trip.count = zext nneg i32 %8 to i64
  %xtraiter = and i64 %wide.trip.count, 1
  %11 = icmp eq i32 %8, 1
  br i1 %11, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph.new

.lr.ph.new:                                       ; preds = %.lr.ph
  %unroll_iter = and i64 %wide.trip.count, 2147483646
  br label %22

._crit_edge.loopexit.unr-lcssa:                   ; preds = %38, %.lr.ph
  %indvars.iv.unr = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next.1, %38 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge, label %.epil.preheader

.epil.preheader:                                  ; preds = %._crit_edge.loopexit.unr-lcssa
  %12 = getelementptr inbounds [100001 x i8], ptr @str, i64 0, i64 %indvars.iv.unr
  %13 = load i8, ptr %12, align 1, !tbaa !9
  %14 = icmp eq i8 %13, 49
  br i1 %14, label %15, label %._crit_edge

15:                                               ; preds = %.epil.preheader
  %16 = getelementptr inbounds [100000 x i32], ptr @val, i64 0, i64 %indvars.iv.unr
  %17 = load i32, ptr %16, align 4, !tbaa !5
  %18 = or i32 %17, %10
  store i32 %18, ptr %16, align 4, !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit.unr-lcssa, %15, %.epil.preheader, %.lr.ph53
  %19 = add nuw nsw i32 %.04251, 1
  %20 = load i32, ptr @n, align 4, !tbaa !5
  %21 = icmp slt i32 %19, %20
  br i1 %21, label %.lr.ph53, label %.preheader48, !llvm.loop !10

22:                                               ; preds = %38, %.lr.ph.new
  %indvars.iv = phi i64 [ 0, %.lr.ph.new ], [ %indvars.iv.next.1, %38 ]
  %niter = phi i64 [ 0, %.lr.ph.new ], [ %niter.next.1, %38 ]
  %23 = getelementptr inbounds [100001 x i8], ptr @str, i64 0, i64 %indvars.iv
  %24 = load i8, ptr %23, align 2, !tbaa !9
  %25 = icmp eq i8 %24, 49
  br i1 %25, label %26, label %30

26:                                               ; preds = %22
  %27 = getelementptr inbounds [100000 x i32], ptr @val, i64 0, i64 %indvars.iv
  %28 = load i32, ptr %27, align 8, !tbaa !5
  %29 = or i32 %28, %10
  store i32 %29, ptr %27, align 8, !tbaa !5
  br label %30

30:                                               ; preds = %22, %26
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %31 = getelementptr inbounds [100001 x i8], ptr @str, i64 0, i64 %indvars.iv.next
  %32 = load i8, ptr %31, align 1, !tbaa !9
  %33 = icmp eq i8 %32, 49
  br i1 %33, label %34, label %38

34:                                               ; preds = %30
  %35 = getelementptr inbounds [100000 x i32], ptr @val, i64 0, i64 %indvars.iv.next
  %36 = load i32, ptr %35, align 4, !tbaa !5
  %37 = or i32 %36, %10
  store i32 %37, ptr %35, align 4, !tbaa !5
  br label %38

38:                                               ; preds = %34, %30
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge.loopexit.unr-lcssa, label %22, !llvm.loop !12

._crit_edge56.loopexit.unr-lcssa:                 ; preds = %.lr.ph55, %.lr.ph55.preheader
  %indvars.iv79.unr = phi i64 [ 0, %.lr.ph55.preheader ], [ %indvars.iv.next80.3, %.lr.ph55 ]
  %lcmp.mod146.not = icmp eq i64 %xtraiter145, 0
  br i1 %lcmp.mod146.not, label %._crit_edge56, label %.lr.ph55.epil

.lr.ph55.epil:                                    ; preds = %._crit_edge56.loopexit.unr-lcssa, %.lr.ph55.epil
  %indvars.iv79.epil = phi i64 [ %indvars.iv.next80.epil, %.lr.ph55.epil ], [ %indvars.iv79.unr, %._crit_edge56.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph55.epil ], [ 0, %._crit_edge56.loopexit.unr-lcssa ]
  %39 = getelementptr inbounds [100000 x i32], ptr @val, i64 0, i64 %indvars.iv79.epil
  %40 = load i32, ptr %39, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [1048576 x i32], ptr @x, i64 0, i64 %41
  %43 = load i32, ptr %42, align 4, !tbaa !5
  %44 = add nsw i32 %43, 1
  store i32 %44, ptr %42, align 4, !tbaa !5
  %indvars.iv.next80.epil = add nuw nsw i64 %indvars.iv79.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter145
  br i1 %epil.iter.cmp.not, label %._crit_edge56, label %.lr.ph55.epil, !llvm.loop !13

._crit_edge56:                                    ; preds = %._crit_edge56.loopexit.unr-lcssa, %.lr.ph55.epil, %.preheader48
  %45 = shl nuw i32 1, %.lcssa49
  store i32 %45, ptr @len, align 4, !tbaa !5
  store i32 1, ptr @inv_len, align 4, !tbaa !5
  %46 = icmp sgt i32 %.lcssa49, 0
  br i1 %46, label %.lr.ph59.preheader, label %.preheader47

.lr.ph59.preheader:                               ; preds = %._crit_edge56
  %xtraiter149 = and i32 %.lcssa49, 3
  %47 = icmp ult i32 %.lcssa49, 4
  br i1 %47, label %..preheader47_crit_edge.unr-lcssa, label %.lr.ph59.preheader.new

.lr.ph59.preheader.new:                           ; preds = %.lr.ph59.preheader
  %unroll_iter153 = and i32 %.lcssa49, 2147483644
  br label %.lr.ph59

.lr.ph55:                                         ; preds = %.lr.ph55, %.lr.ph55.preheader.new
  %indvars.iv79 = phi i64 [ 0, %.lr.ph55.preheader.new ], [ %indvars.iv.next80.3, %.lr.ph55 ]
  %niter148 = phi i64 [ 0, %.lr.ph55.preheader.new ], [ %niter148.next.3, %.lr.ph55 ]
  %48 = getelementptr inbounds [100000 x i32], ptr @val, i64 0, i64 %indvars.iv79
  %49 = load i32, ptr %48, align 16, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [1048576 x i32], ptr @x, i64 0, i64 %50
  %52 = load i32, ptr %51, align 4, !tbaa !5
  %53 = add nsw i32 %52, 1
  store i32 %53, ptr %51, align 4, !tbaa !5
  %indvars.iv.next80 = or disjoint i64 %indvars.iv79, 1
  %54 = getelementptr inbounds [100000 x i32], ptr @val, i64 0, i64 %indvars.iv.next80
  %55 = load i32, ptr %54, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [1048576 x i32], ptr @x, i64 0, i64 %56
  %58 = load i32, ptr %57, align 4, !tbaa !5
  %59 = add nsw i32 %58, 1
  store i32 %59, ptr %57, align 4, !tbaa !5
  %indvars.iv.next80.1 = or disjoint i64 %indvars.iv79, 2
  %60 = getelementptr inbounds [100000 x i32], ptr @val, i64 0, i64 %indvars.iv.next80.1
  %61 = load i32, ptr %60, align 8, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [1048576 x i32], ptr @x, i64 0, i64 %62
  %64 = load i32, ptr %63, align 4, !tbaa !5
  %65 = add nsw i32 %64, 1
  store i32 %65, ptr %63, align 4, !tbaa !5
  %indvars.iv.next80.2 = or disjoint i64 %indvars.iv79, 3
  %66 = getelementptr inbounds [100000 x i32], ptr @val, i64 0, i64 %indvars.iv.next80.2
  %67 = load i32, ptr %66, align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [1048576 x i32], ptr @x, i64 0, i64 %68
  %70 = load i32, ptr %69, align 4, !tbaa !5
  %71 = add nsw i32 %70, 1
  store i32 %71, ptr %69, align 4, !tbaa !5
  %indvars.iv.next80.3 = add nuw nsw i64 %indvars.iv79, 4
  %niter148.next.3 = add i64 %niter148, 4
  %niter148.ncmp.3 = icmp eq i64 %niter148.next.3, %unroll_iter147
  br i1 %niter148.ncmp.3, label %._crit_edge56.loopexit.unr-lcssa, label %.lr.ph55, !llvm.loop !15

..preheader47_crit_edge.unr-lcssa:                ; preds = %.lr.ph59, %.lr.ph59.preheader
  %.lcssa142.ph = phi i64 [ poison, %.lr.ph59.preheader ], [ %87, %.lr.ph59 ]
  %.unr = phi i64 [ 1, %.lr.ph59.preheader ], [ %87, %.lr.ph59 ]
  %lcmp.mod151.not = icmp eq i32 %xtraiter149, 0
  br i1 %lcmp.mod151.not, label %..preheader47_crit_edge, label %.lr.ph59.epil

.lr.ph59.epil:                                    ; preds = %..preheader47_crit_edge.unr-lcssa, %.lr.ph59.epil
  %72 = phi i64 [ %74, %.lr.ph59.epil ], [ %.unr, %..preheader47_crit_edge.unr-lcssa ]
  %epil.iter150 = phi i32 [ %epil.iter150.next, %.lr.ph59.epil ], [ 0, %..preheader47_crit_edge.unr-lcssa ]
  %73 = mul nuw nsw i64 %72, 500000004
  %74 = urem i64 %73, 1000000007
  %epil.iter150.next = add i32 %epil.iter150, 1
  %epil.iter150.cmp.not = icmp eq i32 %epil.iter150.next, %xtraiter149
  br i1 %epil.iter150.cmp.not, label %..preheader47_crit_edge, label %.lr.ph59.epil, !llvm.loop !16

..preheader47_crit_edge:                          ; preds = %.lr.ph59.epil, %..preheader47_crit_edge.unr-lcssa
  %.lcssa142 = phi i64 [ %.lcssa142.ph, %..preheader47_crit_edge.unr-lcssa ], [ %74, %.lr.ph59.epil ]
  %75 = trunc nuw nsw i64 %.lcssa142 to i32
  store i32 %75, ptr @inv_len, align 4, !tbaa !5
  br label %.preheader47

.preheader47:                                     ; preds = %..preheader47_crit_edge, %._crit_edge56
  %76 = icmp sgt i32 %45, 1
  br i1 %76, label %.lr.ph62.preheader, label %.preheader

.lr.ph62.preheader:                               ; preds = %.preheader47
  %wide.trip.count88 = zext nneg i32 %45 to i64
  %77 = add nsw i64 %wide.trip.count88, -1
  %xtraiter155 = and i64 %77, 1
  %78 = icmp eq i32 %.lcssa49, 1
  br i1 %78, label %.preheader.loopexit.unr-lcssa, label %.lr.ph62.preheader.new

.lr.ph62.preheader.new:                           ; preds = %.lr.ph62.preheader
  %unroll_iter158 = and i64 %77, -2
  br label %.lr.ph62

.lr.ph59:                                         ; preds = %.lr.ph59, %.lr.ph59.preheader.new
  %79 = phi i64 [ 1, %.lr.ph59.preheader.new ], [ %87, %.lr.ph59 ]
  %niter154 = phi i32 [ 0, %.lr.ph59.preheader.new ], [ %niter154.next.3, %.lr.ph59 ]
  %80 = mul nuw nsw i64 %79, 500000004
  %81 = urem i64 %80, 1000000007
  %82 = mul nuw nsw i64 %81, 500000004
  %83 = urem i64 %82, 1000000007
  %84 = mul nuw nsw i64 %83, 500000004
  %85 = urem i64 %84, 1000000007
  %86 = mul nuw nsw i64 %85, 500000004
  %87 = urem i64 %86, 1000000007
  %niter154.next.3 = add i32 %niter154, 4
  %niter154.ncmp.3 = icmp eq i32 %niter154.next.3, %unroll_iter153
  br i1 %niter154.ncmp.3, label %..preheader47_crit_edge.unr-lcssa, label %.lr.ph59, !llvm.loop !17

.preheader.loopexit.unr-lcssa:                    ; preds = %.lr.ph62, %.lr.ph62.preheader
  %indvars.iv85.unr = phi i64 [ 1, %.lr.ph62.preheader ], [ %indvars.iv.next86.1, %.lr.ph62 ]
  %lcmp.mod157.not = icmp eq i64 %xtraiter155, 0
  br i1 %lcmp.mod157.not, label %.preheader, label %.lr.ph62.epil

.lr.ph62.epil:                                    ; preds = %.preheader.loopexit.unr-lcssa
  %88 = trunc nuw nsw i64 %indvars.iv85.unr to i32
  %89 = lshr i64 %indvars.iv85.unr, 1
  %90 = and i64 %89, 2147483647
  %91 = getelementptr inbounds [1048576 x i32], ptr @sz, i64 0, i64 %90
  %92 = load i32, ptr %91, align 4, !tbaa !5
  %93 = and i32 %88, 1
  %94 = add nsw i32 %92, %93
  %95 = getelementptr inbounds [1048576 x i32], ptr @sz, i64 0, i64 %indvars.iv85.unr
  store i32 %94, ptr %95, align 4, !tbaa !5
  br label %.preheader

.preheader:                                       ; preds = %.lr.ph62.epil, %.preheader.loopexit.unr-lcssa, %.preheader47
  %.not = icmp eq i32 %.lcssa49, 31
  br i1 %.not, label %._crit_edge65, label %.lr.ph64.preheader

.lr.ph64.preheader:                               ; preds = %.preheader
  %min.iters.check = icmp slt i32 %45, 8
  br i1 %min.iters.check, label %.lr.ph64, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph64.preheader
  %96 = and i32 %45, 2147483640
  %n.vec = zext nneg i32 %96 to i64
  %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %.lcssa49, i64 0
  %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %pred.store.continue123, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %pred.store.continue123 ]
  %97 = or disjoint i64 %index, 4
  %98 = getelementptr inbounds [1048576 x i32], ptr @sz, i64 0, i64 %index
  %99 = getelementptr inbounds i8, ptr %98, i64 16
  %wide.load = load <4 x i32>, ptr %98, align 16, !tbaa !5
  %wide.load109 = load <4 x i32>, ptr %99, align 16, !tbaa !5
  %100 = sub nsw <4 x i32> %broadcast.splat, %wide.load
  %101 = sub nsw <4 x i32> %broadcast.splat, %wide.load109
  %102 = icmp sgt <4 x i32> %wide.load, %100
  %103 = icmp sgt <4 x i32> %wide.load109, %101
  %104 = extractelement <4 x i1> %102, i64 0
  br i1 %104, label %pred.store.if, label %pred.store.continue

pred.store.if:                                    ; preds = %vector.body
  %105 = getelementptr inbounds [1048576 x i32], ptr @sz, i64 0, i64 %index
  %106 = extractelement <4 x i32> %100, i64 0
  store i32 %106, ptr %105, align 16, !tbaa !5
  br label %pred.store.continue

pred.store.continue:                              ; preds = %pred.store.if, %vector.body
  %107 = extractelement <4 x i1> %102, i64 1
  br i1 %107, label %pred.store.if110, label %pred.store.continue111

pred.store.if110:                                 ; preds = %pred.store.continue
  %108 = or disjoint i64 %index, 1
  %109 = getelementptr inbounds [1048576 x i32], ptr @sz, i64 0, i64 %108
  %110 = extractelement <4 x i32> %100, i64 1
  store i32 %110, ptr %109, align 4, !tbaa !5
  br label %pred.store.continue111

pred.store.continue111:                           ; preds = %pred.store.if110, %pred.store.continue
  %111 = extractelement <4 x i1> %102, i64 2
  br i1 %111, label %pred.store.if112, label %pred.store.continue113

pred.store.if112:                                 ; preds = %pred.store.continue111
  %112 = or disjoint i64 %index, 2
  %113 = getelementptr inbounds [1048576 x i32], ptr @sz, i64 0, i64 %112
  %114 = extractelement <4 x i32> %100, i64 2
  store i32 %114, ptr %113, align 8, !tbaa !5
  br label %pred.store.continue113

pred.store.continue113:                           ; preds = %pred.store.if112, %pred.store.continue111
  %115 = extractelement <4 x i1> %102, i64 3
  br i1 %115, label %pred.store.if114, label %pred.store.continue115

pred.store.if114:                                 ; preds = %pred.store.continue113
  %116 = or disjoint i64 %index, 3
  %117 = getelementptr inbounds [1048576 x i32], ptr @sz, i64 0, i64 %116
  %118 = extractelement <4 x i32> %100, i64 3
  store i32 %118, ptr %117, align 4, !tbaa !5
  br label %pred.store.continue115

pred.store.continue115:                           ; preds = %pred.store.if114, %pred.store.continue113
  %119 = extractelement <4 x i1> %103, i64 0
  br i1 %119, label %pred.store.if116, label %pred.store.continue117

pred.store.if116:                                 ; preds = %pred.store.continue115
  %120 = getelementptr inbounds [1048576 x i32], ptr @sz, i64 0, i64 %97
  %121 = extractelement <4 x i32> %101, i64 0
  store i32 %121, ptr %120, align 16, !tbaa !5
  br label %pred.store.continue117

pred.store.continue117:                           ; preds = %pred.store.if116, %pred.store.continue115
  %122 = extractelement <4 x i1> %103, i64 1
  br i1 %122, label %pred.store.if118, label %pred.store.continue119

pred.store.if118:                                 ; preds = %pred.store.continue117
  %123 = or disjoint i64 %index, 5
  %124 = getelementptr inbounds [1048576 x i32], ptr @sz, i64 0, i64 %123
  %125 = extractelement <4 x i32> %101, i64 1
  store i32 %125, ptr %124, align 4, !tbaa !5
  br label %pred.store.continue119

pred.store.continue119:                           ; preds = %pred.store.if118, %pred.store.continue117
  %126 = extractelement <4 x i1> %103, i64 2
  br i1 %126, label %pred.store.if120, label %pred.store.continue121

pred.store.if120:                                 ; preds = %pred.store.continue119
  %127 = or disjoint i64 %index, 6
  %128 = getelementptr inbounds [1048576 x i32], ptr @sz, i64 0, i64 %127
  %129 = extractelement <4 x i32> %101, i64 2
  store i32 %129, ptr %128, align 8, !tbaa !5
  br label %pred.store.continue121

pred.store.continue121:                           ; preds = %pred.store.if120, %pred.store.continue119
  %130 = extractelement <4 x i1> %103, i64 3
  br i1 %130, label %pred.store.if122, label %pred.store.continue123

pred.store.if122:                                 ; preds = %pred.store.continue121
  %131 = or disjoint i64 %index, 7
  %132 = getelementptr inbounds [1048576 x i32], ptr @sz, i64 0, i64 %131
  %133 = extractelement <4 x i32> %101, i64 3
  store i32 %133, ptr %132, align 4, !tbaa !5
  br label %pred.store.continue123

pred.store.continue123:                           ; preds = %pred.store.if122, %pred.store.continue121
  %index.next = add nuw i64 %index, 8
  %134 = icmp eq i64 %index.next, %n.vec
  br i1 %134, label %._crit_edge65, label %vector.body, !llvm.loop !18

.lr.ph62:                                         ; preds = %.lr.ph62, %.lr.ph62.preheader.new
  %indvars.iv85 = phi i64 [ 1, %.lr.ph62.preheader.new ], [ %indvars.iv.next86.1, %.lr.ph62 ]
  %niter159 = phi i64 [ 0, %.lr.ph62.preheader.new ], [ %niter159.next.1, %.lr.ph62 ]
  %135 = lshr i64 %indvars.iv85, 1
  %136 = and i64 %135, 2147483647
  %137 = getelementptr inbounds [1048576 x i32], ptr @sz, i64 0, i64 %136
  %138 = load i32, ptr %137, align 4, !tbaa !5
  %139 = add nsw i32 %138, 1
  %140 = getelementptr inbounds [1048576 x i32], ptr @sz, i64 0, i64 %indvars.iv85
  store i32 %139, ptr %140, align 4, !tbaa !5
  %indvars.iv.next86 = add nuw nsw i64 %indvars.iv85, 1
  %141 = lshr i64 %indvars.iv.next86, 1
  %142 = and i64 %141, 2147483647
  %143 = getelementptr inbounds [1048576 x i32], ptr @sz, i64 0, i64 %142
  %144 = load i32, ptr %143, align 4, !tbaa !5
  %145 = getelementptr inbounds [1048576 x i32], ptr @sz, i64 0, i64 %indvars.iv.next86
  store i32 %144, ptr %145, align 4, !tbaa !5
  %indvars.iv.next86.1 = add nuw nsw i64 %indvars.iv85, 2
  %niter159.next.1 = add i64 %niter159, 2
  %niter159.ncmp.1 = icmp eq i64 %niter159.next.1, %unroll_iter158
  br i1 %niter159.ncmp.1, label %.preheader.loopexit.unr-lcssa, label %.lr.ph62, !llvm.loop !21

._crit_edge65:                                    ; preds = %.lr.ph64.6, %180, %pred.store.continue123, %154, %159, %168, %.preheader
  tail call void @_Z3FWTPiii(ptr noundef nonnull @x, i32 noundef %45, i32 noundef 0)
  %146 = load i32, ptr @len, align 4, !tbaa !5
  tail call void @_Z3FWTPiii(ptr noundef nonnull @sz, i32 noundef %146, i32 noundef 0)
  %147 = load i32, ptr @len, align 4, !tbaa !5
  %148 = icmp sgt i32 %147, 0
  br i1 %148, label %.lr.ph68.preheader, label %._crit_edge69

.lr.ph68.preheader:                               ; preds = %._crit_edge65
  %wide.trip.count98 = zext nneg i32 %147 to i64
  %xtraiter160 = and i64 %wide.trip.count98, 1
  %149 = icmp eq i32 %147, 1
  br i1 %149, label %._crit_edge69.loopexit.unr-lcssa, label %.lr.ph68.preheader.new

.lr.ph68.preheader.new:                           ; preds = %.lr.ph68.preheader
  %unroll_iter163 = and i64 %wide.trip.count98, 2147483646
  br label %.lr.ph68

.lr.ph64:                                         ; preds = %.lr.ph64.preheader
  %150 = load i32, ptr @sz, align 16, !tbaa !5
  %151 = sub nsw i32 %.lcssa49, %150
  %152 = icmp sgt i32 %150, %151
  br i1 %152, label %153, label %154

153:                                              ; preds = %.lr.ph64
  store i32 %151, ptr @sz, align 16, !tbaa !5
  br label %154

154:                                              ; preds = %.lr.ph64, %153
  %exitcond94.not = icmp slt i32 %45, 2
  br i1 %exitcond94.not, label %._crit_edge65, label %.lr.ph64.1, !llvm.loop !22

.lr.ph64.1:                                       ; preds = %154
  %155 = load i32, ptr getelementptr inbounds (i8, ptr @sz, i64 4), align 4, !tbaa !5
  %156 = sub nsw i32 %.lcssa49, %155
  %157 = icmp sgt i32 %155, %156
  br i1 %157, label %158, label %159

158:                                              ; preds = %.lr.ph64.1
  store i32 %156, ptr getelementptr inbounds (i8, ptr @sz, i64 4), align 4, !tbaa !5
  br label %159

159:                                              ; preds = %158, %.lr.ph64.1
  %exitcond94.not.1 = icmp eq i32 %.lcssa49, 1
  br i1 %exitcond94.not.1, label %._crit_edge65, label %.lr.ph64.2, !llvm.loop !22

.lr.ph64.2:                                       ; preds = %159
  %160 = load i32, ptr getelementptr inbounds (i8, ptr @sz, i64 8), align 8, !tbaa !5
  %161 = sub nsw i32 %.lcssa49, %160
  %162 = icmp sgt i32 %160, %161
  br i1 %162, label %163, label %.lr.ph64.3

163:                                              ; preds = %.lr.ph64.2
  store i32 %161, ptr getelementptr inbounds (i8, ptr @sz, i64 8), align 8, !tbaa !5
  br label %.lr.ph64.3

.lr.ph64.3:                                       ; preds = %.lr.ph64.2, %163
  %164 = load i32, ptr getelementptr inbounds (i8, ptr @sz, i64 12), align 4, !tbaa !5
  %165 = sub nsw i32 %.lcssa49, %164
  %166 = icmp sgt i32 %164, %165
  br i1 %166, label %167, label %168

167:                                              ; preds = %.lr.ph64.3
  store i32 %165, ptr getelementptr inbounds (i8, ptr @sz, i64 12), align 4, !tbaa !5
  br label %168

168:                                              ; preds = %167, %.lr.ph64.3
  %exitcond94.not.3 = icmp eq i32 %.lcssa49, 2
  br i1 %exitcond94.not.3, label %._crit_edge65, label %.lr.ph64.4, !llvm.loop !22

.lr.ph64.4:                                       ; preds = %168
  %169 = load i32, ptr getelementptr inbounds (i8, ptr @sz, i64 16), align 16, !tbaa !5
  %170 = sub nsw i32 %.lcssa49, %169
  %171 = icmp sgt i32 %169, %170
  br i1 %171, label %172, label %.lr.ph64.5

172:                                              ; preds = %.lr.ph64.4
  store i32 %170, ptr getelementptr inbounds (i8, ptr @sz, i64 16), align 16, !tbaa !5
  br label %.lr.ph64.5

.lr.ph64.5:                                       ; preds = %.lr.ph64.4, %172
  %173 = load i32, ptr getelementptr inbounds (i8, ptr @sz, i64 20), align 4, !tbaa !5
  %174 = sub nsw i32 %.lcssa49, %173
  %175 = icmp sgt i32 %173, %174
  br i1 %175, label %176, label %.lr.ph64.6

176:                                              ; preds = %.lr.ph64.5
  store i32 %174, ptr getelementptr inbounds (i8, ptr @sz, i64 20), align 4, !tbaa !5
  br label %.lr.ph64.6

.lr.ph64.6:                                       ; preds = %.lr.ph64.5, %176
  %177 = load i32, ptr getelementptr inbounds (i8, ptr @sz, i64 24), align 8, !tbaa !5
  %178 = sub nsw i32 %.lcssa49, %177
  %179 = icmp sgt i32 %177, %178
  br i1 %179, label %180, label %._crit_edge65

180:                                              ; preds = %.lr.ph64.6
  store i32 %178, ptr getelementptr inbounds (i8, ptr @sz, i64 24), align 8, !tbaa !5
  br label %._crit_edge65

._crit_edge69.loopexit.unr-lcssa:                 ; preds = %.lr.ph68, %.lr.ph68.preheader
  %indvars.iv95.unr = phi i64 [ 0, %.lr.ph68.preheader ], [ %indvars.iv.next96.1, %.lr.ph68 ]
  %lcmp.mod162.not = icmp eq i64 %xtraiter160, 0
  br i1 %lcmp.mod162.not, label %._crit_edge69, label %.lr.ph68.epil

.lr.ph68.epil:                                    ; preds = %._crit_edge69.loopexit.unr-lcssa
  %181 = getelementptr inbounds [1048576 x i32], ptr @x, i64 0, i64 %indvars.iv95.unr
  %182 = load i32, ptr %181, align 4, !tbaa !5
  %183 = sext i32 %182 to i64
  %184 = getelementptr inbounds [1048576 x i32], ptr @sz, i64 0, i64 %indvars.iv95.unr
  %185 = load i32, ptr %184, align 4, !tbaa !5
  %186 = sext i32 %185 to i64
  %187 = mul nsw i64 %186, %183
  %188 = srem i64 %187, 1000000007
  %189 = trunc nsw i64 %188 to i32
  store i32 %189, ptr %181, align 4, !tbaa !5
  br label %._crit_edge69

._crit_edge69:                                    ; preds = %.lr.ph68.epil, %._crit_edge69.loopexit.unr-lcssa, %._crit_edge65
  tail call void @_Z3FWTPiii(ptr noundef nonnull @x, i32 noundef %147, i32 noundef 1)
  %190 = load i32, ptr @n, align 4, !tbaa !5
  %191 = load i32, ptr @m, align 4, !tbaa !5
  %192 = mul nsw i32 %191, %190
  %193 = load i32, ptr @len, align 4, !tbaa !5
  %194 = icmp sgt i32 %193, 0
  br i1 %194, label %.lr.ph74.preheader, label %._crit_edge75

.lr.ph74.preheader:                               ; preds = %._crit_edge69
  %wide.trip.count103 = zext nneg i32 %193 to i64
  %min.iters.check126 = icmp ult i32 %193, 8
  br i1 %min.iters.check126, label %.lr.ph74.preheader138, label %vector.ph127

.lr.ph74.preheader138:                            ; preds = %middle.block124, %.lr.ph74.preheader
  %indvars.iv100.ph = phi i64 [ 0, %.lr.ph74.preheader ], [ %n.vec129, %middle.block124 ]
  %.03571.ph = phi i32 [ %192, %.lr.ph74.preheader ], [ %200, %middle.block124 ]
  br label %.lr.ph74

vector.ph127:                                     ; preds = %.lr.ph74.preheader
  %n.vec129 = and i64 %wide.trip.count103, 2147483640
  %minmax.ident.splatinsert = insertelement <4 x i32> poison, i32 %192, i64 0
  %minmax.ident.splat = shufflevector <4 x i32> %minmax.ident.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
  br label %vector.body131

vector.body131:                                   ; preds = %vector.body131, %vector.ph127
  %index132 = phi i64 [ 0, %vector.ph127 ], [ %index.next136, %vector.body131 ]
  %vec.phi = phi <4 x i32> [ %minmax.ident.splat, %vector.ph127 ], [ %197, %vector.body131 ]
  %vec.phi133 = phi <4 x i32> [ %minmax.ident.splat, %vector.ph127 ], [ %198, %vector.body131 ]
  %195 = getelementptr inbounds [1048576 x i32], ptr @x, i64 0, i64 %index132
  %196 = getelementptr inbounds i8, ptr %195, i64 16
  %wide.load134 = load <4 x i32>, ptr %195, align 16, !tbaa !5
  %wide.load135 = load <4 x i32>, ptr %196, align 16, !tbaa !5
  %197 = tail call <4 x i32> @llvm.smin.v4i32(<4 x i32> %vec.phi, <4 x i32> %wide.load134)
  %198 = tail call <4 x i32> @llvm.smin.v4i32(<4 x i32> %vec.phi133, <4 x i32> %wide.load135)
  %index.next136 = add nuw i64 %index132, 8
  %199 = icmp eq i64 %index.next136, %n.vec129
  br i1 %199, label %middle.block124, label %vector.body131, !llvm.loop !23

middle.block124:                                  ; preds = %vector.body131
  %rdx.minmax = tail call <4 x i32> @llvm.smin.v4i32(<4 x i32> %197, <4 x i32> %198)
  %200 = tail call i32 @llvm.vector.reduce.smin.v4i32(<4 x i32> %rdx.minmax)
  %cmp.n137 = icmp eq i64 %n.vec129, %wide.trip.count103
  br i1 %cmp.n137, label %._crit_edge75, label %.lr.ph74.preheader138

.lr.ph68:                                         ; preds = %.lr.ph68, %.lr.ph68.preheader.new
  %indvars.iv95 = phi i64 [ 0, %.lr.ph68.preheader.new ], [ %indvars.iv.next96.1, %.lr.ph68 ]
  %niter164 = phi i64 [ 0, %.lr.ph68.preheader.new ], [ %niter164.next.1, %.lr.ph68 ]
  %201 = getelementptr inbounds [1048576 x i32], ptr @x, i64 0, i64 %indvars.iv95
  %202 = load i32, ptr %201, align 8, !tbaa !5
  %203 = sext i32 %202 to i64
  %204 = getelementptr inbounds [1048576 x i32], ptr @sz, i64 0, i64 %indvars.iv95
  %205 = load i32, ptr %204, align 8, !tbaa !5
  %206 = sext i32 %205 to i64
  %207 = mul nsw i64 %206, %203
  %208 = srem i64 %207, 1000000007
  %209 = trunc nsw i64 %208 to i32
  store i32 %209, ptr %201, align 8, !tbaa !5
  %indvars.iv.next96 = or disjoint i64 %indvars.iv95, 1
  %210 = getelementptr inbounds [1048576 x i32], ptr @x, i64 0, i64 %indvars.iv.next96
  %211 = load i32, ptr %210, align 4, !tbaa !5
  %212 = sext i32 %211 to i64
  %213 = getelementptr inbounds [1048576 x i32], ptr @sz, i64 0, i64 %indvars.iv.next96
  %214 = load i32, ptr %213, align 4, !tbaa !5
  %215 = sext i32 %214 to i64
  %216 = mul nsw i64 %215, %212
  %217 = srem i64 %216, 1000000007
  %218 = trunc nsw i64 %217 to i32
  store i32 %218, ptr %210, align 4, !tbaa !5
  %indvars.iv.next96.1 = add nuw nsw i64 %indvars.iv95, 2
  %niter164.next.1 = add i64 %niter164, 2
  %niter164.ncmp.1 = icmp eq i64 %niter164.next.1, %unroll_iter163
  br i1 %niter164.ncmp.1, label %._crit_edge69.loopexit.unr-lcssa, label %.lr.ph68, !llvm.loop !24

._crit_edge75:                                    ; preds = %.lr.ph74, %middle.block124, %._crit_edge69
  %.035.lcssa = phi i32 [ %192, %._crit_edge69 ], [ %200, %middle.block124 ], [ %spec.select, %.lr.ph74 ]
  %219 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %.035.lcssa)
  ret i32 0

.lr.ph74:                                         ; preds = %.lr.ph74.preheader138, %.lr.ph74
  %indvars.iv100 = phi i64 [ %indvars.iv.next101, %.lr.ph74 ], [ %indvars.iv100.ph, %.lr.ph74.preheader138 ]
  %.03571 = phi i32 [ %spec.select, %.lr.ph74 ], [ %.03571.ph, %.lr.ph74.preheader138 ]
  %220 = getelementptr inbounds [1048576 x i32], ptr @x, i64 0, i64 %indvars.iv100
  %221 = load i32, ptr %220, align 4, !tbaa !5
  %spec.select = tail call i32 @llvm.smin.i32(i32 %.03571, i32 %221)
  %indvars.iv.next101 = add nuw nsw i64 %indvars.iv100, 1
  %exitcond104.not = icmp eq i64 %indvars.iv.next101, %wide.trip.count103
  br i1 %exitcond104.not, label %._crit_edge75, label %.lr.ph74, !llvm.loop !25
}

; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_Z3FWTPiii(ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <4 x i32> @llvm.smin.v4i32(<4 x i32>, <4 x i32>) #3

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.smin.v4i32(<4 x i32>) #3

attributes #0 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { inlinehint 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 speculatable willreturn memory(none) }

!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 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.unroll.disable"}
!15 = distinct !{!15, !11}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !11}
!18 = distinct !{!18, !11, !19, !20}
!19 = !{!"llvm.loop.isvectorized", i32 1}
!20 = !{!"llvm.loop.unroll.runtime.disable"}
!21 = distinct !{!21, !11}
!22 = distinct !{!22, !11, !20, !19}
!23 = distinct !{!23, !11, !19, !20}
!24 = distinct !{!24, !11}
!25 = distinct !{!25, !11, !20, !19}


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