; LLVM IR from kazunetakahashi/atcoder :: 201510_201609/0131 (ABC032_C)

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

@s = external dso_local global [100010 x i64], 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 i64, align 8
  %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 i64, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #6
  %13 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %14 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %13, ptr noundef nonnull align 8 dereferenceable(8) %3)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %15

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

19:                                               ; preds = %15
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  br label %28

20:                                               ; preds = %15
  %21 = load i32, ptr %4, align 4, !tbaa !5
  %22 = sext i32 %21 to i64
  %23 = getelementptr inbounds [100010 x i64], ptr @s, i64 0, i64 %22
  %24 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %23)
  br label %25

25:                                               ; preds = %20
  %26 = load i32, ptr %4, align 4, !tbaa !5
  %27 = add nsw i32 %26, 1
  store i32 %27, ptr %4, align 4, !tbaa !5
  br label %15, !llvm.loop !9

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

29:                                               ; preds = %45, %28
  %30 = load i32, ptr %5, align 4, !tbaa !5
  %31 = load i32, ptr %2, align 4, !tbaa !5
  %32 = icmp slt i32 %30, %31
  br i1 %32, label %34, label %33

33:                                               ; preds = %29
  store i32 5, ptr %6, align 4
  br label %48

34:                                               ; preds = %29
  %35 = load i32, ptr %5, align 4, !tbaa !5
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [100010 x i64], ptr @s, i64 0, i64 %36
  %38 = load i64, ptr %37, align 8, !tbaa !11
  %39 = icmp eq i64 %38, 0
  br i1 %39, label %40, label %44

40:                                               ; preds = %34
  %41 = load i32, ptr %2, align 4, !tbaa !5
  %42 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %41)
  %43 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %42, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %6, align 4
  br label %48

44:                                               ; preds = %34
  br label %45

45:                                               ; preds = %44
  %46 = load i32, ptr %5, align 4, !tbaa !5
  %47 = add nsw i32 %46, 1
  store i32 %47, ptr %5, align 4, !tbaa !5
  br label %29, !llvm.loop !13

48:                                               ; preds = %40, %33
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  %49 = load i32, ptr %6, align 4
  switch i32 %49, label %124 [
    i32 5, label %50
  ]

50:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 0, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 0, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  store i64 1, ptr %9, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %51

51:                                               ; preds = %119, %86, %50
  %52 = load i32, ptr %8, align 4, !tbaa !5
  %53 = load i32, ptr %2, align 4, !tbaa !5
  %54 = icmp slt i32 %52, %53
  br i1 %54, label %55, label %120

55:                                               ; preds = %51
  %56 = load i32, ptr %7, align 4, !tbaa !5
  %57 = load i32, ptr %8, align 4, !tbaa !5
  %58 = icmp slt i32 %56, %57
  br i1 %58, label %59, label %69

59:                                               ; preds = %55
  %60 = load i64, ptr %9, align 8, !tbaa !11
  %61 = load i64, ptr %3, align 8, !tbaa !11
  %62 = icmp sle i64 %60, %61
  br i1 %62, label %63, label %69

63:                                               ; preds = %59
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  %64 = load i32, ptr %8, align 4, !tbaa !5
  %65 = load i32, ptr %7, align 4, !tbaa !5
  %66 = sub nsw i32 %64, %65
  store i32 %66, ptr %11, align 4, !tbaa !5
  %67 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %10, ptr noundef nonnull align 4 dereferenceable(4) %11)
  %68 = load i32, ptr %67, align 4, !tbaa !5
  store i32 %68, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %69

69:                                               ; preds = %63, %59, %55
  %70 = load i32, ptr %7, align 4, !tbaa !5
  %71 = load i32, ptr %8, align 4, !tbaa !5
  %72 = icmp eq i32 %70, %71
  br i1 %72, label %73, label %82

73:                                               ; preds = %69
  %74 = load i32, ptr %8, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [100010 x i64], ptr @s, i64 0, i64 %75
  %77 = load i64, ptr %76, align 8, !tbaa !11
  %78 = load i64, ptr %9, align 8, !tbaa !11
  %79 = mul nsw i64 %78, %77
  store i64 %79, ptr %9, align 8, !tbaa !11
  %80 = load i32, ptr %8, align 4, !tbaa !5
  %81 = add nsw i32 %80, 1
  store i32 %81, ptr %8, align 4, !tbaa !5
  br label %105

82:                                               ; preds = %69
  %83 = load i64, ptr %9, align 8, !tbaa !11
  %84 = load i64, ptr %3, align 8, !tbaa !11
  %85 = icmp sgt i64 %83, %84
  br i1 %85, label %86, label %95

86:                                               ; preds = %82
  %87 = load i32, ptr %7, align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [100010 x i64], ptr @s, i64 0, i64 %88
  %90 = load i64, ptr %89, align 8, !tbaa !11
  %91 = load i64, ptr %9, align 8, !tbaa !11
  %92 = sdiv i64 %91, %90
  store i64 %92, ptr %9, align 8, !tbaa !11
  %93 = load i32, ptr %7, align 4, !tbaa !5
  %94 = add nsw i32 %93, 1
  store i32 %94, ptr %7, align 4, !tbaa !5
  br label %51, !llvm.loop !14

95:                                               ; preds = %82
  %96 = load i32, ptr %8, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [100010 x i64], ptr @s, i64 0, i64 %97
  %99 = load i64, ptr %98, align 8, !tbaa !11
  %100 = load i64, ptr %9, align 8, !tbaa !11
  %101 = mul nsw i64 %100, %99
  store i64 %101, ptr %9, align 8, !tbaa !11
  %102 = load i32, ptr %8, align 4, !tbaa !5
  %103 = add nsw i32 %102, 1
  store i32 %103, ptr %8, align 4, !tbaa !5
  br label %104

104:                                              ; preds = %95
  br label %105

105:                                              ; preds = %104, %73
  %106 = load i32, ptr %7, align 4, !tbaa !5
  %107 = load i32, ptr %8, align 4, !tbaa !5
  %108 = icmp slt i32 %106, %107
  br i1 %108, label %109, label %119

109:                                              ; preds = %105
  %110 = load i64, ptr %9, align 8, !tbaa !11
  %111 = load i64, ptr %3, align 8, !tbaa !11
  %112 = icmp sle i64 %110, %111
  br i1 %112, label %113, label %119

113:                                              ; preds = %109
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  %114 = load i32, ptr %8, align 4, !tbaa !5
  %115 = load i32, ptr %7, align 4, !tbaa !5
  %116 = sub nsw i32 %114, %115
  store i32 %116, ptr %12, align 4, !tbaa !5
  %117 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %10, ptr noundef nonnull align 4 dereferenceable(4) %12)
  %118 = load i32, ptr %117, align 4, !tbaa !5
  store i32 %118, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %119

119:                                              ; preds = %113, %109, %105
  br label %51, !llvm.loop !14

120:                                              ; preds = %51
  %121 = load i32, ptr %10, align 4, !tbaa !5
  %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_)
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  store i32 0, ptr %6, align 4
  br label %124

124:                                              ; preds = %120, %48
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  %125 = load i32, ptr %6, align 4
  switch i32 %125, label %128 [
    i32 0, label %126
    i32 1, label %126
  ]

126:                                              ; preds = %124, %124
  %127 = load i32, ptr %1, align 4
  ret i32 %127

128:                                              ; preds = %124
  unreachable
}

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #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 = { 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 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"long long", !7, i64 0}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"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" }

@s = external dso_local global [100010 x i64], 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 = alloca i32, align 4
  %2 = alloca i64, align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #6
  %6 = 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)
  %7 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %6, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %8 = load i32, ptr %1, align 4, !tbaa !5
  %9 = icmp sgt i32 %8, 0
  br i1 %9, label %.lr.ph, label %.critedge.thread

.preheader:                                       ; preds = %.lr.ph
  %.not49 = icmp sgt i32 %12, 0
  br i1 %.not49, label %.lr.ph51.preheader, label %.critedge.thread

.lr.ph51.preheader:                               ; preds = %.preheader
  %wide.trip.count = zext nneg i32 %12 to i64
  br label %.lr.ph51

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %10 = getelementptr inbounds [100010 x i64], ptr @s, i64 0, i64 %indvars.iv
  %11 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %10)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %12 = load i32, ptr %1, align 4, !tbaa !5
  %13 = sext i32 %12 to i64
  %14 = icmp slt i64 %indvars.iv.next, %13
  br i1 %14, label %.lr.ph, label %.preheader, !llvm.loop !9

15:                                               ; preds = %.lr.ph51
  %indvars.iv.next64 = add nuw nsw i64 %indvars.iv63, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next64, %wide.trip.count
  br i1 %exitcond.not, label %.critedge, label %.lr.ph51, !llvm.loop !11

.lr.ph51:                                         ; preds = %.lr.ph51.preheader, %15
  %indvars.iv63 = phi i64 [ 0, %.lr.ph51.preheader ], [ %indvars.iv.next64, %15 ]
  %16 = getelementptr inbounds [100010 x i64], ptr @s, i64 0, i64 %indvars.iv63
  %17 = load i64, ptr %16, align 8, !tbaa !12
  %18 = icmp eq i64 %17, 0
  br i1 %18, label %19, label %15

19:                                               ; preds = %.lr.ph51
  %20 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %12)
  %21 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %20, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %58

.critedge.thread:                                 ; preds = %.preheader, %0
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %.outer._crit_edge

.critedge:                                        ; preds = %15
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  store i32 0, ptr %3, align 4, !tbaa !5
  br i1 %.not49, label %.lr.ph54, label %.outer._crit_edge

.lr.ph54:                                         ; preds = %.critedge, %.outer
  %22 = phi i32 [ %34, %.outer ], [ 0, %.critedge ]
  %indvars.iv69 = phi i64 [ %indvars.iv.next70, %.outer ], [ 0, %.critedge ]
  %.0.ph57 = phi i64 [ %41, %.outer ], [ 1, %.critedge ]
  %.031.ph56 = phi i64 [ %indvars.iv66, %.outer ], [ 0, %.critedge ]
  %sext = shl i64 %.031.ph56, 32
  %23 = ashr exact i64 %sext, 32
  br label %24

24:                                               ; preds = %.lr.ph54, %50
  %25 = phi i32 [ %22, %.lr.ph54 ], [ %51, %50 ]
  %indvars.iv66 = phi i64 [ %23, %.lr.ph54 ], [ %indvars.iv.next67, %50 ]
  %.053 = phi i64 [ %.0.ph57, %.lr.ph54 ], [ %.1, %50 ]
  %26 = icmp sge i64 %indvars.iv69, %indvars.iv66
  %27 = load i64, ptr %2, align 8
  %.not39 = icmp sgt i64 %.053, %27
  %or.cond = select i1 %26, i1 true, i1 %.not39
  br i1 %or.cond, label %33, label %28

28:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #6
  %29 = sub nsw i64 %indvars.iv66, %indvars.iv69
  %30 = trunc nsw i64 %29 to i32
  store i32 %30, ptr %4, align 4, !tbaa !5
  %31 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %32 = load i32, ptr %31, align 4, !tbaa !5
  store i32 %32, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  %.pre = load i64, ptr %2, align 8
  br label %33

33:                                               ; preds = %28, %24
  %34 = phi i32 [ %32, %28 ], [ %25, %24 ]
  %35 = phi i64 [ %.pre, %28 ], [ %27, %24 ]
  %36 = icmp ne i64 %indvars.iv66, %indvars.iv69
  %37 = icmp sgt i64 %.053, %35
  %or.cond45 = select i1 %36, i1 %37, i1 false
  br i1 %or.cond45, label %.outer, label %44

.outer:                                           ; preds = %33
  %38 = trunc nsw i64 %indvars.iv66 to i32
  %39 = getelementptr inbounds [100010 x i64], ptr @s, i64 0, i64 %indvars.iv69
  %40 = load i64, ptr %39, align 8, !tbaa !12
  %41 = sdiv i64 %.053, %40
  %indvars.iv.next70 = add nuw nsw i64 %indvars.iv69, 1
  %42 = load i32, ptr %1, align 4, !tbaa !5
  %43 = icmp sgt i32 %42, %38
  br i1 %43, label %.lr.ph54, label %.outer._crit_edge, !llvm.loop !14

44:                                               ; preds = %33
  %.pn.in = getelementptr inbounds [100010 x i64], ptr @s, i64 0, i64 %indvars.iv66
  %.pn = load i64, ptr %.pn.in, align 8, !tbaa !12
  %.1 = mul nsw i64 %.pn, %.053
  %indvars.iv.next67 = add nsw i64 %indvars.iv66, 1
  %.not41 = icmp sgt i64 %indvars.iv69, %indvars.iv66
  %.not42 = icmp sgt i64 %.1, %35
  %or.cond43 = select i1 %.not41, i1 true, i1 %.not42
  br i1 %or.cond43, label %50, label %45

45:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #6
  %46 = sub nsw i64 %indvars.iv.next67, %indvars.iv69
  %47 = trunc nsw i64 %46 to i32
  store i32 %47, ptr %5, align 4, !tbaa !5
  %48 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %49 = load i32, ptr %48, align 4, !tbaa !5
  store i32 %49, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #6
  br label %50

50:                                               ; preds = %45, %44
  %51 = phi i32 [ %49, %45 ], [ %34, %44 ]
  %52 = load i32, ptr %1, align 4, !tbaa !5
  %53 = sext i32 %52 to i64
  %54 = icmp slt i64 %indvars.iv.next67, %53
  br i1 %54, label %24, label %.outer._crit_edge, !llvm.loop !14

.outer._crit_edge:                                ; preds = %.outer, %50, %.critedge.thread, %.critedge
  %55 = phi i32 [ 0, %.critedge ], [ 0, %.critedge.thread ], [ %51, %50 ], [ %34, %.outer ]
  %56 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %55)
  %57 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %56, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  br label %58

58:                                               ; preds = %19, %.outer._crit_edge
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #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

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

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

; 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(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: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #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 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 = 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: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass