; LLVM IR from VastoLorde95/Competitive-Programming :: Hackerrank/101 Hacks/101 Hack 2015/101 Hack May/Problem A (A)

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

%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@_Z1sB5cxx11 = external dso_local global %"class.std::__cxx11::basic_string", align 8
@ans = external dso_local global i32, align 4
@mod = external dso_local global i32, align 4
@cnt = external dso_local global [26 x i32], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; 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
  store i32 0, ptr %1, align 4
  %4 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %5

5:                                                ; preds = %22, %0
  %6 = load i32, ptr %2, align 4, !tbaa !5
  %7 = sext i32 %6 to i64
  %8 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11) #6
  %9 = icmp ult i64 %7, %8
  br i1 %9, label %11, label %10

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

11:                                               ; preds = %5
  %12 = load i32, ptr %2, align 4, !tbaa !5
  %13 = sext i32 %12 to i64
  %14 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef %13)
  %15 = load i8, ptr %14, align 1, !tbaa !9
  %16 = sext i8 %15 to i32
  %17 = sub nsw i32 %16, 97
  %18 = sext i32 %17 to i64
  %19 = getelementptr inbounds [26 x i32], ptr @cnt, i64 0, i64 %18
  %20 = load i32, ptr %19, align 4, !tbaa !5
  %21 = add nsw i32 %20, 1
  store i32 %21, ptr %19, align 4, !tbaa !5
  br label %22

22:                                               ; preds = %11
  %23 = load i32, ptr %2, align 4, !tbaa !5
  %24 = add nsw i32 %23, 1
  store i32 %24, ptr %2, align 4, !tbaa !5
  br label %5, !llvm.loop !10

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

26:                                               ; preds = %47, %25
  %27 = load i32, ptr %3, align 4, !tbaa !5
  %28 = icmp slt i32 %27, 26
  br i1 %28, label %30, label %29

29:                                               ; preds = %26
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  br label %50

30:                                               ; preds = %26
  %31 = load i32, ptr %3, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [26 x i32], ptr @cnt, i64 0, i64 %32
  %34 = load i32, ptr %33, align 4, !tbaa !5
  %35 = icmp sgt i32 %34, 0
  br i1 %35, label %36, label %46

36:                                               ; preds = %30
  %37 = load i32, ptr @mod, align 4, !tbaa !5
  %38 = load i32, ptr %3, align 4, !tbaa !5
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds [26 x i32], ptr @cnt, i64 0, i64 %39
  %41 = load i32, ptr %40, align 4, !tbaa !5
  %42 = load i32, ptr @ans, align 4, !tbaa !5
  %43 = mul nsw i32 %42, %41
  store i32 %43, ptr @ans, align 4, !tbaa !5
  %44 = load i32, ptr @ans, align 4, !tbaa !5
  %45 = srem i32 %44, %37
  store i32 %45, ptr @ans, align 4, !tbaa !5
  br label %46

46:                                               ; preds = %36, %30
  br label %47

47:                                               ; preds = %46
  %48 = load i32, ptr %3, align 4, !tbaa !5
  %49 = add nsw i32 %48, 1
  store i32 %49, ptr %3, align 4, !tbaa !5
  br label %26, !llvm.loop !12

50:                                               ; preds = %29
  %51 = load i32, ptr @ans, align 4, !tbaa !5
  %52 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %51)
  %53 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %52, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  ret i32 0
}

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(32)) #1

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

; Function Attrs: mustprogress nounwind uwtable
declare noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32)) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef) #3 align 2

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

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #1

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #5

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 = { 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 = { 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 = { 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 }

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

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


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

%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@_Z1sB5cxx11 = external dso_local global %"class.std::__cxx11::basic_string", align 8
@ans = external dso_local local_unnamed_addr global i32, align 4
@mod = external dso_local local_unnamed_addr global i32, align 4
@cnt = external dso_local local_unnamed_addr global [26 x i32], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11)
  %2 = tail call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11) #5
  %.not = icmp eq i64 %2, 0
  br i1 %.not, label %.preheader, label %.lr.ph

.preheader:                                       ; preds = %.lr.ph, %0
  %ans.promoted = load i32, ptr @ans, align 4, !tbaa !5
  %3 = load i32, ptr @mod, align 4
  %4 = load i32, ptr @cnt, align 16, !tbaa !5
  %5 = icmp sgt i32 %4, 0
  br i1 %5, label %15, label %18

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %6 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef %indvars.iv)
  %7 = load i8, ptr %6, align 1, !tbaa !9
  %8 = sext i8 %7 to i64
  %9 = add nsw i64 %8, -97
  %10 = getelementptr inbounds [26 x i32], ptr @cnt, i64 0, i64 %9
  %11 = load i32, ptr %10, align 4, !tbaa !5
  %12 = add nsw i32 %11, 1
  store i32 %12, ptr %10, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %13 = tail call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11) #5
  %14 = icmp ugt i64 %13, %indvars.iv.next
  br i1 %14, label %.lr.ph, label %.preheader, !llvm.loop !10

15:                                               ; preds = %.preheader
  %16 = mul nsw i32 %ans.promoted, %4
  %17 = srem i32 %16, %3
  store i32 %17, ptr @ans, align 4, !tbaa !5
  br label %18

18:                                               ; preds = %.preheader, %15
  %19 = phi i32 [ %ans.promoted, %.preheader ], [ %17, %15 ]
  %20 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 4), align 4, !tbaa !5
  %21 = icmp sgt i32 %20, 0
  br i1 %21, label %22, label %25

22:                                               ; preds = %18
  %23 = mul nsw i32 %19, %20
  %24 = srem i32 %23, %3
  store i32 %24, ptr @ans, align 4, !tbaa !5
  br label %25

25:                                               ; preds = %22, %18
  %26 = phi i32 [ %19, %18 ], [ %24, %22 ]
  %27 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 8), align 8, !tbaa !5
  %28 = icmp sgt i32 %27, 0
  br i1 %28, label %29, label %32

29:                                               ; preds = %25
  %30 = mul nsw i32 %26, %27
  %31 = srem i32 %30, %3
  store i32 %31, ptr @ans, align 4, !tbaa !5
  br label %32

32:                                               ; preds = %29, %25
  %33 = phi i32 [ %26, %25 ], [ %31, %29 ]
  %34 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 12), align 4, !tbaa !5
  %35 = icmp sgt i32 %34, 0
  br i1 %35, label %36, label %39

36:                                               ; preds = %32
  %37 = mul nsw i32 %33, %34
  %38 = srem i32 %37, %3
  store i32 %38, ptr @ans, align 4, !tbaa !5
  br label %39

39:                                               ; preds = %36, %32
  %40 = phi i32 [ %33, %32 ], [ %38, %36 ]
  %41 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 16), align 16, !tbaa !5
  %42 = icmp sgt i32 %41, 0
  br i1 %42, label %43, label %46

43:                                               ; preds = %39
  %44 = mul nsw i32 %40, %41
  %45 = srem i32 %44, %3
  store i32 %45, ptr @ans, align 4, !tbaa !5
  br label %46

46:                                               ; preds = %43, %39
  %47 = phi i32 [ %40, %39 ], [ %45, %43 ]
  %48 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 20), align 4, !tbaa !5
  %49 = icmp sgt i32 %48, 0
  br i1 %49, label %50, label %53

50:                                               ; preds = %46
  %51 = mul nsw i32 %47, %48
  %52 = srem i32 %51, %3
  store i32 %52, ptr @ans, align 4, !tbaa !5
  br label %53

53:                                               ; preds = %50, %46
  %54 = phi i32 [ %47, %46 ], [ %52, %50 ]
  %55 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 24), align 8, !tbaa !5
  %56 = icmp sgt i32 %55, 0
  br i1 %56, label %57, label %60

57:                                               ; preds = %53
  %58 = mul nsw i32 %54, %55
  %59 = srem i32 %58, %3
  store i32 %59, ptr @ans, align 4, !tbaa !5
  br label %60

60:                                               ; preds = %57, %53
  %61 = phi i32 [ %54, %53 ], [ %59, %57 ]
  %62 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 28), align 4, !tbaa !5
  %63 = icmp sgt i32 %62, 0
  br i1 %63, label %64, label %67

64:                                               ; preds = %60
  %65 = mul nsw i32 %61, %62
  %66 = srem i32 %65, %3
  store i32 %66, ptr @ans, align 4, !tbaa !5
  br label %67

67:                                               ; preds = %64, %60
  %68 = phi i32 [ %61, %60 ], [ %66, %64 ]
  %69 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 32), align 16, !tbaa !5
  %70 = icmp sgt i32 %69, 0
  br i1 %70, label %71, label %74

71:                                               ; preds = %67
  %72 = mul nsw i32 %68, %69
  %73 = srem i32 %72, %3
  store i32 %73, ptr @ans, align 4, !tbaa !5
  br label %74

74:                                               ; preds = %71, %67
  %75 = phi i32 [ %68, %67 ], [ %73, %71 ]
  %76 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 36), align 4, !tbaa !5
  %77 = icmp sgt i32 %76, 0
  br i1 %77, label %78, label %81

78:                                               ; preds = %74
  %79 = mul nsw i32 %75, %76
  %80 = srem i32 %79, %3
  store i32 %80, ptr @ans, align 4, !tbaa !5
  br label %81

81:                                               ; preds = %78, %74
  %82 = phi i32 [ %75, %74 ], [ %80, %78 ]
  %83 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 40), align 8, !tbaa !5
  %84 = icmp sgt i32 %83, 0
  br i1 %84, label %85, label %88

85:                                               ; preds = %81
  %86 = mul nsw i32 %82, %83
  %87 = srem i32 %86, %3
  store i32 %87, ptr @ans, align 4, !tbaa !5
  br label %88

88:                                               ; preds = %85, %81
  %89 = phi i32 [ %82, %81 ], [ %87, %85 ]
  %90 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 44), align 4, !tbaa !5
  %91 = icmp sgt i32 %90, 0
  br i1 %91, label %92, label %95

92:                                               ; preds = %88
  %93 = mul nsw i32 %89, %90
  %94 = srem i32 %93, %3
  store i32 %94, ptr @ans, align 4, !tbaa !5
  br label %95

95:                                               ; preds = %92, %88
  %96 = phi i32 [ %89, %88 ], [ %94, %92 ]
  %97 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 48), align 16, !tbaa !5
  %98 = icmp sgt i32 %97, 0
  br i1 %98, label %99, label %102

99:                                               ; preds = %95
  %100 = mul nsw i32 %96, %97
  %101 = srem i32 %100, %3
  store i32 %101, ptr @ans, align 4, !tbaa !5
  br label %102

102:                                              ; preds = %99, %95
  %103 = phi i32 [ %96, %95 ], [ %101, %99 ]
  %104 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 52), align 4, !tbaa !5
  %105 = icmp sgt i32 %104, 0
  br i1 %105, label %106, label %109

106:                                              ; preds = %102
  %107 = mul nsw i32 %103, %104
  %108 = srem i32 %107, %3
  store i32 %108, ptr @ans, align 4, !tbaa !5
  br label %109

109:                                              ; preds = %106, %102
  %110 = phi i32 [ %103, %102 ], [ %108, %106 ]
  %111 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 56), align 8, !tbaa !5
  %112 = icmp sgt i32 %111, 0
  br i1 %112, label %113, label %116

113:                                              ; preds = %109
  %114 = mul nsw i32 %110, %111
  %115 = srem i32 %114, %3
  store i32 %115, ptr @ans, align 4, !tbaa !5
  br label %116

116:                                              ; preds = %113, %109
  %117 = phi i32 [ %110, %109 ], [ %115, %113 ]
  %118 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 60), align 4, !tbaa !5
  %119 = icmp sgt i32 %118, 0
  br i1 %119, label %120, label %123

120:                                              ; preds = %116
  %121 = mul nsw i32 %117, %118
  %122 = srem i32 %121, %3
  store i32 %122, ptr @ans, align 4, !tbaa !5
  br label %123

123:                                              ; preds = %120, %116
  %124 = phi i32 [ %117, %116 ], [ %122, %120 ]
  %125 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 64), align 16, !tbaa !5
  %126 = icmp sgt i32 %125, 0
  br i1 %126, label %127, label %130

127:                                              ; preds = %123
  %128 = mul nsw i32 %124, %125
  %129 = srem i32 %128, %3
  store i32 %129, ptr @ans, align 4, !tbaa !5
  br label %130

130:                                              ; preds = %127, %123
  %131 = phi i32 [ %124, %123 ], [ %129, %127 ]
  %132 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 68), align 4, !tbaa !5
  %133 = icmp sgt i32 %132, 0
  br i1 %133, label %134, label %137

134:                                              ; preds = %130
  %135 = mul nsw i32 %131, %132
  %136 = srem i32 %135, %3
  store i32 %136, ptr @ans, align 4, !tbaa !5
  br label %137

137:                                              ; preds = %134, %130
  %138 = phi i32 [ %131, %130 ], [ %136, %134 ]
  %139 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 72), align 8, !tbaa !5
  %140 = icmp sgt i32 %139, 0
  br i1 %140, label %141, label %144

141:                                              ; preds = %137
  %142 = mul nsw i32 %138, %139
  %143 = srem i32 %142, %3
  store i32 %143, ptr @ans, align 4, !tbaa !5
  br label %144

144:                                              ; preds = %141, %137
  %145 = phi i32 [ %138, %137 ], [ %143, %141 ]
  %146 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 76), align 4, !tbaa !5
  %147 = icmp sgt i32 %146, 0
  br i1 %147, label %148, label %151

148:                                              ; preds = %144
  %149 = mul nsw i32 %145, %146
  %150 = srem i32 %149, %3
  store i32 %150, ptr @ans, align 4, !tbaa !5
  br label %151

151:                                              ; preds = %148, %144
  %152 = phi i32 [ %145, %144 ], [ %150, %148 ]
  %153 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 80), align 16, !tbaa !5
  %154 = icmp sgt i32 %153, 0
  br i1 %154, label %155, label %158

155:                                              ; preds = %151
  %156 = mul nsw i32 %152, %153
  %157 = srem i32 %156, %3
  store i32 %157, ptr @ans, align 4, !tbaa !5
  br label %158

158:                                              ; preds = %155, %151
  %159 = phi i32 [ %152, %151 ], [ %157, %155 ]
  %160 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 84), align 4, !tbaa !5
  %161 = icmp sgt i32 %160, 0
  br i1 %161, label %162, label %165

162:                                              ; preds = %158
  %163 = mul nsw i32 %159, %160
  %164 = srem i32 %163, %3
  store i32 %164, ptr @ans, align 4, !tbaa !5
  br label %165

165:                                              ; preds = %162, %158
  %166 = phi i32 [ %159, %158 ], [ %164, %162 ]
  %167 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 88), align 8, !tbaa !5
  %168 = icmp sgt i32 %167, 0
  br i1 %168, label %169, label %172

169:                                              ; preds = %165
  %170 = mul nsw i32 %166, %167
  %171 = srem i32 %170, %3
  store i32 %171, ptr @ans, align 4, !tbaa !5
  br label %172

172:                                              ; preds = %169, %165
  %173 = phi i32 [ %166, %165 ], [ %171, %169 ]
  %174 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 92), align 4, !tbaa !5
  %175 = icmp sgt i32 %174, 0
  br i1 %175, label %176, label %179

176:                                              ; preds = %172
  %177 = mul nsw i32 %173, %174
  %178 = srem i32 %177, %3
  store i32 %178, ptr @ans, align 4, !tbaa !5
  br label %179

179:                                              ; preds = %176, %172
  %180 = phi i32 [ %173, %172 ], [ %178, %176 ]
  %181 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 96), align 16, !tbaa !5
  %182 = icmp sgt i32 %181, 0
  br i1 %182, label %183, label %186

183:                                              ; preds = %179
  %184 = mul nsw i32 %180, %181
  %185 = srem i32 %184, %3
  store i32 %185, ptr @ans, align 4, !tbaa !5
  br label %186

186:                                              ; preds = %183, %179
  %187 = phi i32 [ %180, %179 ], [ %185, %183 ]
  %188 = load i32, ptr getelementptr inbounds (i8, ptr @cnt, i64 100), align 4, !tbaa !5
  %189 = icmp sgt i32 %188, 0
  br i1 %189, label %190, label %193

190:                                              ; preds = %186
  %191 = mul nsw i32 %187, %188
  %192 = srem i32 %191, %3
  store i32 %192, ptr @ans, align 4, !tbaa !5
  br label %193

193:                                              ; preds = %190, %186
  %194 = phi i32 [ %192, %190 ], [ %187, %186 ]
  %195 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %194)
  %196 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %195, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  ret i32 0
}

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef) local_unnamed_addr #2 align 2

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #4

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

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

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


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