; LLVM IR from tangjz/acm-icpc :: lydsy (1016)

; 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.Line = type { i32, i32, i32 }
%struct.Union = type { [201 x i32] }

@edge = external dso_local global [200001 x %struct.Line], align 16
@now = external dso_local global i32, align 4
@tmp = external dso_local global i32, align 4
@num = external dso_local global i32, align 4
@ans = external dso_local global i32, align 4
@sum = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@NOW = external dso_local global %struct.Union, align 4
@LAST = external dso_local global %struct.Union, align 4
@.str = external hidden unnamed_addr constant [2 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_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: 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) #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN5Union7combineEii(ptr noundef nonnull align 4 dereferenceable(804), i32 noundef, i32 noundef) #0 align 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
  store i32 0, ptr %1, align 4
  %6 = call noundef i32 @_Z7ScanIntv()
  store i32 %6, ptr @n, align 4, !tbaa !5
  %7 = call noundef i32 @_Z7ScanIntv()
  store i32 %7, ptr @m, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %8

8:                                                ; preds = %29, %0
  %9 = load i32, ptr %2, align 4, !tbaa !5
  %10 = load i32, ptr @m, align 4, !tbaa !5
  %11 = icmp sle i32 %9, %10
  br i1 %11, label %13, label %12

12:                                               ; preds = %8
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  br label %32

13:                                               ; preds = %8
  %14 = call noundef i32 @_Z7ScanIntv()
  %15 = load i32, ptr %2, align 4, !tbaa !5
  %16 = sext i32 %15 to i64
  %17 = getelementptr inbounds [200001 x %struct.Line], ptr @edge, i64 0, i64 %16
  %18 = getelementptr inbounds %struct.Line, ptr %17, i32 0, i32 0
  store i32 %14, ptr %18, align 4, !tbaa !9
  %19 = call noundef i32 @_Z7ScanIntv()
  %20 = load i32, ptr %2, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds [200001 x %struct.Line], ptr @edge, i64 0, i64 %21
  %23 = getelementptr inbounds %struct.Line, ptr %22, i32 0, i32 1
  store i32 %19, ptr %23, align 4, !tbaa !11
  %24 = call noundef i32 @_Z7ScanIntv()
  %25 = load i32, ptr %2, align 4, !tbaa !5
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds [200001 x %struct.Line], ptr @edge, i64 0, i64 %26
  %28 = getelementptr inbounds %struct.Line, ptr %27, i32 0, i32 2
  store i32 %24, ptr %28, align 4, !tbaa !12
  br label %29

29:                                               ; preds = %13
  %30 = load i32, ptr %2, align 4, !tbaa !5
  %31 = add nsw i32 %30, 1
  store i32 %31, ptr %2, align 4, !tbaa !5
  br label %8, !llvm.loop !13

32:                                               ; preds = %12
  %33 = load i32, ptr @m, align 4, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds %struct.Line, ptr @edge, i64 %34
  %36 = getelementptr inbounds %struct.Line, ptr %35, i64 1
  call void @_ZSt4sortIP4LineEvT_S2_(ptr noundef getelementptr inbounds (%struct.Line, ptr @edge, i64 1), ptr noundef %36)
  store i32 0, ptr @num, align 4, !tbaa !5
  store i32 1, ptr @ans, align 4, !tbaa !5
  call void @_ZN5Union4initEv(ptr noundef nonnull align 4 dereferenceable(804) @NOW)
  call void @_ZN5Union4initEv(ptr noundef nonnull align 4 dereferenceable(804) @LAST)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %37

37:                                               ; preds = %91, %32
  %38 = load i32, ptr %3, align 4, !tbaa !5
  %39 = load i32, ptr @m, align 4, !tbaa !5
  %40 = icmp sle i32 %38, %39
  br i1 %40, label %42, label %41

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

42:                                               ; preds = %37
  %43 = load i32, ptr %3, align 4, !tbaa !5
  store i32 %43, ptr @now, align 4, !tbaa !5
  br label %44

44:                                               ; preds = %63, %42
  %45 = load i32, ptr @now, align 4, !tbaa !5
  %46 = load i32, ptr @m, align 4, !tbaa !5
  %47 = icmp slt i32 %45, %46
  br i1 %47, label %48, label %61

48:                                               ; preds = %44
  %49 = load i32, ptr %3, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [200001 x %struct.Line], ptr @edge, i64 0, i64 %50
  %52 = getelementptr inbounds %struct.Line, ptr %51, i32 0, i32 2
  %53 = load i32, ptr %52, align 4, !tbaa !12
  %54 = load i32, ptr @now, align 4, !tbaa !5
  %55 = add nsw i32 %54, 1
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [200001 x %struct.Line], ptr @edge, i64 0, i64 %56
  %58 = getelementptr inbounds %struct.Line, ptr %57, i32 0, i32 2
  %59 = load i32, ptr %58, align 4, !tbaa !12
  %60 = icmp eq i32 %53, %59
  br label %61

61:                                               ; preds = %48, %44
  %62 = phi i1 [ false, %44 ], [ %60, %48 ]
  br i1 %62, label %63, label %66

63:                                               ; preds = %61
  %64 = load i32, ptr @now, align 4, !tbaa !5
  %65 = add nsw i32 %64, 1
  store i32 %65, ptr @now, align 4, !tbaa !5
  br label %44, !llvm.loop !15

66:                                               ; preds = %61
  store i32 0, ptr @tmp, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  %67 = load i32, ptr %3, align 4, !tbaa !5
  store i32 %67, ptr %5, align 4, !tbaa !5
  br label %68

68:                                               ; preds = %88, %66
  %69 = load i32, ptr %5, align 4, !tbaa !5
  %70 = load i32, ptr @now, align 4, !tbaa !5
  %71 = icmp sle i32 %69, %70
  br i1 %71, label %73, label %72

72:                                               ; preds = %68
  store i32 9, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  br label %91

73:                                               ; preds = %68
  %74 = load i32, ptr %5, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [200001 x %struct.Line], ptr @edge, i64 0, i64 %75
  %77 = getelementptr inbounds %struct.Line, ptr %76, i32 0, i32 0
  %78 = load i32, ptr %77, align 4, !tbaa !9
  %79 = load i32, ptr %5, align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [200001 x %struct.Line], ptr @edge, i64 0, i64 %80
  %82 = getelementptr inbounds %struct.Line, ptr %81, i32 0, i32 1
  %83 = load i32, ptr %82, align 4, !tbaa !11
  %84 = call noundef zeroext i1 @_ZN5Union7combineEii(ptr noundef nonnull align 4 dereferenceable(804) @NOW, i32 noundef %78, i32 noundef %83)
  %85 = zext i1 %84 to i32
  %86 = load i32, ptr @tmp, align 4, !tbaa !5
  %87 = add nsw i32 %86, %85
  store i32 %87, ptr @tmp, align 4, !tbaa !5
  br label %88

88:                                               ; preds = %73
  %89 = load i32, ptr %5, align 4, !tbaa !5
  %90 = add nsw i32 %89, 1
  store i32 %90, ptr %5, align 4, !tbaa !5
  br label %68, !llvm.loop !16

91:                                               ; preds = %72
  store i32 0, ptr @sum, align 4, !tbaa !5
  %92 = load i32, ptr %3, align 4, !tbaa !5
  call void @_Z3dfsii(i32 noundef %92, i32 noundef 0)
  %93 = load i32, ptr @ans, align 4, !tbaa !5
  %94 = load i32, ptr @sum, align 4, !tbaa !5
  %95 = mul nsw i32 %93, %94
  %96 = srem i32 %95, 31011
  store i32 %96, ptr @ans, align 4, !tbaa !5
  %97 = load i32, ptr @tmp, align 4, !tbaa !5
  %98 = load i32, ptr @num, align 4, !tbaa !5
  %99 = add nsw i32 %98, %97
  store i32 %99, ptr @num, align 4, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 @LAST, ptr align 4 @NOW, i64 804, i1 false), !tbaa.struct !17
  %100 = load i32, ptr @now, align 4, !tbaa !5
  %101 = add nsw i32 %100, 1
  store i32 %101, ptr %3, align 4, !tbaa !5
  br label %37, !llvm.loop !19

102:                                              ; preds = %41
  %103 = load i32, ptr @num, align 4, !tbaa !5
  %104 = load i32, ptr @n, align 4, !tbaa !5
  %105 = sub nsw i32 %104, 1
  %106 = icmp ne i32 %103, %105
  br i1 %106, label %107, label %109

107:                                              ; preds = %102
  %108 = call i32 @puts(ptr noundef @.str)
  br label %112

109:                                              ; preds = %102
  %110 = load i32, ptr @ans, align 4, !tbaa !5
  %111 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %110)
  br label %112

112:                                              ; preds = %109, %107
  ret i32 0
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_Z7ScanIntv() #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIP4LineEvT_S2_(ptr noundef, ptr noundef) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN5Union4initEv(ptr noundef nonnull align 4 dereferenceable(804)) #5 align 2

declare i32 @puts(ptr noundef) #6

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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = { "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, !6, i64 0}
!10 = !{!"_ZTS4Line", !6, i64 0, !6, i64 4, !6, i64 8}
!11 = !{!10, !6, i64 4}
!12 = !{!10, !6, i64 8}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}
!17 = !{i64 0, i64 804, !18}
!18 = !{!7, !7, i64 0}
!19 = distinct !{!19, !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.Line = type { i32, i32, i32 }
%struct.Union = type { [201 x i32] }

@edge = external dso_local global [200001 x %struct.Line], align 16
@now = external dso_local local_unnamed_addr global i32, align 4
@tmp = external dso_local local_unnamed_addr global i32, align 4
@num = external dso_local local_unnamed_addr global i32, align 4
@ans = external dso_local local_unnamed_addr global i32, align 4
@sum = external dso_local local_unnamed_addr global i32, align 4
@n = external dso_local local_unnamed_addr global i32, align 4
@m = external dso_local local_unnamed_addr global i32, align 4
@NOW = external dso_local global %struct.Union, align 4
@LAST = external dso_local global %struct.Union, align 4
@.str = external hidden unnamed_addr constant [2 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1

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

; Function Attrs: mustprogress 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) #1

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN5Union7combineEii(ptr noundef nonnull align 4 dereferenceable(804), i32 noundef, i32 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 {
  %1 = tail call noundef i32 @_Z7ScanIntv()
  store i32 %1, ptr @n, align 4, !tbaa !5
  %2 = tail call noundef i32 @_Z7ScanIntv()
  store i32 %2, ptr @m, align 4, !tbaa !5
  %.not21 = icmp slt i32 %2, 1
  br i1 %.not21, label %.._crit_edge_crit_edge, label %.lr.ph

.._crit_edge_crit_edge:                           ; preds = %0
  %.pre38 = sext i32 %2 to i64
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.._crit_edge_crit_edge
  %.pre-phi = phi i64 [ %.pre38, %.._crit_edge_crit_edge ], [ %13, %.lr.ph ]
  %3 = getelementptr inbounds %struct.Line, ptr @edge, i64 %.pre-phi
  %4 = getelementptr inbounds i8, ptr %3, i64 12
  tail call void @_ZSt4sortIP4LineEvT_S2_(ptr noundef nonnull getelementptr inbounds (i8, ptr @edge, i64 12), ptr noundef nonnull %4)
  store i32 0, ptr @num, align 4, !tbaa !5
  store i32 1, ptr @ans, align 4, !tbaa !5
  tail call void @_ZN5Union4initEv(ptr noundef nonnull align 4 dereferenceable(804) @NOW)
  tail call void @_ZN5Union4initEv(ptr noundef nonnull align 4 dereferenceable(804) @LAST)
  %5 = load i32, ptr @m, align 4, !tbaa !5
  %.not1827 = icmp slt i32 %5, 1
  br i1 %.not1827, label %._crit_edge.._crit_edge29_crit_edge, label %.preheader

._crit_edge.._crit_edge29_crit_edge:              ; preds = %._crit_edge
  %.pre = load i32, ptr @num, align 4, !tbaa !5
  br label %._crit_edge29

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %0 ]
  %6 = tail call noundef i32 @_Z7ScanIntv()
  %7 = getelementptr inbounds [200001 x %struct.Line], ptr @edge, i64 0, i64 %indvars.iv
  store i32 %6, ptr %7, align 4, !tbaa !9
  %8 = tail call noundef i32 @_Z7ScanIntv()
  %9 = getelementptr inbounds i8, ptr %7, i64 4
  store i32 %8, ptr %9, align 4, !tbaa !11
  %10 = tail call noundef i32 @_Z7ScanIntv()
  %11 = getelementptr inbounds i8, ptr %7, i64 8
  store i32 %10, ptr %11, align 4, !tbaa !12
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %12 = load i32, ptr @m, align 4, !tbaa !5
  %13 = sext i32 %12 to i64
  %.not.not = icmp slt i64 %indvars.iv, %13
  br i1 %.not.not, label %.lr.ph, label %._crit_edge, !llvm.loop !13

.preheader:                                       ; preds = %._crit_edge, %._crit_edge26
  %14 = phi i32 [ %36, %._crit_edge26 ], [ %5, %._crit_edge ]
  %.01428 = phi i32 [ %35, %._crit_edge26 ], [ 1, %._crit_edge ]
  %15 = sext i32 %.01428 to i64
  %16 = getelementptr inbounds [200001 x %struct.Line], ptr @edge, i64 0, i64 %15, i32 2
  %smax = tail call i32 @llvm.smax.i32(i32 %14, i32 %.01428)
  %wide.trip.count = sext i32 %smax to i64
  br label %20

._crit_edge29:                                    ; preds = %._crit_edge26, %._crit_edge.._crit_edge29_crit_edge
  %17 = phi i32 [ %.pre, %._crit_edge.._crit_edge29_crit_edge ], [ %33, %._crit_edge26 ]
  %18 = load i32, ptr @n, align 4, !tbaa !5
  %19 = add nsw i32 %18, -1
  %.not19 = icmp eq i32 %17, %19
  br i1 %.not19, label %49, label %47

20:                                               ; preds = %.preheader, %21
  %indvars.iv32 = phi i64 [ %15, %.preheader ], [ %indvars.iv.next33, %21 ]
  %exitcond.not = icmp eq i64 %indvars.iv32, %wide.trip.count
  br i1 %exitcond.not, label %.critedge, label %21

21:                                               ; preds = %20
  %22 = load i32, ptr %16, align 4, !tbaa !12
  %indvars.iv.next33 = add nsw i64 %indvars.iv32, 1
  %23 = getelementptr inbounds [200001 x %struct.Line], ptr @edge, i64 0, i64 %indvars.iv.next33, i32 2
  %24 = load i32, ptr %23, align 4, !tbaa !12
  %25 = icmp eq i32 %22, %24
  br i1 %25, label %20, label %.critedge.split.loop.exit40, !llvm.loop !15

.critedge.split.loop.exit40:                      ; preds = %21
  %26 = trunc nsw i64 %indvars.iv32 to i32
  br label %.critedge

.critedge:                                        ; preds = %20, %.critedge.split.loop.exit40
  %storemerge.lcssa = phi i32 [ %26, %.critedge.split.loop.exit40 ], [ %smax, %20 ]
  store i32 %storemerge.lcssa, ptr @now, align 4, !tbaa !5
  store i32 0, ptr @tmp, align 4, !tbaa !5
  %.not2023 = icmp sgt i32 %.01428, %storemerge.lcssa
  br i1 %.not2023, label %._crit_edge26, label %.lr.ph25

._crit_edge26:                                    ; preds = %.lr.ph25, %.critedge
  store i32 0, ptr @sum, align 4, !tbaa !5
  tail call void @_Z3dfsii(i32 noundef %.01428, i32 noundef 0)
  %27 = load i32, ptr @ans, align 4, !tbaa !5
  %28 = load i32, ptr @sum, align 4, !tbaa !5
  %29 = mul nsw i32 %28, %27
  %30 = srem i32 %29, 31011
  store i32 %30, ptr @ans, align 4, !tbaa !5
  %31 = load i32, ptr @tmp, align 4, !tbaa !5
  %32 = load i32, ptr @num, align 4, !tbaa !5
  %33 = add nsw i32 %32, %31
  store i32 %33, ptr @num, align 4, !tbaa !5
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(804) @LAST, ptr noundef nonnull align 4 dereferenceable(804) @NOW, i64 804, i1 false), !tbaa.struct !16
  %34 = load i32, ptr @now, align 4, !tbaa !5
  %35 = add nsw i32 %34, 1
  %36 = load i32, ptr @m, align 4, !tbaa !5
  %.not18.not = icmp slt i32 %34, %36
  br i1 %.not18.not, label %.preheader, label %._crit_edge29, !llvm.loop !18

.lr.ph25:                                         ; preds = %.critedge, %.lr.ph25
  %indvars.iv35 = phi i64 [ %indvars.iv.next36, %.lr.ph25 ], [ %15, %.critedge ]
  %37 = getelementptr inbounds [200001 x %struct.Line], ptr @edge, i64 0, i64 %indvars.iv35
  %38 = load i32, ptr %37, align 4, !tbaa !9
  %39 = getelementptr inbounds i8, ptr %37, i64 4
  %40 = load i32, ptr %39, align 4, !tbaa !11
  %41 = tail call noundef zeroext i1 @_ZN5Union7combineEii(ptr noundef nonnull align 4 dereferenceable(804) @NOW, i32 noundef %38, i32 noundef %40)
  %42 = zext i1 %41 to i32
  %43 = load i32, ptr @tmp, align 4, !tbaa !5
  %44 = add nsw i32 %43, %42
  store i32 %44, ptr @tmp, align 4, !tbaa !5
  %indvars.iv.next36 = add nsw i64 %indvars.iv35, 1
  %45 = load i32, ptr @now, align 4, !tbaa !5
  %46 = sext i32 %45 to i64
  %.not20.not = icmp slt i64 %indvars.iv35, %46
  br i1 %.not20.not, label %.lr.ph25, label %._crit_edge26, !llvm.loop !19

47:                                               ; preds = %._crit_edge29
  %48 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str)
  br label %52

49:                                               ; preds = %._crit_edge29
  %50 = load i32, ptr @ans, align 4, !tbaa !5
  %51 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %50)
  br label %52

52:                                               ; preds = %49, %47
  ret i32 0
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_Z7ScanIntv() local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIP4LineEvT_S2_(ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN5Union4initEv(ptr noundef nonnull align 4 dereferenceable(804)) local_unnamed_addr #4 align 2

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #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 = { 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 #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 = { 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, !6, i64 0}
!10 = !{!"_ZTS4Line", !6, i64 0, !6, i64 4, !6, i64 8}
!11 = !{!10, !6, i64 4}
!12 = !{!10, !6, i64 8}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = !{i64 0, i64 804, !17}
!17 = !{!7, !7, i64 0}
!18 = distinct !{!18, !14}
!19 = distinct !{!19, !14}


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