; LLVM IR from tangjz/acm-icpc :: spoj (TLE)

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

@t = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@x = external dso_local global i32, align 4
@f = external dso_local global [32768 x i32], align 16
@ans = external dso_local global i32, align 4
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 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 @_Z3incRii(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z4swapRiS_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #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 norecurse uwtable
define dso_local noundef i32 @main() #2 {
  %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
  store i32 0, ptr %1, align 4
  %8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @t)
  br label %9

9:                                                ; preds = %131, %0
  %10 = load i32, ptr @t, align 4, !tbaa !5
  %11 = add nsw i32 %10, -1
  store i32 %11, ptr @t, align 4, !tbaa !5
  %12 = icmp ne i32 %10, 0
  br i1 %12, label %13, label %134

13:                                               ; preds = %9
  %14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef @n, ptr noundef @m)
  %15 = load i32, ptr @m, align 4, !tbaa !5
  %16 = shl i32 1, %15
  %17 = sext i32 %16 to i64
  %18 = mul i64 %17, 4
  call void @llvm.memset.p0.i64(ptr align 16 @f, i8 0, i64 %18, i1 false)
  store i32 1, ptr @f, align 16, !tbaa !5
  br label %19

19:                                               ; preds = %115, %13
  %20 = load i32, ptr @n, align 4, !tbaa !5
  %21 = add nsw i32 %20, -1
  store i32 %21, ptr @n, align 4, !tbaa !5
  %22 = icmp ne i32 %20, 0
  br i1 %22, label %23, label %116

23:                                               ; preds = %19
  %24 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @x)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %25

25:                                               ; preds = %75, %23
  %26 = load i32, ptr %2, align 4, !tbaa !5
  %27 = load i32, ptr @m, align 4, !tbaa !5
  %28 = icmp slt i32 %26, %27
  br i1 %28, label %30, label %29

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

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

31:                                               ; preds = %71, %30
  %32 = load i32, ptr %4, align 4, !tbaa !5
  %33 = load i32, ptr @m, align 4, !tbaa !5
  %34 = sub nsw i32 %33, 1
  %35 = shl i32 1, %34
  %36 = icmp slt i32 %32, %35
  br i1 %36, label %38, label %37

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

38:                                               ; preds = %31
  %39 = load i32, ptr %4, align 4, !tbaa !5
  %40 = load i32, ptr %2, align 4, !tbaa !5
  %41 = ashr i32 %39, %40
  %42 = load i32, ptr %2, align 4, !tbaa !5
  %43 = add nsw i32 %42, 1
  %44 = shl i32 %41, %43
  %45 = load i32, ptr %2, align 4, !tbaa !5
  %46 = shl i32 1, %45
  %47 = or i32 %44, %46
  %48 = load i32, ptr %4, align 4, !tbaa !5
  %49 = load i32, ptr %2, align 4, !tbaa !5
  %50 = shl i32 1, %49
  %51 = sub nsw i32 %50, 1
  %52 = and i32 %48, %51
  %53 = or i32 %47, %52
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [32768 x i32], ptr @f, i64 0, i64 %54
  %56 = load i32, ptr %4, align 4, !tbaa !5
  %57 = load i32, ptr %2, align 4, !tbaa !5
  %58 = ashr i32 %56, %57
  %59 = load i32, ptr %2, align 4, !tbaa !5
  %60 = add nsw i32 %59, 1
  %61 = shl i32 %58, %60
  %62 = load i32, ptr %4, align 4, !tbaa !5
  %63 = load i32, ptr %2, align 4, !tbaa !5
  %64 = shl i32 1, %63
  %65 = sub nsw i32 %64, 1
  %66 = and i32 %62, %65
  %67 = or i32 %61, %66
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [32768 x i32], ptr @f, i64 0, i64 %68
  %70 = load i32, ptr %69, align 4, !tbaa !5
  call void @_Z3incRii(ptr noundef nonnull align 4 dereferenceable(4) %55, i32 noundef %70)
  br label %71

71:                                               ; preds = %38
  %72 = load i32, ptr %4, align 4, !tbaa !5
  %73 = add nsw i32 %72, 1
  store i32 %73, ptr %4, align 4, !tbaa !5
  br label %31, !llvm.loop !9

74:                                               ; preds = %37
  br label %75

75:                                               ; preds = %74
  %76 = load i32, ptr %2, align 4, !tbaa !5
  %77 = add nsw i32 %76, 1
  store i32 %77, ptr %2, align 4, !tbaa !5
  br label %25, !llvm.loop !11

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

79:                                               ; preds = %97, %78
  %80 = load i32, ptr %5, align 4, !tbaa !5
  %81 = load i32, ptr @m, align 4, !tbaa !5
  %82 = sub nsw i32 %81, 1
  %83 = shl i32 1, %82
  %84 = icmp slt i32 %80, %83
  br i1 %84, label %86, label %85

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

86:                                               ; preds = %79
  %87 = load i32, ptr %5, align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [32768 x i32], ptr @f, i64 0, i64 %88
  %90 = load i32, ptr @m, align 4, !tbaa !5
  %91 = shl i32 1, %90
  %92 = sub nsw i32 %91, 1
  %93 = load i32, ptr %5, align 4, !tbaa !5
  %94 = sub nsw i32 %92, %93
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [32768 x i32], ptr @f, i64 0, i64 %95
  call void @_Z4swapRiS_(ptr noundef nonnull align 4 dereferenceable(4) %89, ptr noundef nonnull align 4 dereferenceable(4) %96)
  br label %97

97:                                               ; preds = %86
  %98 = load i32, ptr %5, align 4, !tbaa !5
  %99 = add nsw i32 %98, 1
  store i32 %99, ptr %5, align 4, !tbaa !5
  br label %79, !llvm.loop !12

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

101:                                              ; preds = %111, %100
  %102 = load i32, ptr %6, align 4, !tbaa !5
  %103 = load i32, ptr @m, align 4, !tbaa !5
  %104 = shl i32 1, %103
  %105 = icmp slt i32 %102, %104
  br i1 %105, label %107, label %106

106:                                              ; preds = %101
  store i32 15, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %115

107:                                              ; preds = %101
  %108 = load i32, ptr %6, align 4, !tbaa !5
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds [32768 x i32], ptr @f, i64 0, i64 %109
  store i32 0, ptr %110, align 4, !tbaa !5
  br label %111

111:                                              ; preds = %107
  %112 = load i32, ptr @x, align 4, !tbaa !5
  %113 = load i32, ptr %6, align 4, !tbaa !5
  %114 = add nsw i32 %113, %112
  store i32 %114, ptr %6, align 4, !tbaa !5
  br label %101, !llvm.loop !13

115:                                              ; preds = %106
  br label %19, !llvm.loop !14

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

117:                                              ; preds = %128, %116
  %118 = load i32, ptr %7, align 4, !tbaa !5
  %119 = load i32, ptr @m, align 4, !tbaa !5
  %120 = shl i32 1, %119
  %121 = icmp slt i32 %118, %120
  br i1 %121, label %123, label %122

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

123:                                              ; preds = %117
  %124 = load i32, ptr %7, align 4, !tbaa !5
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [32768 x i32], ptr @f, i64 0, i64 %125
  %127 = load i32, ptr %126, align 4, !tbaa !5
  call void @_Z3incRii(ptr noundef nonnull align 4 dereferenceable(4) @ans, i32 noundef %127)
  br label %128

128:                                              ; preds = %123
  %129 = load i32, ptr %7, align 4, !tbaa !5
  %130 = add nsw i32 %129, 1
  store i32 %130, ptr %7, align 4, !tbaa !5
  br label %117, !llvm.loop !15

131:                                              ; preds = %122
  %132 = load i32, ptr @ans, align 4, !tbaa !5
  %133 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %132)
  br label %9, !llvm.loop !16

134:                                              ; preds = %9
  ret i32 0
}

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

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

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

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

@t = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@x = external dso_local global i32, align 4
@f = external dso_local global [32768 x i32], align 16
@ans = external dso_local global i32, align 4
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 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 @_Z3incRii(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z4swapRiS_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #0

; Function Attrs: mustprogress norecurse nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 {
  %1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @t)
  %2 = load i32, ptr @t, align 4, !tbaa !5
  %3 = add nsw i32 %2, -1
  store i32 %3, ptr @t, align 4, !tbaa !5
  %.not46 = icmp eq i32 %2, 0
  br i1 %.not46, label %._crit_edge49, label %.lr.ph48

.lr.ph48:                                         ; preds = %0, %._crit_edge45
  %4 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @n, ptr noundef nonnull @m)
  %5 = load i32, ptr @m, align 4, !tbaa !5
  %6 = shl nuw i32 1, %5
  %7 = sext i32 %6 to i64
  %8 = shl nsw i64 %7, 2
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1) @f, i8 0, i64 %8, i1 false)
  store i32 1, ptr @f, align 16, !tbaa !5
  %9 = load i32, ptr @n, align 4, !tbaa !5
  %10 = add nsw i32 %9, -1
  store i32 %10, ptr @n, align 4, !tbaa !5
  %.not2938 = icmp eq i32 %9, 0
  br i1 %.not2938, label %._crit_edge41, label %.lr.ph40

.loopexit:                                        ; preds = %scalar.ph, %middle.block, %.preheader30
  %11 = phi i32 [ 31, %.preheader30 ], [ %38, %middle.block ], [ %38, %scalar.ph ]
  %12 = load i32, ptr @n, align 4, !tbaa !5
  %13 = add nsw i32 %12, -1
  store i32 %13, ptr @n, align 4, !tbaa !5
  %.not29 = icmp eq i32 %12, 0
  br i1 %.not29, label %._crit_edge41, label %.lr.ph40, !llvm.loop !9

.lr.ph40:                                         ; preds = %.lr.ph48, %.loopexit
  %14 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @x)
  %15 = load i32, ptr @m, align 4, !tbaa !5
  %16 = icmp sgt i32 %15, 0
  br i1 %16, label %.preheader, label %.lr.ph35.preheader

.preheader31:                                     ; preds = %._crit_edge
  %.not51 = icmp eq i32 %20, 32
  br i1 %.not51, label %.lr.ph37, label %.lr.ph35.preheader

.lr.ph35.preheader:                               ; preds = %.lr.ph40, %.preheader31
  %.ph = phi i32 [ %20, %.preheader31 ], [ %15, %.lr.ph40 ]
  br label %.lr.ph35

.preheader:                                       ; preds = %.lr.ph40, %._crit_edge
  %17 = phi i32 [ %20, %._crit_edge ], [ %15, %.lr.ph40 ]
  %.02833 = phi i32 [ %.pre62, %._crit_edge ], [ 0, %.lr.ph40 ]
  %.not50 = icmp eq i32 %17, 32
  %.pre62 = add nuw nsw i32 %.02833, 1
  br i1 %.not50, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader
  %18 = shl nuw i32 1, %.02833
  %19 = add nsw i32 %18, -1
  br label %22

._crit_edge:                                      ; preds = %22, %.preheader
  %20 = phi i32 [ 32, %.preheader ], [ %34, %22 ]
  %21 = icmp slt i32 %.pre62, %20
  br i1 %21, label %.preheader, label %.preheader31, !llvm.loop !11

22:                                               ; preds = %.lr.ph, %22
  %.02732 = phi i32 [ 0, %.lr.ph ], [ %33, %22 ]
  %23 = lshr i32 %.02732, %.02833
  %24 = shl i32 %23, %.pre62
  %25 = and i32 %.02732, %19
  %26 = or i32 %24, %25
  %27 = or i32 %26, %18
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds [32768 x i32], ptr @f, i64 0, i64 %28
  %30 = sext i32 %26 to i64
  %31 = getelementptr inbounds [32768 x i32], ptr @f, i64 0, i64 %30
  %32 = load i32, ptr %31, align 4, !tbaa !5
  tail call void @_Z3incRii(ptr noundef nonnull align 4 dereferenceable(4) %29, i32 noundef %32)
  %33 = add nuw nsw i32 %.02732, 1
  %34 = load i32, ptr @m, align 4, !tbaa !5
  %35 = add nsw i32 %34, -1
  %36 = shl nuw i32 1, %35
  %37 = icmp slt i32 %33, %36
  br i1 %37, label %22, label %._crit_edge, !llvm.loop !12

.preheader30:                                     ; preds = %.lr.ph35
  %.not52 = icmp eq i32 %59, 31
  br i1 %.not52, label %.loopexit, label %.lr.ph37

.lr.ph37:                                         ; preds = %.preheader31, %.preheader30
  %38 = phi i32 [ %59, %.preheader30 ], [ 32, %.preheader31 ]
  %39 = shl nuw nsw i32 1, %38
  %40 = load i32, ptr @x, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = zext nneg i32 %39 to i64
  %smax = tail call i64 @llvm.smax.i64(i64 %41, i64 %42)
  %43 = icmp slt i32 %40, %39
  %umin.neg = sext i1 %43 to i64
  %44 = select i1 %43, i64 2, i64 1
  %45 = add i64 %smax, %umin.neg
  %46 = sub i64 %45, %41
  %umax = tail call i64 @llvm.umax.i64(i64 %41, i64 1)
  %47 = udiv i64 %46, %umax
  %48 = add i64 %44, %47
  %min.iters.check = icmp ugt i64 %48, 7
  %ident.check.not = icmp eq i32 %40, 1
  %or.cond = and i1 %min.iters.check, %ident.check.not
  br i1 %or.cond, label %vector.ph, label %scalar.ph.preheader

scalar.ph.preheader:                              ; preds = %middle.block, %.lr.ph37
  %indvars.iv56.ph = phi i64 [ 0, %.lr.ph37 ], [ %ind.end, %middle.block ]
  br label %scalar.ph

vector.ph:                                        ; preds = %.lr.ph37
  %n.vec = and i64 %48, -8
  %ind.end = mul nuw i64 %n.vec, %41
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %offset.idx = mul nuw i64 %index, %41
  %49 = getelementptr inbounds [32768 x i32], ptr @f, i64 0, i64 %offset.idx
  %50 = getelementptr inbounds i8, ptr %49, i64 16
  store <4 x i32> zeroinitializer, ptr %49, align 16, !tbaa !5
  store <4 x i32> zeroinitializer, ptr %50, align 16, !tbaa !5
  %index.next = add nuw i64 %index, 8
  %51 = icmp eq i64 %index.next, %n.vec
  br i1 %51, label %middle.block, label %vector.body, !llvm.loop !13

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %48, %n.vec
  br i1 %cmp.n, label %.loopexit, label %scalar.ph.preheader

.lr.ph35:                                         ; preds = %.lr.ph35.preheader, %.lr.ph35
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph35 ], [ 0, %.lr.ph35.preheader ]
  %52 = phi i32 [ %59, %.lr.ph35 ], [ %.ph, %.lr.ph35.preheader ]
  %53 = getelementptr inbounds [32768 x i32], ptr @f, i64 0, i64 %indvars.iv
  %notmask = shl nsw i32 -1, %52
  %54 = xor i32 %notmask, -1
  %55 = trunc nuw nsw i64 %indvars.iv to i32
  %56 = sub nsw i32 %54, %55
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds [32768 x i32], ptr @f, i64 0, i64 %57
  tail call void @_Z4swapRiS_(ptr noundef nonnull align 4 dereferenceable(4) %53, ptr noundef nonnull align 4 dereferenceable(4) %58)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %59 = load i32, ptr @m, align 4, !tbaa !5
  %60 = add nsw i32 %59, -1
  %61 = shl nuw i32 1, %60
  %62 = sext i32 %61 to i64
  %63 = icmp slt i64 %indvars.iv.next, %62
  br i1 %63, label %.lr.ph35, label %.preheader30, !llvm.loop !16

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv56 = phi i64 [ %indvars.iv.next57, %scalar.ph ], [ %indvars.iv56.ph, %scalar.ph.preheader ]
  %64 = getelementptr inbounds [32768 x i32], ptr @f, i64 0, i64 %indvars.iv56
  store i32 0, ptr %64, align 4, !tbaa !5
  %indvars.iv.next57 = add nsw i64 %indvars.iv56, %41
  %65 = icmp slt i64 %indvars.iv.next57, %42
  br i1 %65, label %scalar.ph, label %.loopexit, !llvm.loop !17

._crit_edge41:                                    ; preds = %.loopexit, %.lr.ph48
  %66 = phi i32 [ %5, %.lr.ph48 ], [ %11, %.loopexit ]
  store i32 0, ptr @ans, align 4, !tbaa !5
  %.not53 = icmp eq i32 %66, 31
  br i1 %.not53, label %._crit_edge45, label %.lr.ph44

._crit_edge45.loopexit:                           ; preds = %.lr.ph44
  %.pre = load i32, ptr @ans, align 4, !tbaa !5
  br label %._crit_edge45

._crit_edge45:                                    ; preds = %._crit_edge45.loopexit, %._crit_edge41
  %67 = phi i32 [ %.pre, %._crit_edge45.loopexit ], [ 0, %._crit_edge41 ]
  %68 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %67)
  %69 = load i32, ptr @t, align 4, !tbaa !5
  %70 = add nsw i32 %69, -1
  store i32 %70, ptr @t, align 4, !tbaa !5
  %.not = icmp eq i32 %69, 0
  br i1 %.not, label %._crit_edge49, label %.lr.ph48, !llvm.loop !18

.lr.ph44:                                         ; preds = %._crit_edge41, %.lr.ph44
  %indvars.iv59 = phi i64 [ %indvars.iv.next60, %.lr.ph44 ], [ 0, %._crit_edge41 ]
  %71 = getelementptr inbounds [32768 x i32], ptr @f, i64 0, i64 %indvars.iv59
  %72 = load i32, ptr %71, align 4, !tbaa !5
  tail call void @_Z3incRii(ptr noundef nonnull align 4 dereferenceable(4) @ans, i32 noundef %72)
  %indvars.iv.next60 = add nuw nsw i64 %indvars.iv59, 1
  %73 = load i32, ptr @m, align 4, !tbaa !5
  %74 = shl nuw i32 1, %73
  %75 = sext i32 %74 to i64
  %76 = icmp slt i64 %indvars.iv.next60, %75
  br i1 %76, label %.lr.ph44, label %._crit_edge45.loopexit, !llvm.loop !19

._crit_edge49:                                    ; preds = %._crit_edge45, %0
  ret i32 0
}

; 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: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #4

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.umax.i64(i64, i64) #4

attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { 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 = { 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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10, !14, !15}
!14 = !{!"llvm.loop.isvectorized", i32 1}
!15 = !{!"llvm.loop.unroll.runtime.disable"}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10, !14}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}


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