; LLVM IR from abeaumont/competitive-programming :: atcoder/abc084 (d)

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

@primes = external dso_local global [100001 x i8], align 16
@similar = external dso_local global [100001 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
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  store i32 2, ptr %2, align 4, !tbaa !5
  br label %11

11:                                               ; preds = %19, %0
  %12 = load i32, ptr %2, align 4, !tbaa !5
  %13 = icmp sle i32 %12, 100000
  br i1 %13, label %15, label %14

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

15:                                               ; preds = %11
  %16 = load i32, ptr %2, align 4, !tbaa !5
  %17 = sext i32 %16 to i64
  %18 = getelementptr inbounds [100001 x i8], ptr @primes, i64 0, i64 %17
  store i8 1, ptr %18, align 1, !tbaa !9
  br label %19

19:                                               ; preds = %15
  %20 = load i32, ptr %2, align 4, !tbaa !5
  %21 = add nsw i32 %20, 1
  store i32 %21, ptr %2, align 4, !tbaa !5
  br label %11, !llvm.loop !11

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

23:                                               ; preds = %52, %22
  %24 = load i32, ptr %3, align 4, !tbaa !5
  %25 = load i32, ptr %3, align 4, !tbaa !5
  %26 = mul nsw i32 %24, %25
  %27 = icmp sle i32 %26, 100000
  br i1 %27, label %29, label %28

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

29:                                               ; preds = %23
  %30 = load i32, ptr %3, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [100001 x i8], ptr @primes, i64 0, i64 %31
  %33 = load i8, ptr %32, align 1, !tbaa !9, !range !13, !noundef !14
  %34 = trunc i8 %33 to i1
  br i1 %34, label %35, label %51

35:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  %36 = load i32, ptr %3, align 4, !tbaa !5
  %37 = mul nsw i32 %36, 2
  store i32 %37, ptr %5, align 4, !tbaa !5
  br label %38

38:                                               ; preds = %46, %35
  %39 = load i32, ptr %5, align 4, !tbaa !5
  %40 = icmp sle i32 %39, 100000
  br i1 %40, label %42, label %41

41:                                               ; preds = %38
  store i32 8, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br label %50

42:                                               ; preds = %38
  %43 = load i32, ptr %5, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [100001 x i8], ptr @primes, i64 0, i64 %44
  store i8 0, ptr %45, align 1, !tbaa !9
  br label %46

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

50:                                               ; preds = %41
  br label %51

51:                                               ; preds = %50, %29
  br label %52

52:                                               ; preds = %51
  %53 = load i32, ptr %3, align 4, !tbaa !5
  %54 = add nsw i32 %53, 1
  store i32 %54, ptr %3, align 4, !tbaa !5
  br label %23, !llvm.loop !16

55:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 1, ptr %6, align 4, !tbaa !5
  br label %56

56:                                               ; preds = %81, %55
  %57 = load i32, ptr %6, align 4, !tbaa !5
  %58 = icmp sle i32 %57, 100000
  br i1 %58, label %60, label %59

59:                                               ; preds = %56
  store i32 11, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %84

60:                                               ; preds = %56
  %61 = load i32, ptr %6, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [100001 x i8], ptr @primes, i64 0, i64 %62
  %64 = load i8, ptr %63, align 1, !tbaa !9, !range !13, !noundef !14
  %65 = trunc i8 %64 to i1
  br i1 %65, label %66, label %80

66:                                               ; preds = %60
  %67 = load i32, ptr %6, align 4, !tbaa !5
  %68 = add nsw i32 %67, 1
  %69 = sdiv i32 %68, 2
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [100001 x i8], ptr @primes, i64 0, i64 %70
  %72 = load i8, ptr %71, align 1, !tbaa !9, !range !13, !noundef !14
  %73 = trunc i8 %72 to i1
  br i1 %73, label %74, label %80

74:                                               ; preds = %66
  %75 = load i32, ptr %6, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [100001 x i32], ptr @similar, i64 0, i64 %76
  %78 = load i32, ptr %77, align 4, !tbaa !5
  %79 = add nsw i32 %78, 1
  store i32 %79, ptr %77, align 4, !tbaa !5
  br label %80

80:                                               ; preds = %74, %66, %60
  br label %81

81:                                               ; preds = %80
  %82 = load i32, ptr %6, align 4, !tbaa !5
  %83 = add nsw i32 %82, 1
  store i32 %83, ptr %6, align 4, !tbaa !5
  br label %56, !llvm.loop !17

84:                                               ; preds = %59
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store i32 1, ptr %7, align 4, !tbaa !5
  br label %85

85:                                               ; preds = %100, %84
  %86 = load i32, ptr %7, align 4, !tbaa !5
  %87 = icmp sle i32 %86, 100000
  br i1 %87, label %89, label %88

88:                                               ; preds = %85
  store i32 14, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %103

89:                                               ; preds = %85
  %90 = load i32, ptr %7, align 4, !tbaa !5
  %91 = sub nsw i32 %90, 1
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [100001 x i32], ptr @similar, i64 0, i64 %92
  %94 = load i32, ptr %93, align 4, !tbaa !5
  %95 = load i32, ptr %7, align 4, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [100001 x i32], ptr @similar, i64 0, i64 %96
  %98 = load i32, ptr %97, align 4, !tbaa !5
  %99 = add nsw i32 %98, %94
  store i32 %99, ptr %97, align 4, !tbaa !5
  br label %100

100:                                              ; preds = %89
  %101 = load i32, ptr %7, align 4, !tbaa !5
  %102 = add nsw i32 %101, 1
  store i32 %102, ptr %7, align 4, !tbaa !5
  br label %85, !llvm.loop !18

103:                                              ; preds = %88
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %104 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %8)
  br label %105

105:                                              ; preds = %109, %103
  %106 = load i32, ptr %8, align 4, !tbaa !5
  %107 = add nsw i32 %106, -1
  store i32 %107, ptr %8, align 4, !tbaa !5
  %108 = icmp ne i32 %106, 0
  br i1 %108, label %109, label %124

109:                                              ; preds = %105
  %110 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %9)
  %111 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %110, ptr noundef nonnull align 4 dereferenceable(4) %10)
  %112 = load i32, ptr %10, align 4, !tbaa !5
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds [100001 x i32], ptr @similar, i64 0, i64 %113
  %115 = load i32, ptr %114, align 4, !tbaa !5
  %116 = load i32, ptr %9, align 4, !tbaa !5
  %117 = sub nsw i32 %116, 1
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [100001 x i32], ptr @similar, i64 0, i64 %118
  %120 = load i32, ptr %119, align 4, !tbaa !5
  %121 = sub nsw i32 %115, %120
  %122 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %121)
  %123 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %122, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %105, !llvm.loop !19

124:                                              ; preds = %105
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  %125 = load i32, ptr %1, align 4
  ret i32 %125
}

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

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

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

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 = !{!10, !10, i64 0}
!10 = !{!"bool", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{i8 0, i8 2}
!14 = !{}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}


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

@primes = external dso_local local_unnamed_addr global [100001 x i8], align 16
@similar = external dso_local local_unnamed_addr global [100001 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 {
.preheader27.preheader:
  %0 = alloca i32, align 4
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 2 dereferenceable(99999) getelementptr inbounds (i8, ptr @primes, i64 2), i8 1, i64 99999, i1 false), !tbaa !5
  br label %.preheader27

.preheader27:                                     ; preds = %.loopexit.1, %.preheader27.preheader
  %indvars.iv37 = phi i64 [ 2, %.preheader27.preheader ], [ %indvars.iv.next38.1, %.loopexit.1 ]
  %indvars.iv = phi i64 [ 4, %.preheader27.preheader ], [ %indvars.iv.next.1, %.loopexit.1 ]
  %3 = getelementptr inbounds [100001 x i8], ptr @primes, i64 0, i64 %indvars.iv37
  %4 = load i8, ptr %3, align 2, !tbaa !5, !range !9, !noundef !10
  %5 = trunc nuw i8 %4 to i1
  br i1 %5, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %.preheader27, %.lr.ph
  %indvars.iv39 = phi i64 [ %indvars.iv.next40, %.lr.ph ], [ %indvars.iv, %.preheader27 ]
  %6 = getelementptr inbounds [100001 x i8], ptr @primes, i64 0, i64 %indvars.iv39
  store i8 0, ptr %6, align 2, !tbaa !5
  %indvars.iv.next40 = add nuw nsw i64 %indvars.iv39, %indvars.iv37
  %7 = icmp ult i64 %indvars.iv.next40, 100001
  br i1 %7, label %.lr.ph, label %.loopexit, !llvm.loop !11

.loopexit:                                        ; preds = %.lr.ph, %.preheader27
  %indvars.iv.next38 = or disjoint i64 %indvars.iv37, 1
  %indvars.iv.next = or disjoint i64 %indvars.iv, 2
  %exitcond.not = icmp eq i64 %indvars.iv37, 316
  br i1 %exitcond.not, label %.preheader26, label %.preheader27.1, !llvm.loop !13

.preheader27.1:                                   ; preds = %.loopexit
  %8 = getelementptr inbounds [100001 x i8], ptr @primes, i64 0, i64 %indvars.iv.next38
  %9 = load i8, ptr %8, align 1, !tbaa !5, !range !9, !noundef !10
  %10 = trunc nuw i8 %9 to i1
  br i1 %10, label %.lr.ph.1, label %.loopexit.1

.lr.ph.1:                                         ; preds = %.preheader27.1, %.lr.ph.1
  %indvars.iv39.1 = phi i64 [ %indvars.iv.next40.1, %.lr.ph.1 ], [ %indvars.iv.next, %.preheader27.1 ]
  %11 = getelementptr inbounds [100001 x i8], ptr @primes, i64 0, i64 %indvars.iv39.1
  store i8 0, ptr %11, align 1, !tbaa !5
  %indvars.iv.next40.1 = add nuw nsw i64 %indvars.iv39.1, %indvars.iv.next38
  %12 = icmp ult i64 %indvars.iv.next40.1, 100001
  br i1 %12, label %.lr.ph.1, label %.loopexit.1, !llvm.loop !11

.loopexit.1:                                      ; preds = %.lr.ph.1, %.preheader27.1
  %indvars.iv.next38.1 = add nuw nsw i64 %indvars.iv37, 2
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 4
  br label %.preheader27

.preheader26:                                     ; preds = %.loopexit, %.preheader26._crit_edge.1
  %indvars.iv43 = phi i64 [ %29, %.preheader26._crit_edge.1 ], [ 1, %.loopexit ]
  %13 = getelementptr inbounds [100001 x i8], ptr @primes, i64 0, i64 %indvars.iv43
  %14 = load i8, ptr %13, align 1, !tbaa !5, !range !9, !noundef !10
  %15 = trunc nuw i8 %14 to i1
  %16 = add nuw nsw i64 %indvars.iv43, 1
  br i1 %15, label %17, label %.preheader26._crit_edge

17:                                               ; preds = %.preheader26
  %18 = lshr i64 %16, 1
  %19 = getelementptr inbounds [100001 x i8], ptr @primes, i64 0, i64 %18
  %20 = load i8, ptr %19, align 1, !tbaa !5, !range !9, !noundef !10
  %21 = trunc nuw i8 %20 to i1
  br i1 %21, label %22, label %.preheader26._crit_edge

22:                                               ; preds = %17
  %23 = getelementptr inbounds [100001 x i32], ptr @similar, i64 0, i64 %indvars.iv43
  %24 = load i32, ptr %23, align 4, !tbaa !14
  %25 = add nsw i32 %24, 1
  store i32 %25, ptr %23, align 4, !tbaa !14
  br label %.preheader26._crit_edge

.preheader26._crit_edge:                          ; preds = %.preheader26, %17, %22
  %26 = getelementptr inbounds [100001 x i8], ptr @primes, i64 0, i64 %16
  %27 = load i8, ptr %26, align 1, !tbaa !5, !range !9, !noundef !10
  %28 = trunc nuw i8 %27 to i1
  %29 = add nuw nsw i64 %indvars.iv43, 2
  br i1 %28, label %30, label %.preheader26._crit_edge.1

30:                                               ; preds = %.preheader26._crit_edge
  %31 = lshr i64 %16, 1
  %32 = getelementptr inbounds [100001 x i8], ptr @primes, i64 0, i64 %31
  %33 = load i8, ptr %32, align 1, !tbaa !5, !range !9, !noundef !10
  %34 = trunc nuw i8 %33 to i1
  br i1 %34, label %35, label %.preheader26._crit_edge.1

35:                                               ; preds = %30
  %36 = getelementptr inbounds [100001 x i32], ptr @similar, i64 0, i64 %16
  %37 = load i32, ptr %36, align 4, !tbaa !14
  %38 = add nsw i32 %37, 1
  store i32 %38, ptr %36, align 4, !tbaa !14
  br label %.preheader26._crit_edge.1

.preheader26._crit_edge.1:                        ; preds = %35, %30, %.preheader26._crit_edge
  %exitcond46.not.1 = icmp eq i64 %29, 100001
  br i1 %exitcond46.not.1, label %.preheader.preheader, label %.preheader26, !llvm.loop !16

.preheader.preheader:                             ; preds = %.preheader26._crit_edge.1
  %.pre = load i32, ptr @similar, align 16, !tbaa !14
  br label %.preheader

39:                                               ; preds = %.preheader
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %0) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  %40 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %0)
  %41 = load i32, ptr %0, align 4, !tbaa !14
  %42 = add nsw i32 %41, -1
  store i32 %42, ptr %0, align 4, !tbaa !14
  %.not33 = icmp eq i32 %41, 0
  br i1 %.not33, label %._crit_edge, label %.lr.ph34

.preheader:                                       ; preds = %.preheader, %.preheader.preheader
  %43 = phi i32 [ %.pre, %.preheader.preheader ], [ %58, %.preheader ]
  %indvars.iv47 = phi i64 [ 1, %.preheader.preheader ], [ %indvars.iv.next48.4, %.preheader ]
  %44 = getelementptr inbounds [100001 x i32], ptr @similar, i64 0, i64 %indvars.iv47
  %45 = load i32, ptr %44, align 4, !tbaa !14
  %46 = add nsw i32 %45, %43
  store i32 %46, ptr %44, align 4, !tbaa !14
  %indvars.iv.next48 = add nuw nsw i64 %indvars.iv47, 1
  %47 = getelementptr inbounds [100001 x i32], ptr @similar, i64 0, i64 %indvars.iv.next48
  %48 = load i32, ptr %47, align 4, !tbaa !14
  %49 = add nsw i32 %48, %46
  store i32 %49, ptr %47, align 4, !tbaa !14
  %indvars.iv.next48.1 = add nuw nsw i64 %indvars.iv47, 2
  %50 = getelementptr inbounds [100001 x i32], ptr @similar, i64 0, i64 %indvars.iv.next48.1
  %51 = load i32, ptr %50, align 4, !tbaa !14
  %52 = add nsw i32 %51, %49
  store i32 %52, ptr %50, align 4, !tbaa !14
  %indvars.iv.next48.2 = add nuw nsw i64 %indvars.iv47, 3
  %53 = getelementptr inbounds [100001 x i32], ptr @similar, i64 0, i64 %indvars.iv.next48.2
  %54 = load i32, ptr %53, align 4, !tbaa !14
  %55 = add nsw i32 %54, %52
  store i32 %55, ptr %53, align 4, !tbaa !14
  %indvars.iv.next48.3 = add nuw nsw i64 %indvars.iv47, 4
  %56 = getelementptr inbounds [100001 x i32], ptr @similar, i64 0, i64 %indvars.iv.next48.3
  %57 = load i32, ptr %56, align 4, !tbaa !14
  %58 = add nsw i32 %57, %55
  store i32 %58, ptr %56, align 4, !tbaa !14
  %indvars.iv.next48.4 = add nuw nsw i64 %indvars.iv47, 5
  %exitcond50.not.4 = icmp eq i64 %indvars.iv.next48.4, 100001
  br i1 %exitcond50.not.4, label %39, label %.preheader, !llvm.loop !17

.lr.ph34:                                         ; preds = %39, %.lr.ph34
  %59 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %60 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %59, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %61 = load i32, ptr %2, align 4, !tbaa !14
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [100001 x i32], ptr @similar, i64 0, i64 %62
  %64 = load i32, ptr %63, align 4, !tbaa !14
  %65 = load i32, ptr %1, align 4, !tbaa !14
  %66 = add nsw i32 %65, -1
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [100001 x i32], ptr @similar, i64 0, i64 %67
  %69 = load i32, ptr %68, align 4, !tbaa !14
  %70 = sub nsw i32 %64, %69
  %71 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %70)
  %72 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %71, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %73 = load i32, ptr %0, align 4, !tbaa !14
  %74 = add nsw i32 %73, -1
  store i32 %74, ptr %0, align 4, !tbaa !14
  %.not = icmp eq i32 %73, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph34, !llvm.loop !18

._crit_edge:                                      ; preds = %.lr.ph34, %39
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %0) #6
  ret i32 0
}

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

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

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

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

; 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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 = !{!"bool", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{i8 0, i8 2}
!10 = !{}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = !{!15, !15, i64 0}
!15 = !{!"int", !7, i64 0}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}


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