; LLVM IR from VastoLorde95/Competitive-Programming :: Codeforces/336 Division 2/Problem E (E)

; 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::basic_ostream" = type { ptr, %"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::__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" }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@b = external dso_local global [2 x i64], align 16
@p = external dso_local global [2 x i64], align 16
@h1 = external dso_local global [2 x i64], align 16
@h2 = external dso_local global [2 x i64], align 16
@pw = external dso_local global [2 x i64], align 16
@n = external dso_local global i32, align 4
@_Z1sB5cxx11 = external dso_local global %"class.std::__cxx11::basic_string", align 8
@_Z1tB5cxx11 = external dso_local global %"class.std::__cxx11::basic_string", align 8
@r = external dso_local global [255 x i32], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = external hidden unnamed_addr constant [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [5 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
  store i32 0, ptr %1, align 4
  %5 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %6 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %7 = getelementptr i8, ptr %6, i64 -24
  %8 = load i64, ptr %7, align 8
  %9 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %8
  %10 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %9, ptr noundef null)
  %11 = load ptr, ptr @_ZSt4cout, align 8, !tbaa !5
  %12 = getelementptr i8, ptr %11, i64 -24
  %13 = load i64, ptr %12, align 8
  %14 = getelementptr inbounds i8, ptr @_ZSt4cout, i64 %13
  %15 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %14, ptr noundef null)
  %16 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @n)
  %17 = load i32, ptr @n, align 4, !tbaa !8
  %18 = add nsw i32 %17, -1
  store i32 %18, ptr @n, align 4, !tbaa !8
  %19 = 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)
  %20 = 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) %19, ptr noundef nonnull align 8 dereferenceable(32) @_Z1tB5cxx11)
  store i32 83, ptr getelementptr inbounds ([255 x i32], ptr @r, i64 0, i64 78), align 8, !tbaa !8
  store i32 78, ptr getelementptr inbounds ([255 x i32], ptr @r, i64 0, i64 83), align 4, !tbaa !8
  store i32 87, ptr getelementptr inbounds ([255 x i32], ptr @r, i64 0, i64 69), align 4, !tbaa !8
  store i32 69, ptr getelementptr inbounds ([255 x i32], ptr @r, i64 0, i64 87), align 4, !tbaa !8
  store i64 1, ptr getelementptr inbounds ([2 x i64], ptr @pw, i64 0, i64 1), align 8, !tbaa !11
  store i64 1, ptr @pw, align 16, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  %21 = load i32, ptr @n, align 4, !tbaa !8
  %22 = sub nsw i32 %21, 1
  store i32 %22, ptr %2, align 4, !tbaa !8
  br label %23

23:                                               ; preds = %113, %0
  %24 = load i32, ptr %2, align 4, !tbaa !8
  %25 = icmp sge i32 %24, 0
  br i1 %25, label %27, label %26

26:                                               ; preds = %23
  store i32 2, ptr %3, align 4
  br label %116

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

28:                                               ; preds = %99, %27
  %29 = load i32, ptr %4, align 4, !tbaa !8
  %30 = icmp slt i32 %29, 2
  br i1 %30, label %32, label %31

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

32:                                               ; preds = %28
  %33 = load i32, ptr %4, align 4, !tbaa !8
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [2 x i64], ptr @h1, i64 0, i64 %34
  %36 = load i64, ptr %35, align 8, !tbaa !11
  %37 = load i32, ptr %4, align 4, !tbaa !8
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [2 x i64], ptr @pw, i64 0, i64 %38
  %40 = load i64, ptr %39, align 8, !tbaa !11
  %41 = load i32, ptr %2, align 4, !tbaa !8
  %42 = sext i32 %41 to i64
  %43 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef %42)
  %44 = load i8, ptr %43, align 1, !tbaa !13
  %45 = sext i8 %44 to i64
  %46 = mul nsw i64 %40, %45
  %47 = add nsw i64 %36, %46
  %48 = load i32, ptr %4, align 4, !tbaa !8
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [2 x i64], ptr @p, i64 0, i64 %49
  %51 = load i64, ptr %50, align 8, !tbaa !11
  %52 = srem i64 %47, %51
  %53 = load i32, ptr %4, align 4, !tbaa !8
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [2 x i64], ptr @h1, i64 0, i64 %54
  store i64 %52, ptr %55, align 8, !tbaa !11
  %56 = load i32, ptr %4, align 4, !tbaa !8
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds [2 x i64], ptr @h2, i64 0, i64 %57
  %59 = load i64, ptr %58, align 8, !tbaa !11
  %60 = load i32, ptr %4, align 4, !tbaa !8
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [2 x i64], ptr @b, i64 0, i64 %61
  %63 = load i64, ptr %62, align 8, !tbaa !11
  %64 = mul nsw i64 %59, %63
  %65 = load i32, ptr %2, align 4, !tbaa !8
  %66 = sext i32 %65 to i64
  %67 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1tB5cxx11, i64 noundef %66)
  %68 = load i8, ptr %67, align 1, !tbaa !13
  %69 = sext i8 %68 to i64
  %70 = getelementptr inbounds [255 x i32], ptr @r, i64 0, i64 %69
  %71 = load i32, ptr %70, align 4, !tbaa !8
  %72 = sext i32 %71 to i64
  %73 = add nsw i64 %64, %72
  %74 = load i32, ptr %4, align 4, !tbaa !8
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [2 x i64], ptr @p, i64 0, i64 %75
  %77 = load i64, ptr %76, align 8, !tbaa !11
  %78 = srem i64 %73, %77
  %79 = load i32, ptr %4, align 4, !tbaa !8
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [2 x i64], ptr @h2, i64 0, i64 %80
  store i64 %78, ptr %81, align 8, !tbaa !11
  %82 = load i32, ptr %4, align 4, !tbaa !8
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [2 x i64], ptr @pw, i64 0, i64 %83
  %85 = load i64, ptr %84, align 8, !tbaa !11
  %86 = load i32, ptr %4, align 4, !tbaa !8
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [2 x i64], ptr @b, i64 0, i64 %87
  %89 = load i64, ptr %88, align 8, !tbaa !11
  %90 = mul nsw i64 %85, %89
  %91 = load i32, ptr %4, align 4, !tbaa !8
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [2 x i64], ptr @p, i64 0, i64 %92
  %94 = load i64, ptr %93, align 8, !tbaa !11
  %95 = srem i64 %90, %94
  %96 = load i32, ptr %4, align 4, !tbaa !8
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [2 x i64], ptr @pw, i64 0, i64 %97
  store i64 %95, ptr %98, align 8, !tbaa !11
  br label %99

99:                                               ; preds = %32
  %100 = load i32, ptr %4, align 4, !tbaa !8
  %101 = add nsw i32 %100, 1
  store i32 %101, ptr %4, align 4, !tbaa !8
  br label %28, !llvm.loop !14

102:                                              ; preds = %31
  %103 = load i64, ptr @h1, align 16, !tbaa !11
  %104 = load i64, ptr @h2, align 16, !tbaa !11
  %105 = icmp eq i64 %103, %104
  br i1 %105, label %106, label %112

106:                                              ; preds = %102
  %107 = load i64, ptr getelementptr inbounds ([2 x i64], ptr @h1, i64 0, i64 1), align 8, !tbaa !11
  %108 = load i64, ptr getelementptr inbounds ([2 x i64], ptr @h2, i64 0, i64 1), align 8, !tbaa !11
  %109 = icmp eq i64 %107, %108
  br i1 %109, label %110, label %112

110:                                              ; preds = %106
  %111 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %3, align 4
  br label %116

112:                                              ; preds = %106, %102
  br label %113

113:                                              ; preds = %112
  %114 = load i32, ptr %2, align 4, !tbaa !8
  %115 = add nsw i32 %114, -1
  store i32 %115, ptr %2, align 4, !tbaa !8
  br label %23, !llvm.loop !16

116:                                              ; preds = %110, %26
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  %117 = load i32, ptr %3, align 4
  switch i32 %117, label %122 [
    i32 2, label %118
    i32 1, label %120
  ]

118:                                              ; preds = %116
  %119 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.3)
  store i32 0, ptr %1, align 4
  br label %120

120:                                              ; preds = %118, %116
  %121 = load i32, ptr %1, align 4
  ret i32 %121

122:                                              ; preds = %116
  unreachable
}

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) #1

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) #2 align 2

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #1

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) #3

; 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) #2 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long long", !10, i64 0}
!13 = !{!10, !10, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15}


; 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::basic_ostream" = type { ptr, %"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::__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" }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@b = external dso_local local_unnamed_addr global [2 x i64], align 16
@p = external dso_local local_unnamed_addr global [2 x i64], align 16
@h1 = external dso_local local_unnamed_addr global [2 x i64], align 16
@h2 = external dso_local local_unnamed_addr global [2 x i64], align 16
@pw = external dso_local local_unnamed_addr global [2 x i64], align 16
@n = external dso_local global i32, align 4
@_Z1sB5cxx11 = external dso_local global %"class.std::__cxx11::basic_string", align 8
@_Z1tB5cxx11 = external dso_local global %"class.std::__cxx11::basic_string", align 8
@r = external dso_local local_unnamed_addr global [255 x i32], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = external hidden unnamed_addr constant [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %2 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %3 = getelementptr i8, ptr %2, i64 -24
  %4 = load i64, ptr %3, align 8
  %5 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %4
  %6 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %5, ptr noundef null)
  %7 = load ptr, ptr @_ZSt4cout, align 8, !tbaa !5
  %8 = getelementptr i8, ptr %7, i64 -24
  %9 = load i64, ptr %8, align 8
  %10 = getelementptr inbounds i8, ptr @_ZSt4cout, i64 %9
  %11 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %10, ptr noundef null)
  %12 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @n)
  %13 = load i32, ptr @n, align 4, !tbaa !8
  %14 = add nsw i32 %13, -1
  store i32 %14, ptr @n, align 4, !tbaa !8
  %15 = 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)
  %16 = 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) %15, ptr noundef nonnull align 8 dereferenceable(32) @_Z1tB5cxx11)
  store i32 83, ptr getelementptr inbounds (i8, ptr @r, i64 312), align 8, !tbaa !8
  store i32 78, ptr getelementptr inbounds (i8, ptr @r, i64 332), align 4, !tbaa !8
  store i32 87, ptr getelementptr inbounds (i8, ptr @r, i64 276), align 4, !tbaa !8
  store i32 69, ptr getelementptr inbounds (i8, ptr @r, i64 348), align 4, !tbaa !8
  store i64 1, ptr getelementptr inbounds (i8, ptr @pw, i64 8), align 8, !tbaa !11
  store i64 1, ptr @pw, align 16, !tbaa !11
  %17 = load i32, ptr @n, align 4, !tbaa !8
  %18 = icmp sgt i32 %17, 0
  br i1 %18, label %.preheader.preheader, label %._crit_edge

.preheader.preheader:                             ; preds = %0
  %19 = zext nneg i32 %17 to i64
  %.pre = load i64, ptr @h1, align 16, !tbaa !11
  br label %.preheader

.preheader:                                       ; preds = %.preheader.preheader, %75
  %20 = phi i64 [ %.pre, %.preheader.preheader ], [ %70, %75 ]
  %indvars.iv = phi i64 [ %19, %.preheader.preheader ], [ %indvars.iv.next, %75 ]
  %indvars.iv.next = add nsw i64 %indvars.iv, -1
  %21 = load i64, ptr @pw, align 16, !tbaa !11
  %22 = 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.next)
  %23 = load i8, ptr %22, align 1, !tbaa !13
  %24 = sext i8 %23 to i64
  %25 = mul nsw i64 %21, %24
  %26 = add nsw i64 %25, %20
  %27 = load i64, ptr @p, align 16, !tbaa !11
  %28 = srem i64 %26, %27
  store i64 %28, ptr @h1, align 16, !tbaa !11
  %29 = load i64, ptr @h2, align 16, !tbaa !11
  %30 = load i64, ptr @b, align 16, !tbaa !11
  %31 = mul nsw i64 %30, %29
  %32 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1tB5cxx11, i64 noundef %indvars.iv.next)
  %33 = load i8, ptr %32, align 1, !tbaa !13
  %34 = sext i8 %33 to i64
  %35 = getelementptr inbounds [255 x i32], ptr @r, i64 0, i64 %34
  %36 = load i32, ptr %35, align 4, !tbaa !8
  %37 = sext i32 %36 to i64
  %38 = add nsw i64 %31, %37
  %39 = load i64, ptr @p, align 16, !tbaa !11
  %40 = srem i64 %38, %39
  store i64 %40, ptr @h2, align 16, !tbaa !11
  %41 = load i64, ptr @pw, align 16, !tbaa !11
  %42 = load i64, ptr @b, align 16, !tbaa !11
  %43 = mul nsw i64 %42, %41
  %44 = srem i64 %43, %39
  store i64 %44, ptr @pw, align 16, !tbaa !11
  %45 = load i64, ptr getelementptr inbounds (i8, ptr @h1, i64 8), align 8, !tbaa !11
  %46 = load i64, ptr getelementptr inbounds (i8, ptr @pw, i64 8), align 8, !tbaa !11
  %47 = 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.next)
  %48 = load i8, ptr %47, align 1, !tbaa !13
  %49 = sext i8 %48 to i64
  %50 = mul nsw i64 %46, %49
  %51 = add nsw i64 %50, %45
  %52 = load i64, ptr getelementptr inbounds (i8, ptr @p, i64 8), align 8, !tbaa !11
  %53 = srem i64 %51, %52
  store i64 %53, ptr getelementptr inbounds (i8, ptr @h1, i64 8), align 8, !tbaa !11
  %54 = load i64, ptr getelementptr inbounds (i8, ptr @h2, i64 8), align 8, !tbaa !11
  %55 = load i64, ptr getelementptr inbounds (i8, ptr @b, i64 8), align 8, !tbaa !11
  %56 = mul nsw i64 %55, %54
  %57 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1tB5cxx11, i64 noundef %indvars.iv.next)
  %58 = load i8, ptr %57, align 1, !tbaa !13
  %59 = sext i8 %58 to i64
  %60 = getelementptr inbounds [255 x i32], ptr @r, i64 0, i64 %59
  %61 = load i32, ptr %60, align 4, !tbaa !8
  %62 = sext i32 %61 to i64
  %63 = add nsw i64 %56, %62
  %64 = load i64, ptr getelementptr inbounds (i8, ptr @p, i64 8), align 8, !tbaa !11
  %65 = srem i64 %63, %64
  store i64 %65, ptr getelementptr inbounds (i8, ptr @h2, i64 8), align 8, !tbaa !11
  %66 = load i64, ptr getelementptr inbounds (i8, ptr @pw, i64 8), align 8, !tbaa !11
  %67 = load i64, ptr getelementptr inbounds (i8, ptr @b, i64 8), align 8, !tbaa !11
  %68 = mul nsw i64 %67, %66
  %69 = srem i64 %68, %64
  store i64 %69, ptr getelementptr inbounds (i8, ptr @pw, i64 8), align 8, !tbaa !11
  %70 = load i64, ptr @h1, align 16, !tbaa !11
  %71 = load i64, ptr @h2, align 16, !tbaa !11
  %72 = icmp eq i64 %70, %71
  %73 = load i64, ptr getelementptr inbounds (i8, ptr @h1, i64 8), align 8
  %74 = icmp eq i64 %73, %65
  %or.cond = select i1 %72, i1 %74, i1 false
  br i1 %or.cond, label %._crit_edge, label %75

75:                                               ; preds = %.preheader
  %76 = icmp ugt i64 %indvars.iv, 1
  br i1 %76, label %.preheader, label %._crit_edge, !llvm.loop !14

._crit_edge:                                      ; preds = %75, %.preheader, %0
  %.str.sink = phi ptr [ @.str.3, %0 ], [ @.str, %.preheader ], [ @.str.3, %75 ]
  %77 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull %.str.sink)
  ret i32 0
}

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) local_unnamed_addr #1

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1

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

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

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

!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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long long", !10, i64 0}
!13 = !{!10, !10, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}


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