; LLVM IR from tangjz/acm-icpc :: codeforces/gym (100540D)

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

@tot = external dso_local global i32, align 4
@nxt = external dso_local global [100001 x [26 x i32]], align 16
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@cur = external dso_local global i32, align 4
@sum = external dso_local global [2 x i32], align 4
@cnt = external dso_local global [2 x [26 x i32]], align 16
@ans = external dso_local global i64, align 8
@str = external dso_local global [1001 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 [6 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z6insertv() #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 nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z5queryv() #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #3 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  br label %3

3:                                                ; preds = %70, %0
  %4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @m)
  %5 = icmp eq i32 %4, 2
  br i1 %5, label %6, label %11

6:                                                ; preds = %3
  %7 = load i32, ptr @n, align 4, !tbaa !5
  %8 = load i32, ptr @m, align 4, !tbaa !5
  %9 = add nsw i32 %7, %8
  %10 = icmp ne i32 %9, 0
  br label %11

11:                                               ; preds = %6, %3
  %12 = phi i1 [ false, %3 ], [ %10, %6 ]
  br i1 %12, label %13, label %73

13:                                               ; preds = %11
  store i32 0, ptr @tot, align 4, !tbaa !5
  %14 = load i32, ptr @tot, align 4, !tbaa !5
  %15 = add nsw i32 %14, 1
  store i32 %15, ptr @tot, align 4, !tbaa !5
  %16 = sext i32 %14 to i64
  %17 = getelementptr inbounds [26 x i32], ptr @nxt, i64 %16
  call void @llvm.memset.p0.i64(ptr align 4 %17, i8 0, i64 104, i1 false)
  br label %18

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

22:                                               ; preds = %18
  %23 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef @str)
  call void @_Z6insertv()
  br label %18, !llvm.loop !9

24:                                               ; preds = %18
  store i32 0, ptr @cur, align 4, !tbaa !5
  store i32 0, ptr @sum, align 4, !tbaa !5
  %25 = load i32, ptr @cur, align 4, !tbaa !5
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds [26 x i32], ptr @cnt, i64 %26
  call void @llvm.memset.p0.i64(ptr align 4 %27, i8 0, i64 104, i1 false)
  call void @_Z5queryv()
  store i32 0, ptr @tot, align 4, !tbaa !5
  %28 = load i32, ptr @tot, align 4, !tbaa !5
  %29 = add nsw i32 %28, 1
  store i32 %29, ptr @tot, align 4, !tbaa !5
  %30 = sext i32 %28 to i64
  %31 = getelementptr inbounds [26 x i32], ptr @nxt, i64 %30
  call void @llvm.memset.p0.i64(ptr align 4 %31, i8 0, i64 104, i1 false)
  br label %32

32:                                               ; preds = %36, %24
  %33 = load i32, ptr @m, align 4, !tbaa !5
  %34 = add nsw i32 %33, -1
  store i32 %34, ptr @m, align 4, !tbaa !5
  %35 = icmp ne i32 %33, 0
  br i1 %35, label %36, label %40

36:                                               ; preds = %32
  %37 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef @str)
  %38 = call i64 @strlen(ptr noundef @str) #7
  %39 = getelementptr inbounds i8, ptr @str, i64 %38
  call void @_ZSt7reverseIPcEvT_S1_(ptr noundef @str, ptr noundef %39)
  call void @_Z6insertv()
  br label %32, !llvm.loop !11

40:                                               ; preds = %32
  store i32 1, ptr @cur, align 4, !tbaa !5
  store i32 0, ptr getelementptr inbounds ([2 x i32], ptr @sum, i64 0, i64 1), align 4, !tbaa !5
  %41 = load i32, ptr @cur, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [26 x i32], ptr @cnt, i64 %42
  call void @llvm.memset.p0.i64(ptr align 4 %43, i8 0, i64 104, i1 false)
  call void @_Z5queryv()
  %44 = load i32, ptr @sum, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = load i32, ptr getelementptr inbounds ([2 x i32], ptr @sum, i64 0, i64 1), align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = mul nsw i64 %45, %47
  store i64 %48, ptr @ans, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #8
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %49

49:                                               ; preds = %67, %40
  %50 = load i32, ptr %2, align 4, !tbaa !5
  %51 = icmp slt i32 %50, 26
  br i1 %51, label %53, label %52

52:                                               ; preds = %49
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #8
  br label %70

53:                                               ; preds = %49
  %54 = load i32, ptr %2, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [26 x i32], ptr @cnt, i64 0, i64 %55
  %57 = load i32, ptr %56, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = load i32, ptr %2, align 4, !tbaa !5
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [26 x i32], ptr getelementptr inbounds ([2 x [26 x i32]], ptr @cnt, i64 0, i64 1), i64 0, i64 %60
  %62 = load i32, ptr %61, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = mul nsw i64 %58, %63
  %65 = load i64, ptr @ans, align 8, !tbaa !12
  %66 = sub nsw i64 %65, %64
  store i64 %66, ptr @ans, align 8, !tbaa !12
  br label %67

67:                                               ; preds = %53
  %68 = load i32, ptr %2, align 4, !tbaa !5
  %69 = add nsw i32 %68, 1
  store i32 %69, ptr %2, align 4, !tbaa !5
  br label %49, !llvm.loop !14

70:                                               ; preds = %52
  %71 = load i64, ptr @ans, align 8, !tbaa !12
  %72 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i64 noundef %71)
  br label %3, !llvm.loop !15

73:                                               ; preds = %11
  ret i32 0
}

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt7reverseIPcEvT_S1_(ptr noundef, ptr noundef) #5

; Function Attrs: nounwind willreturn memory(read)
declare i64 @strlen(ptr noundef) #6

declare i32 @printf(ptr noundef, ...) #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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { 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 #4 = { "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 #5 = { 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 #6 = { nounwind willreturn memory(read) "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 #7 = { nounwind willreturn memory(read) }
attributes #8 = { 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 = !{!13, !13, i64 0}
!13 = !{!"long long", !7, i64 0}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !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"

@tot = external dso_local local_unnamed_addr global i32, align 4
@nxt = external dso_local local_unnamed_addr global [100001 x [26 x i32]], align 16
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@cur = external dso_local local_unnamed_addr global i32, align 4
@sum = external dso_local local_unnamed_addr global [2 x i32], align 4
@cnt = external dso_local local_unnamed_addr global [2 x [26 x i32]], align 16
@ans = external dso_local local_unnamed_addr global i64, align 8
@str = external dso_local global [1001 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 [6 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z6insertv() local_unnamed_addr #0

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z5queryv() local_unnamed_addr #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 {
  %1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @m)
  %2 = icmp eq i32 %1, 2
  %3 = load i32, ptr @n, align 4
  %4 = load i32, ptr @m, align 4
  %5 = sub i32 0, %4
  %6 = icmp ne i32 %3, %5
  %7 = select i1 %2, i1 %6, i1 false
  br i1 %7, label %.lr.ph12, label %._crit_edge13

.lr.ph12:                                         ; preds = %0, %._crit_edge9
  %8 = phi i32 [ %184, %._crit_edge9 ], [ %3, %0 ]
  store i32 1, ptr @tot, align 4, !tbaa !5
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(104) @nxt, i8 0, i64 104, i1 false)
  %9 = add nsw i32 %8, -1
  store i32 %9, ptr @n, align 4, !tbaa !5
  %.not5 = icmp eq i32 %8, 0
  br i1 %.not5, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph12, %.lr.ph
  %10 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @str)
  tail call void @_Z6insertv()
  %11 = load i32, ptr @n, align 4, !tbaa !5
  %12 = add nsw i32 %11, -1
  store i32 %12, ptr @n, align 4, !tbaa !5
  %.not = icmp eq i32 %11, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph, !llvm.loop !9

._crit_edge:                                      ; preds = %.lr.ph, %.lr.ph12
  store i32 0, ptr @cur, align 4, !tbaa !5
  store i32 0, ptr @sum, align 4, !tbaa !5
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(104) @cnt, i8 0, i64 104, i1 false)
  tail call void @_Z5queryv()
  store i32 1, ptr @tot, align 4, !tbaa !5
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(104) @nxt, i8 0, i64 104, i1 false)
  %13 = load i32, ptr @m, align 4, !tbaa !5
  %14 = add nsw i32 %13, -1
  store i32 %14, ptr @m, align 4, !tbaa !5
  %.not46 = icmp eq i32 %13, 0
  br i1 %.not46, label %._crit_edge9, label %.lr.ph8

.lr.ph8:                                          ; preds = %._crit_edge, %.lr.ph8
  %15 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @str)
  %16 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) @str) #6
  %17 = getelementptr inbounds i8, ptr @str, i64 %16
  tail call void @_ZSt7reverseIPcEvT_S1_(ptr noundef nonnull @str, ptr noundef nonnull %17)
  tail call void @_Z6insertv()
  %18 = load i32, ptr @m, align 4, !tbaa !5
  %19 = add nsw i32 %18, -1
  store i32 %19, ptr @m, align 4, !tbaa !5
  %.not4 = icmp eq i32 %18, 0
  br i1 %.not4, label %._crit_edge9, label %.lr.ph8, !llvm.loop !11

._crit_edge9:                                     ; preds = %.lr.ph8, %._crit_edge
  store i32 1, ptr @cur, align 4, !tbaa !5
  store i32 0, ptr getelementptr inbounds (i8, ptr @sum, i64 4), align 4, !tbaa !5
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(104) getelementptr inbounds (i8, ptr @cnt, i64 104), i8 0, i64 104, i1 false)
  tail call void @_Z5queryv()
  %20 = load i32, ptr @sum, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  %22 = load i32, ptr getelementptr inbounds (i8, ptr @sum, i64 4), align 4, !tbaa !5
  %23 = sext i32 %22 to i64
  %24 = mul nsw i64 %23, %21
  %25 = load i32, ptr @cnt, align 16, !tbaa !5
  %26 = sext i32 %25 to i64
  %27 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 104), align 8, !tbaa !5
  %28 = sext i32 %27 to i64
  %29 = mul nsw i64 %28, %26
  %30 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 4), align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 108), align 4, !tbaa !5
  %33 = sext i32 %32 to i64
  %34 = mul nsw i64 %33, %31
  %35 = add i64 %29, %34
  %36 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 8), align 8, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 112), align 16, !tbaa !5
  %39 = sext i32 %38 to i64
  %40 = mul nsw i64 %39, %37
  %41 = add i64 %35, %40
  %42 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 12), align 4, !tbaa !5
  %43 = sext i32 %42 to i64
  %44 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 116), align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = mul nsw i64 %45, %43
  %47 = add i64 %41, %46
  %48 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 16), align 16, !tbaa !5
  %49 = sext i32 %48 to i64
  %50 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 120), align 8, !tbaa !5
  %51 = sext i32 %50 to i64
  %52 = mul nsw i64 %51, %49
  %53 = add i64 %47, %52
  %54 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 20), align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 124), align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %58 = mul nsw i64 %57, %55
  %59 = add i64 %53, %58
  %60 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 24), align 8, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 128), align 16, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = mul nsw i64 %63, %61
  %65 = add i64 %59, %64
  %66 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 28), align 4, !tbaa !5
  %67 = sext i32 %66 to i64
  %68 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 132), align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = mul nsw i64 %69, %67
  %71 = add i64 %65, %70
  %72 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 32), align 16, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 136), align 8, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = mul nsw i64 %75, %73
  %77 = add i64 %71, %76
  %78 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 36), align 4, !tbaa !5
  %79 = sext i32 %78 to i64
  %80 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 140), align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = mul nsw i64 %81, %79
  %83 = add i64 %77, %82
  %84 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 40), align 8, !tbaa !5
  %85 = sext i32 %84 to i64
  %86 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 144), align 16, !tbaa !5
  %87 = sext i32 %86 to i64
  %88 = mul nsw i64 %87, %85
  %89 = add i64 %83, %88
  %90 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 44), align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 148), align 4, !tbaa !5
  %93 = sext i32 %92 to i64
  %94 = mul nsw i64 %93, %91
  %95 = add i64 %89, %94
  %96 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 48), align 16, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 152), align 8, !tbaa !5
  %99 = sext i32 %98 to i64
  %100 = mul nsw i64 %99, %97
  %101 = add i64 %95, %100
  %102 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 52), align 4, !tbaa !5
  %103 = sext i32 %102 to i64
  %104 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 156), align 4, !tbaa !5
  %105 = sext i32 %104 to i64
  %106 = mul nsw i64 %105, %103
  %107 = add i64 %101, %106
  %108 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 56), align 8, !tbaa !5
  %109 = sext i32 %108 to i64
  %110 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 160), align 16, !tbaa !5
  %111 = sext i32 %110 to i64
  %112 = mul nsw i64 %111, %109
  %113 = add i64 %107, %112
  %114 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 60), align 4, !tbaa !5
  %115 = sext i32 %114 to i64
  %116 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 164), align 4, !tbaa !5
  %117 = sext i32 %116 to i64
  %118 = mul nsw i64 %117, %115
  %119 = add i64 %113, %118
  %120 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 64), align 16, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 168), align 8, !tbaa !5
  %123 = sext i32 %122 to i64
  %124 = mul nsw i64 %123, %121
  %125 = add i64 %119, %124
  %126 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 68), align 4, !tbaa !5
  %127 = sext i32 %126 to i64
  %128 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 172), align 4, !tbaa !5
  %129 = sext i32 %128 to i64
  %130 = mul nsw i64 %129, %127
  %131 = add i64 %125, %130
  %132 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 72), align 8, !tbaa !5
  %133 = sext i32 %132 to i64
  %134 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 176), align 16, !tbaa !5
  %135 = sext i32 %134 to i64
  %136 = mul nsw i64 %135, %133
  %137 = add i64 %131, %136
  %138 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 76), align 4, !tbaa !5
  %139 = sext i32 %138 to i64
  %140 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 180), align 4, !tbaa !5
  %141 = sext i32 %140 to i64
  %142 = mul nsw i64 %141, %139
  %143 = add i64 %137, %142
  %144 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 80), align 16, !tbaa !5
  %145 = sext i32 %144 to i64
  %146 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 184), align 8, !tbaa !5
  %147 = sext i32 %146 to i64
  %148 = mul nsw i64 %147, %145
  %149 = add i64 %143, %148
  %150 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 84), align 4, !tbaa !5
  %151 = sext i32 %150 to i64
  %152 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 188), align 4, !tbaa !5
  %153 = sext i32 %152 to i64
  %154 = mul nsw i64 %153, %151
  %155 = add i64 %149, %154
  %156 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 88), align 8, !tbaa !5
  %157 = sext i32 %156 to i64
  %158 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 192), align 16, !tbaa !5
  %159 = sext i32 %158 to i64
  %160 = mul nsw i64 %159, %157
  %161 = add i64 %155, %160
  %162 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 92), align 4, !tbaa !5
  %163 = sext i32 %162 to i64
  %164 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 196), align 4, !tbaa !5
  %165 = sext i32 %164 to i64
  %166 = mul nsw i64 %165, %163
  %167 = add i64 %161, %166
  %168 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 96), align 16, !tbaa !5
  %169 = sext i32 %168 to i64
  %170 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 200), align 8, !tbaa !5
  %171 = sext i32 %170 to i64
  %172 = mul nsw i64 %171, %169
  %173 = add i64 %167, %172
  %174 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 100), align 4, !tbaa !5
  %175 = sext i32 %174 to i64
  %176 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 204), align 4, !tbaa !5
  %177 = sext i32 %176 to i64
  %178 = mul nsw i64 %177, %175
  %179 = add i64 %173, %178
  %180 = sub i64 %24, %179
  store i64 %180, ptr @ans, align 8, !tbaa !12
  %181 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %180)
  %182 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @m)
  %183 = icmp eq i32 %182, 2
  %184 = load i32, ptr @n, align 4
  %185 = load i32, ptr @m, align 4
  %186 = sub i32 0, %185
  %187 = icmp ne i32 %184, %186
  %188 = select i1 %183, i1 %187, i1 false
  br i1 %188, label %.lr.ph12, label %._crit_edge13, !llvm.loop !14

._crit_edge13:                                    ; preds = %._crit_edge9, %0
  ret i32 0
}

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt7reverseIPcEvT_S1_(ptr noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #5

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { 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 #4 = { 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 #5 = { mustprogress nofree nounwind willreturn memory(argmem: read) "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 #6 = { nounwind willreturn memory(read) }

!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 = !{!13, !13, i64 0}
!13 = !{!"long long", !7, i64 0}
!14 = distinct !{!14, !10}


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