; LLVM IR from tangjz/acm-icpc :: hdu (6035)

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

%struct.Edge = type { i32, i32 }

@_ZN6fastIO7IOerrorE = external dso_local global i8, align 1
@n = external dso_local global i32, align 4
@c = external dso_local global [200001 x i32], align 16
@lnk = external dso_local global [200001 x i32], align 16
@rem = external dso_local global [200001 x i32], align 16
@ans = external dso_local global i64, align 8
@e = external dso_local global [400003 x %struct.Edge], align 16
@.str = external hidden unnamed_addr constant [17 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z3dfsii(i32 noundef, i32 noundef) #0

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_Z4sum2i(i32 noundef) #2

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #3 {
  %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 %struct.Edge, align 4
  %9 = alloca %struct.Edge, align 4
  %10 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %11

11:                                               ; preds = %108, %0
  call void @_ZN6fastIO4readERi(ptr noundef nonnull align 4 dereferenceable(4) @n)
  %12 = load i8, ptr @_ZN6fastIO7IOerrorE, align 1, !tbaa !9, !range !11, !noundef !12
  %13 = trunc i8 %12 to i1
  %14 = xor i1 %13, true
  br i1 %14, label %16, label %15

15:                                               ; preds = %11
  store i32 2, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  br label %111

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

17:                                               ; preds = %32, %16
  %18 = load i32, ptr %4, align 4, !tbaa !5
  %19 = load i32, ptr @n, align 4, !tbaa !5
  %20 = icmp sle i32 %18, %19
  br i1 %20, label %22, label %21

21:                                               ; preds = %17
  store i32 5, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  br label %35

22:                                               ; preds = %17
  %23 = load i32, ptr %4, align 4, !tbaa !5
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds [200001 x i32], ptr @c, i64 0, i64 %24
  call void @_ZN6fastIO4readERi(ptr noundef nonnull align 4 dereferenceable(4) %25)
  %26 = load i32, ptr %4, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [200001 x i32], ptr @rem, i64 0, i64 %27
  store i32 0, ptr %28, align 4, !tbaa !5
  %29 = load i32, ptr %4, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds [200001 x i32], ptr @lnk, i64 0, i64 %30
  store i32 0, ptr %31, align 4, !tbaa !5
  br label %32

32:                                               ; preds = %22
  %33 = load i32, ptr %4, align 4, !tbaa !5
  %34 = add nsw i32 %33, 1
  store i32 %34, ptr %4, align 4, !tbaa !5
  br label %17, !llvm.loop !13

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

36:                                               ; preds = %76, %35
  %37 = load i32, ptr %5, align 4, !tbaa !5
  %38 = load i32, ptr @n, align 4, !tbaa !5
  %39 = icmp slt i32 %37, %38
  br i1 %39, label %41, label %40

40:                                               ; preds = %36
  store i32 8, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  br label %79

41:                                               ; preds = %36
  call void @_ZN6fastIO4readERi(ptr noundef nonnull align 4 dereferenceable(4) %6)
  call void @_ZN6fastIO4readERi(ptr noundef nonnull align 4 dereferenceable(4) %7)
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  %42 = getelementptr inbounds %struct.Edge, ptr %8, i32 0, i32 0
  %43 = load i32, ptr %6, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [200001 x i32], ptr @lnk, i64 0, i64 %44
  %46 = load i32, ptr %45, align 4, !tbaa !5
  store i32 %46, ptr %42, align 4, !tbaa !15
  %47 = getelementptr inbounds %struct.Edge, ptr %8, i32 0, i32 1
  %48 = load i32, ptr %7, align 4, !tbaa !5
  store i32 %48, ptr %47, align 4, !tbaa !17
  %49 = load i32, ptr %5, align 4, !tbaa !5
  %50 = shl i32 %49, 1
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [400003 x %struct.Edge], ptr @e, i64 0, i64 %51
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %52, ptr align 4 %8, i64 8, i1 false), !tbaa.struct !18
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  %53 = load i32, ptr %5, align 4, !tbaa !5
  %54 = shl i32 %53, 1
  %55 = load i32, ptr %6, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [200001 x i32], ptr @lnk, i64 0, i64 %56
  store i32 %54, ptr %57, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  %58 = getelementptr inbounds %struct.Edge, ptr %9, i32 0, i32 0
  %59 = load i32, ptr %7, align 4, !tbaa !5
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [200001 x i32], ptr @lnk, i64 0, i64 %60
  %62 = load i32, ptr %61, align 4, !tbaa !5
  store i32 %62, ptr %58, align 4, !tbaa !15
  %63 = getelementptr inbounds %struct.Edge, ptr %9, i32 0, i32 1
  %64 = load i32, ptr %6, align 4, !tbaa !5
  store i32 %64, ptr %63, align 4, !tbaa !17
  %65 = load i32, ptr %5, align 4, !tbaa !5
  %66 = shl i32 %65, 1
  %67 = or i32 %66, 1
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [400003 x %struct.Edge], ptr @e, i64 0, i64 %68
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %69, ptr align 4 %9, i64 8, i1 false), !tbaa.struct !18
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  %70 = load i32, ptr %5, align 4, !tbaa !5
  %71 = shl i32 %70, 1
  %72 = or i32 %71, 1
  %73 = load i32, ptr %7, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [200001 x i32], ptr @lnk, i64 0, i64 %74
  store i32 %72, ptr %75, align 4, !tbaa !5
  br label %76

76:                                               ; preds = %41
  %77 = load i32, ptr %5, align 4, !tbaa !5
  %78 = add nsw i32 %77, 1
  store i32 %78, ptr %5, align 4, !tbaa !5
  br label %36, !llvm.loop !19

79:                                               ; preds = %40
  %80 = load i32, ptr @n, align 4, !tbaa !5
  %81 = call noundef i64 @_Z4sum2i(i32 noundef %80)
  %82 = load i32, ptr @n, align 4, !tbaa !5
  %83 = sext i32 %82 to i64
  %84 = mul nsw i64 %81, %83
  store i64 %84, ptr @ans, align 8, !tbaa !20
  %85 = call noundef i32 @_Z3dfsii(i32 noundef 1, i32 noundef -1)
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  store i32 1, ptr %10, align 4, !tbaa !5
  br label %86

86:                                               ; preds = %101, %79
  %87 = load i32, ptr %10, align 4, !tbaa !5
  %88 = load i32, ptr @n, align 4, !tbaa !5
  %89 = icmp sle i32 %87, %88
  br i1 %89, label %91, label %90

90:                                               ; preds = %86
  store i32 11, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %104

91:                                               ; preds = %86
  %92 = load i32, ptr @n, align 4, !tbaa !5
  %93 = load i32, ptr %10, align 4, !tbaa !5
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [200001 x i32], ptr @rem, i64 0, i64 %94
  %96 = load i32, ptr %95, align 4, !tbaa !5
  %97 = sub nsw i32 %92, %96
  %98 = call noundef i64 @_Z4sum2i(i32 noundef %97)
  %99 = load i64, ptr @ans, align 8, !tbaa !20
  %100 = sub nsw i64 %99, %98
  store i64 %100, ptr @ans, align 8, !tbaa !20
  br label %101

101:                                              ; preds = %91
  %102 = load i32, ptr %10, align 4, !tbaa !5
  %103 = add nsw i32 %102, 1
  store i32 %103, ptr %10, align 4, !tbaa !5
  br label %86, !llvm.loop !22

104:                                              ; preds = %90
  %105 = load i32, ptr %2, align 4, !tbaa !5
  %106 = load i64, ptr @ans, align 8, !tbaa !20
  %107 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %105, i64 noundef %106)
  br label %108

108:                                              ; preds = %104
  %109 = load i32, ptr %2, align 4, !tbaa !5
  %110 = add nsw i32 %109, 1
  store i32 %110, ptr %2, align 4, !tbaa !5
  br label %11, !llvm.loop !23

111:                                              ; preds = %15
  ret i32 0
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN6fastIO4readERi(ptr noundef nonnull align 4 dereferenceable(4)) #4

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #5

declare i32 @printf(ptr noundef, ...) #6

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { 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 #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: readwrite) }
attributes #6 = { "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 #7 = { 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 = !{i8 0, i8 2}
!12 = !{}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!16, !6, i64 0}
!16 = !{!"_ZTS4Edge", !6, i64 0, !6, i64 4}
!17 = !{!16, !6, i64 4}
!18 = !{i64 0, i64 4, !5, i64 4, i64 4, !5}
!19 = distinct !{!19, !14}
!20 = !{!21, !21, i64 0}
!21 = !{!"long long", !7, i64 0}
!22 = distinct !{!22, !14}
!23 = distinct !{!23, !14}


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

%struct.Edge = type { i32, i32 }

@_ZN6fastIO7IOerrorE = external dso_local local_unnamed_addr global i8, align 1
@n = external dso_local global i32, align 4
@c = external dso_local global [200001 x i32], align 16
@lnk = external dso_local local_unnamed_addr global [200001 x i32], align 16
@rem = external dso_local local_unnamed_addr global [200001 x i32], align 16
@ans = external dso_local local_unnamed_addr global i64, align 8
@e = external dso_local local_unnamed_addr global [400003 x %struct.Edge], align 16
@.str = external hidden unnamed_addr constant [17 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z3dfsii(i32 noundef, i32 noundef) local_unnamed_addr #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: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_Z4sum2i(i32 noundef) local_unnamed_addr #2

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #3 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  tail call void @_ZN6fastIO4readERi(ptr noundef nonnull align 4 dereferenceable(4) @n)
  %3 = load i8, ptr @_ZN6fastIO7IOerrorE, align 1, !tbaa !5, !range !9, !noundef !10
  %4 = trunc nuw i8 %3 to i1
  br i1 %4, label %._crit_edge35, label %.preheader

.preheader:                                       ; preds = %0, %._crit_edge33
  %.01834 = phi i32 [ %39, %._crit_edge33 ], [ 1, %0 ]
  %5 = load i32, ptr @n, align 4, !tbaa !11
  %.not23 = icmp slt i32 %5, 1
  br i1 %.not23, label %._crit_edge.thread, label %.lr.ph

._crit_edge.thread:                               ; preds = %.preheader
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  br label %._crit_edge28

._crit_edge35:                                    ; preds = %._crit_edge33, %0
  ret i32 0

._crit_edge:                                      ; preds = %.lr.ph
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  %6 = icmp sgt i32 %10, 1
  br i1 %6, label %.lr.ph27, label %._crit_edge28

.lr.ph:                                           ; preds = %.preheader, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %.preheader ]
  %7 = getelementptr inbounds [200001 x i32], ptr @c, i64 0, i64 %indvars.iv
  call void @_ZN6fastIO4readERi(ptr noundef nonnull align 4 dereferenceable(4) %7)
  %8 = getelementptr inbounds [200001 x i32], ptr @rem, i64 0, i64 %indvars.iv
  store i32 0, ptr %8, align 4, !tbaa !11
  %9 = getelementptr inbounds [200001 x i32], ptr @lnk, i64 0, i64 %indvars.iv
  store i32 0, ptr %9, align 4, !tbaa !11
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %10 = load i32, ptr @n, align 4, !tbaa !11
  %11 = sext i32 %10 to i64
  %.not.not = icmp slt i64 %indvars.iv, %11
  br i1 %.not.not, label %.lr.ph, label %._crit_edge, !llvm.loop !13

._crit_edge28:                                    ; preds = %.lr.ph27, %._crit_edge.thread, %._crit_edge
  %.lcssa = phi i32 [ %10, %._crit_edge ], [ %5, %._crit_edge.thread ], [ %34, %.lr.ph27 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  %12 = call noundef i64 @_Z4sum2i(i32 noundef %.lcssa)
  %13 = load i32, ptr @n, align 4, !tbaa !11
  %14 = sext i32 %13 to i64
  %15 = mul nsw i64 %12, %14
  store i64 %15, ptr @ans, align 8, !tbaa !15
  %16 = call noundef i32 @_Z3dfsii(i32 noundef 1, i32 noundef -1)
  %17 = load i32, ptr @n, align 4, !tbaa !11
  %.not2229 = icmp slt i32 %17, 1
  br i1 %.not2229, label %._crit_edge28.._crit_edge33_crit_edge, label %.lr.ph32

._crit_edge28.._crit_edge33_crit_edge:            ; preds = %._crit_edge28
  %.pre = load i64, ptr @ans, align 8, !tbaa !15
  br label %._crit_edge33

.lr.ph27:                                         ; preds = %._crit_edge, %.lr.ph27
  %indvars.iv38 = phi i64 [ %indvars.iv.next39, %.lr.ph27 ], [ 1, %._crit_edge ]
  call void @_ZN6fastIO4readERi(ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @_ZN6fastIO4readERi(ptr noundef nonnull align 4 dereferenceable(4) %2)
  %18 = load i32, ptr %1, align 4, !tbaa !11
  %19 = sext i32 %18 to i64
  %20 = getelementptr inbounds [200001 x i32], ptr @lnk, i64 0, i64 %19
  %21 = load i32, ptr %20, align 4, !tbaa !11
  %22 = load i32, ptr %2, align 4, !tbaa !11
  %23 = shl nuw i64 %indvars.iv38, 1
  %24 = trunc nuw i64 %23 to i32
  %sext = shl i64 %indvars.iv38, 33
  %25 = ashr exact i64 %sext, 32
  %26 = getelementptr inbounds [400003 x %struct.Edge], ptr @e, i64 0, i64 %25
  store i32 %21, ptr %26, align 16, !tbaa !11
  %.sroa.44.0..sroa_idx = getelementptr inbounds i8, ptr %26, i64 4
  store i32 %22, ptr %.sroa.44.0..sroa_idx, align 4, !tbaa !11
  store i32 %24, ptr %20, align 4, !tbaa !11
  %27 = sext i32 %22 to i64
  %28 = getelementptr inbounds [200001 x i32], ptr @lnk, i64 0, i64 %27
  %29 = load i32, ptr %28, align 4, !tbaa !11
  %30 = trunc i64 %23 to i32
  %31 = or disjoint i32 %30, 1
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [400003 x %struct.Edge], ptr @e, i64 0, i64 %32
  store i32 %29, ptr %33, align 8, !tbaa !11
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %33, i64 4
  store i32 %18, ptr %.sroa.4.0..sroa_idx, align 4, !tbaa !11
  store i32 %31, ptr %28, align 4, !tbaa !11
  %indvars.iv.next39 = add nuw nsw i64 %indvars.iv38, 1
  %34 = load i32, ptr @n, align 4, !tbaa !11
  %35 = sext i32 %34 to i64
  %36 = icmp slt i64 %indvars.iv.next39, %35
  br i1 %36, label %.lr.ph27, label %._crit_edge28, !llvm.loop !17

._crit_edge33:                                    ; preds = %.lr.ph32, %._crit_edge28.._crit_edge33_crit_edge
  %37 = phi i64 [ %.pre, %._crit_edge28.._crit_edge33_crit_edge ], [ %48, %.lr.ph32 ]
  %38 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %.01834, i64 noundef %37)
  %39 = add nuw nsw i32 %.01834, 1
  call void @_ZN6fastIO4readERi(ptr noundef nonnull align 4 dereferenceable(4) @n)
  %40 = load i8, ptr @_ZN6fastIO7IOerrorE, align 1, !tbaa !5, !range !9, !noundef !10
  %41 = trunc nuw i8 %40 to i1
  br i1 %41, label %._crit_edge35, label %.preheader, !llvm.loop !18

.lr.ph32:                                         ; preds = %._crit_edge28, %.lr.ph32
  %indvars.iv41 = phi i64 [ %indvars.iv.next42, %.lr.ph32 ], [ 1, %._crit_edge28 ]
  %42 = phi i32 [ %49, %.lr.ph32 ], [ %17, %._crit_edge28 ]
  %43 = getelementptr inbounds [200001 x i32], ptr @rem, i64 0, i64 %indvars.iv41
  %44 = load i32, ptr %43, align 4, !tbaa !11
  %45 = sub nsw i32 %42, %44
  %46 = call noundef i64 @_Z4sum2i(i32 noundef %45)
  %47 = load i64, ptr @ans, align 8, !tbaa !15
  %48 = sub nsw i64 %47, %46
  store i64 %48, ptr @ans, align 8, !tbaa !15
  %indvars.iv.next42 = add nuw nsw i64 %indvars.iv41, 1
  %49 = load i32, ptr @n, align 4, !tbaa !11
  %50 = sext i32 %49 to i64
  %.not22.not = icmp slt i64 %indvars.iv41, %50
  br i1 %.not22.not, label %.lr.ph32, label %._crit_edge33, !llvm.loop !19
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN6fastIO4readERi(ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #4

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { 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 #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 = { nofree nounwind "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 = !{!"bool", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{i8 0, i8 2}
!10 = !{}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!16, !16, i64 0}
!16 = !{!"long long", !7, i64 0}
!17 = distinct !{!17, !14}
!18 = distinct !{!18, !14}
!19 = distinct !{!19, !14}


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