; LLVM IR from kazunetakahashi/atcoder :: 201610_12/1112_AGC007 (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" }

@N = external dso_local global i32, align 4
@E = external dso_local global i64, align 8
@T = external dso_local global i64, align 8
@x = external dso_local global [100010 x i64], align 16
@memo = external dso_local global [100010 x i64], align 16
@ret = external dso_local global [100010 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 i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  %7 = 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)
  %8 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %7, ptr noundef nonnull align 8 dereferenceable(8) @E)
  %9 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %8, ptr noundef nonnull align 8 dereferenceable(8) @T)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %10

10:                                               ; preds = %20, %0
  %11 = load i32, ptr %2, align 4, !tbaa !5
  %12 = load i32, ptr @N, align 4, !tbaa !5
  %13 = icmp slt i32 %11, %12
  br i1 %13, label %15, label %14

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

15:                                               ; preds = %10
  %16 = load i32, ptr %2, align 4, !tbaa !5
  %17 = sext i32 %16 to i64
  %18 = getelementptr inbounds [100010 x i64], ptr @x, i64 0, i64 %17
  %19 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %18)
  br label %20

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

23:                                               ; preds = %14
  %24 = load i64, ptr @x, align 16, !tbaa !11
  %25 = load i64, ptr @T, align 8, !tbaa !11
  %26 = add nsw i64 %24, %25
  store i64 %26, ptr @memo, align 16, !tbaa !11
  store i32 -1, ptr @ret, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %27

27:                                               ; preds = %142, %23
  %28 = load i32, ptr %3, align 4, !tbaa !5
  %29 = load i32, ptr @N, align 4, !tbaa !5
  %30 = icmp slt i32 %28, %29
  br i1 %30, label %32, label %31

31:                                               ; preds = %27
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  br label %145

32:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #5
  %33 = load i32, ptr %3, align 4, !tbaa !5
  %34 = sub nsw i32 %33, 1
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [100010 x i64], ptr @memo, i64 0, i64 %35
  %37 = load i64, ptr %36, align 8, !tbaa !11
  %38 = load i32, ptr %3, align 4, !tbaa !5
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds [100010 x i64], ptr @x, i64 0, i64 %39
  %41 = load i64, ptr %40, align 8, !tbaa !11
  %42 = load i32, ptr %3, align 4, !tbaa !5
  %43 = sub nsw i32 %42, 1
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [100010 x i64], ptr @x, i64 0, i64 %44
  %46 = load i64, ptr %45, align 8, !tbaa !11
  %47 = sub nsw i64 %41, %46
  %48 = add nsw i64 %37, %47
  %49 = load i64, ptr @T, align 8, !tbaa !11
  %50 = add nsw i64 %48, %49
  store i64 %50, ptr %4, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  %51 = load i32, ptr %3, align 4, !tbaa !5
  %52 = sub nsw i32 %51, 1
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [100010 x i32], ptr @ret, i64 0, i64 %53
  %55 = load i32, ptr %54, align 4, !tbaa !5
  %56 = icmp eq i32 %55, -1
  br i1 %56, label %57, label %62

57:                                               ; preds = %32
  %58 = load i32, ptr %3, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [100010 x i64], ptr @x, i64 0, i64 %59
  %61 = load i64, ptr %60, align 8, !tbaa !11
  store i64 %61, ptr %5, align 8, !tbaa !11
  br label %85

62:                                               ; preds = %32
  %63 = load i32, ptr %3, align 4, !tbaa !5
  %64 = sub nsw i32 %63, 1
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [100010 x i32], ptr @ret, i64 0, i64 %65
  %67 = load i32, ptr %66, align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [100010 x i64], ptr @memo, i64 0, i64 %68
  %70 = load i64, ptr %69, align 8, !tbaa !11
  %71 = load i32, ptr %3, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [100010 x i64], ptr @x, i64 0, i64 %72
  %74 = load i64, ptr %73, align 8, !tbaa !11
  %75 = load i32, ptr %3, align 4, !tbaa !5
  %76 = sub nsw i32 %75, 1
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [100010 x i32], ptr @ret, i64 0, i64 %77
  %79 = load i32, ptr %78, align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [100010 x i64], ptr @x, i64 0, i64 %80
  %82 = load i64, ptr %81, align 8, !tbaa !11
  %83 = sub nsw i64 %74, %82
  %84 = add nsw i64 %70, %83
  store i64 %84, ptr %5, align 8, !tbaa !11
  br label %85

85:                                               ; preds = %62, %57
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %86 = load i32, ptr %3, align 4, !tbaa !5
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [100010 x i64], ptr @x, i64 0, i64 %87
  %89 = load i64, ptr %88, align 8, !tbaa !11
  %90 = load i32, ptr %3, align 4, !tbaa !5
  %91 = sub nsw i32 %90, 1
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [100010 x i32], ptr @ret, i64 0, i64 %92
  %94 = load i32, ptr %93, align 4, !tbaa !5
  %95 = add nsw i32 %94, 1
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [100010 x i64], ptr @x, i64 0, i64 %96
  %98 = load i64, ptr %97, align 8, !tbaa !11
  %99 = sub nsw i64 %89, %98
  store i64 %99, ptr %6, align 8, !tbaa !11
  %100 = load i64, ptr %6, align 8, !tbaa !11
  %101 = mul nsw i64 2, %100
  %102 = load i64, ptr @T, align 8, !tbaa !11
  %103 = icmp slt i64 %101, %102
  br i1 %103, label %104, label %111

104:                                              ; preds = %85
  %105 = load i64, ptr @T, align 8, !tbaa !11
  %106 = load i64, ptr %6, align 8, !tbaa !11
  %107 = mul nsw i64 2, %106
  %108 = sub nsw i64 %105, %107
  %109 = load i64, ptr %5, align 8, !tbaa !11
  %110 = add nsw i64 %109, %108
  store i64 %110, ptr %5, align 8, !tbaa !11
  br label %111

111:                                              ; preds = %104, %85
  %112 = load i64, ptr %6, align 8, !tbaa !11
  %113 = mul nsw i64 2, %112
  %114 = load i64, ptr %5, align 8, !tbaa !11
  %115 = add nsw i64 %114, %113
  store i64 %115, ptr %5, align 8, !tbaa !11
  %116 = load i64, ptr %4, align 8, !tbaa !11
  %117 = load i64, ptr %5, align 8, !tbaa !11
  %118 = icmp slt i64 %116, %117
  br i1 %118, label %119, label %132

119:                                              ; preds = %111
  %120 = load i64, ptr %5, align 8, !tbaa !11
  %121 = load i32, ptr %3, align 4, !tbaa !5
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds [100010 x i64], ptr @memo, i64 0, i64 %122
  store i64 %120, ptr %123, align 8, !tbaa !11
  %124 = load i32, ptr %3, align 4, !tbaa !5
  %125 = sub nsw i32 %124, 1
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds [100010 x i32], ptr @ret, i64 0, i64 %126
  %128 = load i32, ptr %127, align 4, !tbaa !5
  %129 = load i32, ptr %3, align 4, !tbaa !5
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [100010 x i32], ptr @ret, i64 0, i64 %130
  store i32 %128, ptr %131, align 4, !tbaa !5
  br label %141

132:                                              ; preds = %111
  %133 = load i64, ptr %4, align 8, !tbaa !11
  %134 = load i32, ptr %3, align 4, !tbaa !5
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds [100010 x i64], ptr @memo, i64 0, i64 %135
  store i64 %133, ptr %136, align 8, !tbaa !11
  %137 = load i32, ptr %3, align 4, !tbaa !5
  %138 = load i32, ptr %3, align 4, !tbaa !5
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds [100010 x i32], ptr @ret, i64 0, i64 %139
  store i32 %137, ptr %140, align 4, !tbaa !5
  br label %141

141:                                              ; preds = %132, %119
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  br label %142

142:                                              ; preds = %141
  %143 = load i32, ptr %3, align 4, !tbaa !5
  %144 = add nsw i32 %143, 1
  store i32 %144, ptr %3, align 4, !tbaa !5
  br label %27, !llvm.loop !13

145:                                              ; preds = %31
  %146 = load i32, ptr @N, align 4, !tbaa !5
  %147 = sub nsw i32 %146, 1
  %148 = sext i32 %147 to i64
  %149 = getelementptr inbounds [100010 x i64], ptr @memo, i64 0, i64 %148
  %150 = load i64, ptr %149, align 8, !tbaa !11
  %151 = load i64, ptr @E, align 8, !tbaa !11
  %152 = load i32, ptr @N, align 4, !tbaa !5
  %153 = sub nsw i32 %152, 1
  %154 = sext i32 %153 to i64
  %155 = getelementptr inbounds [100010 x i64], ptr @x, i64 0, i64 %154
  %156 = load i64, ptr %155, align 8, !tbaa !11
  %157 = sub nsw i64 %151, %156
  %158 = add nsw i64 %150, %157
  %159 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %158)
  %160 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %159, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %161 = load i32, ptr %1, align 4
  ret i32 %161
}

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #2 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 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 = !{!"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}


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

@N = external dso_local global i32, align 4
@E = external dso_local global i64, align 8
@T = external dso_local global i64, align 8
@x = external dso_local global [100010 x i64], align 16
@memo = external dso_local local_unnamed_addr global [100010 x i64], align 16
@ret = external dso_local local_unnamed_addr global [100010 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 @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @N)
  %2 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 8 dereferenceable(8) @E)
  %3 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %2, ptr noundef nonnull align 8 dereferenceable(8) @T)
  %4 = load i32, ptr @N, align 4, !tbaa !5
  %5 = icmp sgt i32 %4, 0
  br i1 %5, label %.lr.ph, label %._crit_edge.thread

._crit_edge.thread:                               ; preds = %0
  %6 = load i64, ptr @x, align 16, !tbaa !9
  %7 = load i64, ptr @T, align 8, !tbaa !9
  %8 = add nsw i64 %7, %6
  store i64 %8, ptr @memo, align 16, !tbaa !9
  store i32 -1, ptr @ret, align 16, !tbaa !5
  br label %._crit_edge45

._crit_edge:                                      ; preds = %.lr.ph
  %9 = load i64, ptr @x, align 16, !tbaa !9
  %10 = load i64, ptr @T, align 8, !tbaa !9
  %11 = add nsw i64 %10, %9
  store i64 %11, ptr @memo, align 16, !tbaa !9
  store i32 -1, ptr @ret, align 16, !tbaa !5
  %12 = icmp sgt i32 %15, 1
  br i1 %12, label %.lr.ph44.preheader, label %._crit_edge45

.lr.ph44.preheader:                               ; preds = %._crit_edge
  %wide.trip.count = zext nneg i32 %15 to i64
  br label %.lr.ph44

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

._crit_edge45:                                    ; preds = %46, %._crit_edge.thread, %._crit_edge
  %.lcssa53 = phi i32 [ %4, %._crit_edge.thread ], [ %15, %._crit_edge ], [ %15, %46 ]
  %18 = add nsw i32 %.lcssa53, -1
  %19 = sext i32 %18 to i64
  %20 = getelementptr inbounds [100010 x i64], ptr @memo, i64 0, i64 %19
  %21 = load i64, ptr %20, align 8, !tbaa !9
  %22 = load i64, ptr @E, align 8, !tbaa !9
  %23 = getelementptr inbounds [100010 x i64], ptr @x, i64 0, i64 %19
  %24 = load i64, ptr %23, align 8, !tbaa !9
  %25 = add i64 %22, %21
  %26 = sub i64 %25, %24
  %27 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %26)
  %28 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %27, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  ret i32 0

.lr.ph44:                                         ; preds = %.lr.ph44.preheader, %46
  %29 = phi i32 [ -1, %.lr.ph44.preheader ], [ %spec.select54, %46 ]
  %30 = phi i64 [ %9, %.lr.ph44.preheader ], [ %33, %46 ]
  %31 = phi i64 [ %11, %.lr.ph44.preheader ], [ %spec.select, %46 ]
  %indvars.iv48 = phi i64 [ 1, %.lr.ph44.preheader ], [ %indvars.iv.next49, %46 ]
  %32 = getelementptr inbounds [100010 x i64], ptr @x, i64 0, i64 %indvars.iv48
  %33 = load i64, ptr %32, align 8, !tbaa !9
  %34 = add i64 %31, %10
  %35 = add i64 %34, %33
  %36 = sub i64 %35, %30
  %37 = icmp eq i32 %29, -1
  br i1 %37, label %46, label %38

38:                                               ; preds = %.lr.ph44
  %39 = sext i32 %29 to i64
  %40 = getelementptr inbounds [100010 x i64], ptr @memo, i64 0, i64 %39
  %41 = load i64, ptr %40, align 8, !tbaa !9
  %42 = getelementptr inbounds [100010 x i64], ptr @x, i64 0, i64 %39
  %43 = load i64, ptr %42, align 8, !tbaa !9
  %44 = add i64 %41, %33
  %45 = sub i64 %44, %43
  br label %46

46:                                               ; preds = %.lr.ph44, %38
  %.031 = phi i64 [ %45, %38 ], [ %33, %.lr.ph44 ]
  %47 = add nsw i32 %29, 1
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [100010 x i64], ptr @x, i64 0, i64 %48
  %50 = load i64, ptr %49, align 8, !tbaa !9
  %51 = sub nsw i64 %33, %50
  %52 = shl nsw i64 %51, 1
  %53 = icmp slt i64 %52, %10
  %54 = sub nsw i64 %10, %52
  %55 = select i1 %53, i64 %54, i64 0
  %.1 = add i64 %52, %.031
  %56 = add i64 %.1, %55
  %57 = icmp slt i64 %36, %56
  %58 = trunc nuw nsw i64 %indvars.iv48 to i32
  %spec.select = tail call i64 @llvm.smax.i64(i64 %36, i64 %56)
  %spec.select54 = select i1 %57, i32 %29, i32 %58
  %59 = getelementptr inbounds [100010 x i64], ptr @memo, i64 0, i64 %indvars.iv48
  store i64 %spec.select, ptr %59, align 8
  %60 = getelementptr inbounds [100010 x i32], ptr @ret, i64 0, i64 %indvars.iv48
  store i32 %spec.select54, ptr %60, align 4
  %indvars.iv.next49 = add nuw nsw i64 %indvars.iv48, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next49, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge45, label %.lr.ph44, !llvm.loop !13
}

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

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) local_unnamed_addr #2 align 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 #2 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)) #3

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #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 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" }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }

!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 = !{!"long long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}


; Effective O3 passes: BDCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,MergedLoadStoreMotionPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass