; LLVM IR from tangjz/acm-icpc :: lydsy (4145)

; 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
@f = external dso_local global [2 x [65536 x i32]], 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 nounwind uwtable
declare dso_local void @_Z3updRii(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef) #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #1 {
  %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
  store i32 0, ptr %1, align 4
  %11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @m)
  call void @llvm.memset.p0.i64(ptr align 16 @f, i8 63, i64 262144, i1 false)
  store i32 0, ptr @f, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %12

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

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

17:                                               ; preds = %12
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  %18 = load i32, ptr %2, align 4, !tbaa !5
  %19 = and i32 %18, 1
  store i32 %19, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  %20 = load i32, ptr %4, align 4, !tbaa !5
  %21 = xor i32 %20, 1
  store i32 %21, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  %22 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %6)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %23

23:                                               ; preds = %45, %17
  %24 = load i32, ptr %7, align 4, !tbaa !5
  %25 = load i32, ptr @m, align 4, !tbaa !5
  %26 = shl i32 1, %25
  %27 = icmp slt i32 %24, %26
  br i1 %27, label %29, label %28

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

29:                                               ; preds = %23
  %30 = load i32, ptr %5, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [2 x [65536 x i32]], ptr @f, i64 0, i64 %31
  %33 = load i32, ptr %7, align 4, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [65536 x i32], ptr %32, i64 0, i64 %34
  %36 = load i32, ptr %35, align 4, !tbaa !5
  %37 = load i32, ptr %6, align 4, !tbaa !5
  %38 = add nsw i32 %36, %37
  %39 = load i32, ptr %4, align 4, !tbaa !5
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [2 x [65536 x i32]], ptr @f, i64 0, i64 %40
  %42 = load i32, ptr %7, align 4, !tbaa !5
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds [65536 x i32], ptr %41, i64 0, i64 %43
  store i32 %38, ptr %44, align 4, !tbaa !5
  br label %45

45:                                               ; preds = %29
  %46 = load i32, ptr %7, align 4, !tbaa !5
  %47 = add nsw i32 %46, 1
  store i32 %47, ptr %7, align 4, !tbaa !5
  br label %23, !llvm.loop !9

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

49:                                               ; preds = %92, %48
  %50 = load i32, ptr %8, 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 %8) #5
  br label %95

54:                                               ; preds = %49
  %55 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %6)
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %56

56:                                               ; preds = %88, %54
  %57 = load i32, ptr %9, align 4, !tbaa !5
  %58 = load i32, ptr @m, align 4, !tbaa !5
  %59 = shl i32 1, %58
  %60 = icmp slt i32 %57, %59
  br i1 %60, label %62, label %61

61:                                               ; preds = %56
  store i32 11, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %91

62:                                               ; preds = %56
  %63 = load i32, ptr %9, align 4, !tbaa !5
  %64 = load i32, ptr %8, align 4, !tbaa !5
  %65 = ashr i32 %63, %64
  %66 = and i32 %65, 1
  %67 = icmp ne i32 %66, 0
  br i1 %67, label %68, label %87

68:                                               ; preds = %62
  %69 = load i32, ptr %4, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [2 x [65536 x i32]], ptr @f, i64 0, i64 %70
  %72 = load i32, ptr %9, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [65536 x i32], ptr %71, i64 0, i64 %73
  %75 = load i32, ptr %4, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [2 x [65536 x i32]], ptr @f, i64 0, i64 %76
  %78 = load i32, ptr %9, align 4, !tbaa !5
  %79 = load i32, ptr %8, align 4, !tbaa !5
  %80 = shl i32 1, %79
  %81 = xor i32 %78, %80
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [65536 x i32], ptr %77, i64 0, i64 %82
  %84 = load i32, ptr %83, align 4, !tbaa !5
  %85 = load i32, ptr %6, align 4, !tbaa !5
  %86 = add nsw i32 %84, %85
  call void @_Z3updRii(ptr noundef nonnull align 4 dereferenceable(4) %74, i32 noundef %86)
  br label %87

87:                                               ; preds = %68, %62
  br label %88

88:                                               ; preds = %87
  %89 = load i32, ptr %9, align 4, !tbaa !5
  %90 = add nsw i32 %89, 1
  store i32 %90, ptr %9, align 4, !tbaa !5
  br label %56, !llvm.loop !11

91:                                               ; preds = %61
  br label %92

92:                                               ; preds = %91
  %93 = load i32, ptr %8, align 4, !tbaa !5
  %94 = add nsw i32 %93, 1
  store i32 %94, ptr %8, align 4, !tbaa !5
  br label %49, !llvm.loop !12

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

96:                                               ; preds = %116, %95
  %97 = load i32, ptr %10, align 4, !tbaa !5
  %98 = load i32, ptr @m, align 4, !tbaa !5
  %99 = shl i32 1, %98
  %100 = icmp slt i32 %97, %99
  br i1 %100, label %102, label %101

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

102:                                              ; preds = %96
  %103 = load i32, ptr %4, align 4, !tbaa !5
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [2 x [65536 x i32]], ptr @f, i64 0, i64 %104
  %106 = load i32, ptr %10, align 4, !tbaa !5
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [65536 x i32], ptr %105, i64 0, i64 %107
  %109 = load i32, ptr %5, align 4, !tbaa !5
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [2 x [65536 x i32]], ptr @f, i64 0, i64 %110
  %112 = load i32, ptr %10, align 4, !tbaa !5
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds [65536 x i32], ptr %111, i64 0, i64 %113
  %115 = load i32, ptr %114, align 4, !tbaa !5
  call void @_Z3updRii(ptr noundef nonnull align 4 dereferenceable(4) %108, i32 noundef %115)
  br label %116

116:                                              ; preds = %102
  %117 = load i32, ptr %10, align 4, !tbaa !5
  %118 = add nsw i32 %117, 1
  store i32 %118, ptr %10, align 4, !tbaa !5
  br label %96, !llvm.loop !13

119:                                              ; preds = %101
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  br label %120

120:                                              ; preds = %119
  %121 = load i32, ptr %2, align 4, !tbaa !5
  %122 = add nsw i32 %121, 1
  store i32 %122, ptr %2, align 4, !tbaa !5
  br label %12, !llvm.loop !14

123:                                              ; preds = %16
  %124 = load i32, ptr @n, align 4, !tbaa !5
  %125 = and i32 %124, 1
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds [2 x [65536 x i32]], ptr @f, i64 0, i64 %126
  %128 = load i32, ptr @m, align 4, !tbaa !5
  %129 = shl i32 1, %128
  %130 = sub nsw i32 %129, 1
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds [65536 x i32], ptr %127, i64 0, i64 %131
  %133 = load i32, ptr %132, align 4, !tbaa !5
  %134 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %133)
  ret i32 0
}

declare i32 @__isoc99_scanf(ptr noundef, ...) #2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

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

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

declare i32 @printf(ptr noundef, ...) #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 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 #2 = { "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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}


; 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
@f = external dso_local global [2 x [65536 x i32]], 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 nounwind uwtable
declare dso_local void @_Z3updRii(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress norecurse nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 {
  %1 = alloca i32, align 4
  %2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @m)
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(262144) @f, i8 63, i64 262144, i1 false)
  store i32 0, ptr @f, align 16, !tbaa !5
  %3 = load i32, ptr @n, align 4, !tbaa !5
  %.not42 = icmp slt i32 %3, 1
  br i1 %.not42, label %.._crit_edge46_crit_edge, label %.lr.ph45

.._crit_edge46_crit_edge:                         ; preds = %0
  %.pre58 = load i32, ptr @m, align 4, !tbaa !5
  br label %._crit_edge46

._crit_edge46:                                    ; preds = %._crit_edge41, %.._crit_edge46_crit_edge
  %4 = phi i32 [ %.pre58, %.._crit_edge46_crit_edge ], [ %68, %._crit_edge41 ]
  %.lcssa = phi i32 [ %3, %.._crit_edge46_crit_edge ], [ %70, %._crit_edge41 ]
  %5 = and i32 %.lcssa, 1
  %6 = zext nneg i32 %5 to i64
  %notmask = shl nsw i32 -1, %4
  %7 = xor i32 %notmask, -1
  %8 = zext nneg i32 %7 to i64
  %9 = getelementptr inbounds [2 x [65536 x i32]], ptr @f, i64 0, i64 %6, i64 %8
  %10 = load i32, ptr %9, align 4, !tbaa !5
  %11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %10)
  ret i32 0

.lr.ph45:                                         ; preds = %0, %._crit_edge41
  %.03043 = phi i32 [ %69, %._crit_edge41 ], [ 1, %0 ]
  %12 = and i32 %.03043, 1
  %13 = xor i32 %12, 1
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  %14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %1)
  %15 = load i32, ptr @m, align 4, !tbaa !5
  %.not47 = icmp eq i32 %15, 31
  br i1 %.not47, label %.lr.ph38, label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph45
  %16 = shl nuw nsw i32 1, %15
  %17 = zext nneg i32 %13 to i64
  %18 = load i32, ptr %1, align 4, !tbaa !5
  %19 = zext nneg i32 %12 to i64
  %wide.trip.count = zext nneg i32 %16 to i64
  %min.iters.check = icmp ult i32 %15, 3
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

scalar.ph.preheader:                              ; preds = %.lr.ph
  %xtraiter = and i64 %wide.trip.count, 1
  %20 = icmp eq i32 %15, 0
  br i1 %20, label %.preheader33.loopexit.unr-lcssa, label %scalar.ph

vector.ph:                                        ; preds = %.lr.ph
  %n.vec = and i64 %wide.trip.count, 2147483640
  %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %18, 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 = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %21 = getelementptr inbounds [2 x [65536 x i32]], ptr @f, i64 0, i64 %17, i64 %index
  %22 = getelementptr inbounds i8, ptr %21, i64 16
  %wide.load = load <4 x i32>, ptr %21, align 16, !tbaa !5
  %wide.load70 = load <4 x i32>, ptr %22, align 16, !tbaa !5
  %23 = add nsw <4 x i32> %broadcast.splat, %wide.load
  %24 = add nsw <4 x i32> %broadcast.splat, %wide.load70
  %25 = getelementptr inbounds [2 x [65536 x i32]], ptr @f, i64 0, i64 %19, i64 %index
  %26 = getelementptr inbounds i8, ptr %25, i64 16
  store <4 x i32> %23, ptr %25, align 16, !tbaa !5
  store <4 x i32> %24, ptr %26, align 16, !tbaa !5
  %index.next = add nuw i64 %index, 8
  %27 = icmp eq i64 %index.next, %n.vec
  br i1 %27, label %.preheader33, label %vector.body, !llvm.loop !9

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

scalar.ph.epil:                                   ; preds = %.preheader33.loopexit.unr-lcssa
  %28 = getelementptr inbounds [2 x [65536 x i32]], ptr @f, i64 0, i64 %17, i64 %indvars.iv.unr
  %29 = load i32, ptr %28, align 4, !tbaa !5
  %30 = add nsw i32 %18, %29
  %31 = getelementptr inbounds [2 x [65536 x i32]], ptr @f, i64 0, i64 %19, i64 %indvars.iv.unr
  store i32 %30, ptr %31, align 4, !tbaa !5
  br label %.preheader33

.preheader33:                                     ; preds = %vector.body, %scalar.ph.epil, %.preheader33.loopexit.unr-lcssa
  %32 = icmp sgt i32 %15, 0
  br i1 %32, label %.lr.ph38, label %.lr.ph40

.lr.ph38:                                         ; preds = %.lr.ph45, %.preheader33
  %33 = zext nneg i32 %12 to i64
  br label %44

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv = phi i64 [ %indvars.iv.next.1, %scalar.ph ], [ 0, %scalar.ph.preheader ]
  %niter = phi i64 [ %niter.next.1, %scalar.ph ], [ 0, %scalar.ph.preheader ]
  %34 = getelementptr inbounds [2 x [65536 x i32]], ptr @f, i64 0, i64 %17, i64 %indvars.iv
  %35 = load i32, ptr %34, align 8, !tbaa !5
  %36 = add nsw i32 %18, %35
  %37 = getelementptr inbounds [2 x [65536 x i32]], ptr @f, i64 0, i64 %19, i64 %indvars.iv
  store i32 %36, ptr %37, align 8, !tbaa !5
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %38 = getelementptr inbounds [2 x [65536 x i32]], ptr @f, i64 0, i64 %17, i64 %indvars.iv.next
  %39 = load i32, ptr %38, align 4, !tbaa !5
  %40 = add nsw i32 %18, %39
  %41 = getelementptr inbounds [2 x [65536 x i32]], ptr @f, i64 0, i64 %19, i64 %indvars.iv.next
  store i32 %40, ptr %41, align 4, !tbaa !5
  %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, %wide.trip.count
  br i1 %niter.ncmp.1, label %.preheader33.loopexit.unr-lcssa, label %scalar.ph, !llvm.loop !13

.preheader:                                       ; preds = %._crit_edge
  %.not49 = icmp eq i32 %48, 31
  br i1 %.not49, label %._crit_edge41, label %.lr.ph40

.lr.ph40:                                         ; preds = %.preheader33, %.preheader
  %42 = zext nneg i32 %12 to i64
  %43 = zext nneg i32 %13 to i64
  br label %71

44:                                               ; preds = %.lr.ph38, %._crit_edge
  %.02837 = phi i32 [ 0, %.lr.ph38 ], [ %49, %._crit_edge ]
  %45 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %1)
  %46 = load i32, ptr @m, align 4, !tbaa !5
  %.not48 = icmp eq i32 %46, 31
  br i1 %.not48, label %._crit_edge, label %.lr.ph36

.lr.ph36:                                         ; preds = %44
  %47 = shl nuw i32 1, %.02837
  br label %51

._crit_edge:                                      ; preds = %63, %44
  %48 = phi i32 [ 31, %44 ], [ %64, %63 ]
  %49 = add nuw nsw i32 %.02837, 1
  %50 = icmp slt i32 %49, %48
  br i1 %50, label %44, label %.preheader, !llvm.loop !14

51:                                               ; preds = %.lr.ph36, %63
  %52 = phi i32 [ %46, %.lr.ph36 ], [ %64, %63 ]
  %indvars.iv52 = phi i64 [ 0, %.lr.ph36 ], [ %indvars.iv.next53, %63 ]
  %53 = trunc nuw nsw i64 %indvars.iv52 to i32
  %54 = and i32 %47, %53
  %.not32 = icmp eq i32 %54, 0
  br i1 %.not32, label %63, label %55

55:                                               ; preds = %51
  %56 = getelementptr inbounds [2 x [65536 x i32]], ptr @f, i64 0, i64 %33, i64 %indvars.iv52
  %57 = xor i32 %47, %53
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [2 x [65536 x i32]], ptr @f, i64 0, i64 %33, i64 %58
  %60 = load i32, ptr %59, align 4, !tbaa !5
  %61 = load i32, ptr %1, align 4, !tbaa !5
  %62 = add nsw i32 %61, %60
  call void @_Z3updRii(ptr noundef nonnull align 4 dereferenceable(4) %56, i32 noundef %62)
  %.pre = load i32, ptr @m, align 4, !tbaa !5
  br label %63

63:                                               ; preds = %51, %55
  %64 = phi i32 [ %52, %51 ], [ %.pre, %55 ]
  %indvars.iv.next53 = add nuw nsw i64 %indvars.iv52, 1
  %65 = shl nuw i32 1, %64
  %66 = sext i32 %65 to i64
  %67 = icmp slt i64 %indvars.iv.next53, %66
  br i1 %67, label %51, label %._crit_edge, !llvm.loop !15

._crit_edge41:                                    ; preds = %71, %.preheader
  %68 = phi i32 [ 31, %.preheader ], [ %75, %71 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  %69 = add nuw nsw i32 %.03043, 1
  %70 = load i32, ptr @n, align 4, !tbaa !5
  %.not.not = icmp slt i32 %.03043, %70
  br i1 %.not.not, label %.lr.ph45, label %._crit_edge46, !llvm.loop !16

71:                                               ; preds = %.lr.ph40, %71
  %indvars.iv55 = phi i64 [ 0, %.lr.ph40 ], [ %indvars.iv.next56, %71 ]
  %72 = getelementptr inbounds [2 x [65536 x i32]], ptr @f, i64 0, i64 %42, i64 %indvars.iv55
  %73 = getelementptr inbounds [2 x [65536 x i32]], ptr @f, i64 0, i64 %43, i64 %indvars.iv55
  %74 = load i32, ptr %73, align 4, !tbaa !5
  call void @_Z3updRii(ptr noundef nonnull align 4 dereferenceable(4) %72, i32 noundef %74)
  %indvars.iv.next56 = add nuw nsw i64 %indvars.iv55, 1
  %75 = load i32, ptr @m, align 4, !tbaa !5
  %76 = shl nuw i32 1, %75
  %77 = sext i32 %76 to i64
  %78 = icmp slt i64 %indvars.iv.next56, %77
  br i1 %78, label %71, label %._crit_edge41, !llvm.loop !17
}

; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) 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

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

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

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) 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 norecurse 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 #2 = { 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 #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10, !11}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}


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