; LLVM IR from tangjz/acm-icpc :: codeforces/complete (1033G)

; 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
@a = external dso_local global [101 x i64], align 16
@c = external dso_local global [3 x i64], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [21 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 [2 x i32], align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %15 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @m)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %16

16:                                               ; preds = %26, %0
  %17 = load i32, ptr %2, align 4, !tbaa !5
  %18 = load i32, ptr @n, align 4, !tbaa !5
  %19 = icmp slt i32 %17, %18
  br i1 %19, label %21, label %20

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

21:                                               ; preds = %16
  %22 = load i32, ptr %2, align 4, !tbaa !5
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds i64, ptr @a, i64 %23
  %25 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %24)
  br label %26

26:                                               ; preds = %21
  %27 = load i32, ptr %2, align 4, !tbaa !5
  %28 = add nsw i32 %27, 1
  store i32 %28, ptr %2, align 4, !tbaa !5
  br label %16, !llvm.loop !9

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

30:                                               ; preds = %124, %29
  %31 = load i32, ptr %3, align 4, !tbaa !5
  %32 = load i32, ptr @m, align 4, !tbaa !5
  %33 = load i32, ptr @m, align 4, !tbaa !5
  %34 = add nsw i32 %32, %33
  %35 = icmp sle i32 %31, %34
  br i1 %35, label %37, label %36

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

37:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  %38 = load i32, ptr %3, align 4, !tbaa !5
  %39 = sub nsw i32 %38, 1
  store i32 %39, ptr %6, align 4, !tbaa !5
  %40 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) @m)
  %41 = load i32, ptr %40, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  store i32 %41, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store i32 0, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  call void @llvm.memset.p0.i64(ptr align 4 %8, i8 0, i64 8, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %42

42:                                               ; preds = %90, %37
  %43 = load i32, ptr %9, align 4, !tbaa !5
  %44 = load i32, ptr @n, align 4, !tbaa !5
  %45 = icmp slt i32 %43, %44
  br i1 %45, label %47, label %46

46:                                               ; preds = %42
  store i32 8, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %93

47:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %48 = load i32, ptr %9, align 4, !tbaa !5
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [101 x i64], ptr @a, i64 0, i64 %49
  %51 = load i64, ptr %50, align 8, !tbaa !11
  %52 = load i32, ptr %3, align 4, !tbaa !5
  %53 = sext i32 %52 to i64
  %54 = srem i64 %51, %53
  %55 = trunc i64 %54 to i32
  store i32 %55, ptr %10, align 4, !tbaa !5
  %56 = load i32, ptr %10, align 4, !tbaa !5
  %57 = load i32, ptr %10, align 4, !tbaa !5
  %58 = add nsw i32 %56, %57
  %59 = load i32, ptr %3, align 4, !tbaa !5
  %60 = icmp slt i32 %58, %59
  br i1 %60, label %61, label %68

61:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %62 = load i32, ptr %3, align 4, !tbaa !5
  %63 = sub nsw i32 %62, 1
  %64 = load i32, ptr %10, align 4, !tbaa !5
  %65 = sub nsw i32 %63, %64
  store i32 %65, ptr %11, align 4, !tbaa !5
  %66 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %11)
  %67 = load i32, ptr %66, align 4, !tbaa !5
  store i32 %67, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %73

68:                                               ; preds = %47
  %69 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %10)
  %70 = load i32, ptr %69, align 4, !tbaa !5
  store i32 %70, ptr %5, align 4, !tbaa !5
  %71 = load i32, ptr %7, align 4, !tbaa !5
  %72 = xor i32 %71, 1
  store i32 %72, ptr %7, align 4, !tbaa !5
  br label %73

73:                                               ; preds = %68, %61
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  %74 = load i32, ptr %10, align 4, !tbaa !5
  %75 = ashr i32 %74, 1
  store i32 %75, ptr %12, align 4, !tbaa !5
  %76 = getelementptr inbounds [2 x i32], ptr %8, i64 0, i64 0
  %77 = load i32, ptr %76, align 4, !tbaa !5
  %78 = load i32, ptr %12, align 4, !tbaa !5
  %79 = icmp sle i32 %77, %78
  br i1 %79, label %80, label %82

80:                                               ; preds = %73
  %81 = getelementptr inbounds [2 x i32], ptr %8, i64 0, i64 0
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %81, ptr noundef nonnull align 4 dereferenceable(4) %12) #5
  br label %82

82:                                               ; preds = %80, %73
  %83 = getelementptr inbounds [2 x i32], ptr %8, i64 0, i64 1
  %84 = load i32, ptr %83, align 4, !tbaa !5
  %85 = load i32, ptr %12, align 4, !tbaa !5
  %86 = icmp sle i32 %84, %85
  br i1 %86, label %87, label %89

87:                                               ; preds = %82
  %88 = getelementptr inbounds [2 x i32], ptr %8, i64 0, i64 1
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %88, ptr noundef nonnull align 4 dereferenceable(4) %12) #5
  br label %89

89:                                               ; preds = %87, %82
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %90

90:                                               ; preds = %89
  %91 = load i32, ptr %9, align 4, !tbaa !5
  %92 = add nsw i32 %91, 1
  store i32 %92, ptr %9, align 4, !tbaa !5
  br label %42, !llvm.loop !13

93:                                               ; preds = %46
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  %94 = load i32, ptr %3, align 4, !tbaa !5
  %95 = sub nsw i32 %94, 1
  %96 = load i32, ptr %7, align 4, !tbaa !5
  %97 = and i32 %96, 1
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [2 x i32], ptr %8, i64 0, i64 %98
  %100 = load i32, ptr %99, align 4, !tbaa !5
  %101 = sub nsw i32 %95, %100
  store i32 %101, ptr %13, align 4, !tbaa !5
  %102 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %13)
  %103 = load i32, ptr %102, align 4, !tbaa !5
  store i32 %103, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  %104 = load i32, ptr %5, align 4, !tbaa !5
  %105 = load i32, ptr %5, align 4, !tbaa !5
  %106 = add nsw i32 %104, %105
  %107 = load i32, ptr %3, align 4, !tbaa !5
  %108 = icmp sge i32 %106, %107
  br i1 %108, label %109, label %123

109:                                              ; preds = %93
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  %110 = load i32, ptr %3, align 4, !tbaa !5
  %111 = load i32, ptr %5, align 4, !tbaa !5
  %112 = sub nsw i32 %110, %111
  store i32 %112, ptr %14, align 4, !tbaa !5
  %113 = load i32, ptr %5, align 4, !tbaa !5
  %114 = load i32, ptr %14, align 4, !tbaa !5
  %115 = sub nsw i32 %113, %114
  %116 = add nsw i32 %115, 1
  %117 = sext i32 %116 to i64
  %118 = load i32, ptr %7, align 4, !tbaa !5
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [3 x i64], ptr @c, i64 0, i64 %119
  %121 = load i64, ptr %120, align 8, !tbaa !11
  %122 = add nsw i64 %121, %117
  store i64 %122, ptr %120, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %123

123:                                              ; preds = %109, %93
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br label %124

124:                                              ; preds = %123
  %125 = load i32, ptr %3, align 4, !tbaa !5
  %126 = add nsw i32 %125, 1
  store i32 %126, ptr %3, align 4, !tbaa !5
  br label %30, !llvm.loop !14

127:                                              ; preds = %36
  %128 = load i32, ptr @m, align 4, !tbaa !5
  %129 = sext i32 %128 to i64
  %130 = load i32, ptr @m, align 4, !tbaa !5
  %131 = sext i32 %130 to i64
  %132 = mul nsw i64 %129, %131
  %133 = load i64, ptr @c, align 16, !tbaa !11
  %134 = sub nsw i64 %132, %133
  %135 = load i64, ptr getelementptr inbounds ([3 x i64], ptr @c, i64 0, i64 1), align 8, !tbaa !11
  %136 = sub nsw i64 %134, %135
  %137 = sdiv i64 %136, 2
  store i64 %137, ptr getelementptr inbounds ([3 x i64], ptr @c, i64 0, i64 2), align 16, !tbaa !11
  %138 = load i64, ptr getelementptr inbounds ([3 x i64], ptr @c, i64 0, i64 2), align 16, !tbaa !11
  %139 = load i64, ptr getelementptr inbounds ([3 x i64], ptr @c, i64 0, i64 2), align 16, !tbaa !11
  %140 = load i64, ptr getelementptr inbounds ([3 x i64], ptr @c, i64 0, i64 1), align 8, !tbaa !11
  %141 = load i64, ptr @c, align 16, !tbaa !11
  %142 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i64 noundef %138, i64 noundef %139, i64 noundef %140, i64 noundef %141)
  ret i32 0
}

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 nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #3

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #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 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 #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 = !{!12, !12, i64 0}
!12 = !{!"long long", !7, i64 0}
!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
@a = external dso_local global [101 x i64], align 16
@c = external dso_local local_unnamed_addr global [3 x i64], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [21 x i8], align 1

; Function Attrs: mustprogress norecurse nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca [2 x i32], align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @m)
  %9 = load i32, ptr @n, align 4, !tbaa !5
  %10 = icmp sgt i32 %9, 0
  br i1 %10, label %.lr.ph, label %.preheader

.preheader:                                       ; preds = %.lr.ph, %0
  %11 = load i32, ptr @m, align 4, !tbaa !5
  %.not31 = icmp slt i32 %11, 1
  br i1 %.not31, label %._crit_edge34, label %.lr.ph33

.lr.ph33:                                         ; preds = %.preheader
  %12 = getelementptr inbounds i8, ptr %3, i64 4
  br label %26

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %13 = getelementptr inbounds i64, ptr @a, i64 %indvars.iv
  %14 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %13)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %15 = load i32, ptr @n, align 4, !tbaa !5
  %16 = sext i32 %15 to i64
  %17 = icmp slt i64 %indvars.iv.next, %16
  br i1 %17, label %.lr.ph, label %.preheader, !llvm.loop !9

._crit_edge34:                                    ; preds = %78, %.preheader
  %.lcssa = phi i32 [ %11, %.preheader ], [ %79, %78 ]
  %18 = sext i32 %.lcssa to i64
  %19 = mul nsw i64 %18, %18
  %20 = load i64, ptr @c, align 16, !tbaa !11
  %21 = load i64, ptr getelementptr inbounds (i8, ptr @c, i64 8), align 8, !tbaa !11
  %22 = add i64 %20, %21
  %23 = sub i64 %19, %22
  %24 = sdiv i64 %23, 2
  store i64 %24, ptr getelementptr inbounds (i8, ptr @c, i64 16), align 16, !tbaa !11
  %25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %24, i64 noundef %24, i64 noundef %21, i64 noundef %20)
  ret i32 0

26:                                               ; preds = %.lr.ph33, %78
  %indvars.iv41 = phi i64 [ 2, %.lr.ph33 ], [ %indvars.iv.next42, %78 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #4
  %27 = trunc i64 %indvars.iv41 to i32
  %28 = add i32 %27, -1
  store i32 %28, ptr %2, align 4, !tbaa !5
  %29 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) @m)
  %30 = load i32, ptr %29, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #4
  store i32 %30, ptr %1, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #4
  store i64 0, ptr %3, align 8
  %31 = load i32, ptr @n, align 4, !tbaa !5
  %32 = icmp sgt i32 %31, 0
  br i1 %32, label %.lr.ph30, label %._crit_edge

._crit_edge:                                      ; preds = %66, %26
  %.020.lcssa = phi i32 [ 0, %26 ], [ %.1, %66 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #4
  %33 = and i32 %.020.lcssa, 1
  %34 = zext nneg i32 %33 to i64
  %35 = getelementptr inbounds [2 x i32], ptr %3, i64 0, i64 %34
  %36 = load i32, ptr %35, align 4, !tbaa !5
  %37 = sub nsw i32 %28, %36
  store i32 %37, ptr %7, align 4, !tbaa !5
  %38 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %39 = load i32, ptr %38, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #4
  %40 = shl i32 %39, 1
  %41 = sext i32 %40 to i64
  %.not22 = icmp sgt i64 %indvars.iv41, %41
  br i1 %.not22, label %78, label %70

.lr.ph30:                                         ; preds = %26, %66
  %indvars.iv38 = phi i64 [ %indvars.iv.next39, %66 ], [ 0, %26 ]
  %.02028 = phi i32 [ %.1, %66 ], [ 0, %26 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #4
  %42 = getelementptr inbounds [101 x i64], ptr @a, i64 0, i64 %indvars.iv38
  %43 = load i64, ptr %42, align 8, !tbaa !11
  %44 = srem i64 %43, %indvars.iv41
  %45 = trunc nsw i64 %44 to i32
  store i32 %45, ptr %4, align 4, !tbaa !5
  %46 = shl nsw i32 %45, 1
  %47 = sext i32 %46 to i64
  %48 = icmp sgt i64 %indvars.iv41, %47
  br i1 %48, label %49, label %53

49:                                               ; preds = %.lr.ph30
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #4
  %50 = sub nsw i32 %28, %45
  store i32 %50, ptr %5, align 4, !tbaa !5
  %51 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %52 = load i32, ptr %51, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #4
  br label %57

53:                                               ; preds = %.lr.ph30
  %54 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %55 = load i32, ptr %54, align 4, !tbaa !5
  %56 = xor i32 %.02028, 1
  br label %57

57:                                               ; preds = %53, %49
  %.sink = phi i32 [ %52, %49 ], [ %55, %53 ]
  %.1 = phi i32 [ %.02028, %49 ], [ %56, %53 ]
  store i32 %.sink, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #4
  %58 = load i32, ptr %4, align 4, !tbaa !5
  %59 = ashr i32 %58, 1
  store i32 %59, ptr %6, align 4, !tbaa !5
  %60 = load i32, ptr %3, align 8, !tbaa !5
  %.not23 = icmp sgt i32 %60, %59
  br i1 %.not23, label %62, label %61

61:                                               ; preds = %57
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %6) #4
  %.pre = load i32, ptr %6, align 4, !tbaa !5
  br label %62

62:                                               ; preds = %61, %57
  %63 = phi i32 [ %.pre, %61 ], [ %59, %57 ]
  %64 = load i32, ptr %12, align 4, !tbaa !5
  %.not24 = icmp sgt i32 %64, %63
  br i1 %.not24, label %66, label %65

65:                                               ; preds = %62
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %12, ptr noundef nonnull align 4 dereferenceable(4) %6) #4
  br label %66

66:                                               ; preds = %65, %62
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #4
  %indvars.iv.next39 = add nuw nsw i64 %indvars.iv38, 1
  %67 = load i32, ptr @n, align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %69 = icmp slt i64 %indvars.iv.next39, %68
  br i1 %69, label %.lr.ph30, label %._crit_edge, !llvm.loop !13

70:                                               ; preds = %._crit_edge
  %71 = trunc nuw nsw i64 %indvars.iv41 to i32
  %reass.sub = sub i32 %40, %71
  %72 = add i32 %reass.sub, 1
  %73 = sext i32 %72 to i64
  %74 = zext nneg i32 %.020.lcssa to i64
  %75 = getelementptr inbounds [3 x i64], ptr @c, i64 0, i64 %74
  %76 = load i64, ptr %75, align 8, !tbaa !11
  %77 = add nsw i64 %76, %73
  store i64 %77, ptr %75, align 8, !tbaa !11
  br label %78

78:                                               ; preds = %70, %._crit_edge
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #4
  %indvars.iv.next42 = add nuw nsw i64 %indvars.iv41, 1
  %79 = load i32, ptr @m, align 4, !tbaa !5
  %80 = shl nsw i32 %79, 1
  %81 = sext i32 %80 to i64
  %.not.not = icmp slt i64 %indvars.iv41, %81
  br i1 %.not.not, label %26, label %._crit_edge34, !llvm.loop !14
}

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3

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

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

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

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

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


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