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

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

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@rt = external dso_local global [200001 x i32], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@_ZZ4mainE7lastans = external hidden global i32, align 4
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5buildRiii(ptr noundef nonnull align 4 dereferenceable(4), 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 nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z6updateRiiiii(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef, i32 noundef, i32 noundef, i32 noundef) #0

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z8dsu_findRiiS_(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef, ptr noundef nonnull align 4 dereferenceable(4)) #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #2 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @m)
  %11 = load i32, ptr @n, align 4, !tbaa !5
  call void @_Z5buildRiii(ptr noundef nonnull align 4 dereferenceable(4) @rt, i32 noundef 1, i32 noundef %11)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %12

12:                                               ; preds = %138, %0
  %13 = load i32, ptr %2, align 4, !tbaa !5
  %14 = load i32, ptr @m, align 4, !tbaa !5
  %15 = icmp sle i32 %13, %14
  br i1 %15, label %17, label %16

16:                                               ; preds = %12
  store i32 2, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #4
  br label %141

17:                                               ; preds = %12
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  %18 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %4)
  %19 = load i32, ptr %4, align 4, !tbaa !5
  %20 = icmp eq i32 %19, 2
  br i1 %20, label %21, label %26

21:                                               ; preds = %17
  %22 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %5)
  %23 = load i32, ptr @_ZZ4mainE7lastans, align 4, !tbaa !5
  %24 = load i32, ptr %5, align 4, !tbaa !5
  %25 = xor i32 %24, %23
  store i32 %25, ptr %5, align 4, !tbaa !5
  br label %34

26:                                               ; preds = %17
  %27 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %5, ptr noundef %6)
  %28 = load i32, ptr @_ZZ4mainE7lastans, align 4, !tbaa !5
  %29 = load i32, ptr %5, align 4, !tbaa !5
  %30 = xor i32 %29, %28
  store i32 %30, ptr %5, align 4, !tbaa !5
  %31 = load i32, ptr @_ZZ4mainE7lastans, align 4, !tbaa !5
  %32 = load i32, ptr %6, align 4, !tbaa !5
  %33 = xor i32 %32, %31
  store i32 %33, ptr %6, align 4, !tbaa !5
  br label %34

34:                                               ; preds = %26, %21
  %35 = load i32, ptr %2, align 4, !tbaa !5
  %36 = sub nsw i32 %35, 1
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [200001 x i32], ptr @rt, i64 0, i64 %37
  %39 = load i32, ptr %38, align 4, !tbaa !5
  %40 = load i32, ptr %2, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [200001 x i32], ptr @rt, i64 0, i64 %41
  store i32 %39, ptr %42, align 4, !tbaa !5
  %43 = load i32, ptr %4, align 4, !tbaa !5
  %44 = icmp eq i32 %43, 1
  br i1 %44, label %45, label %101

45:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  %46 = load i32, ptr %2, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [200001 x i32], ptr @rt, i64 0, i64 %47
  %49 = load i32, ptr %5, align 4, !tbaa !5
  %50 = call noundef i32 @_Z8dsu_findRiiS_(ptr noundef nonnull align 4 dereferenceable(4) %48, i32 noundef %49, ptr noundef nonnull align 4 dereferenceable(4) %7)
  store i32 %50, ptr %5, align 4, !tbaa !5
  %51 = load i32, ptr %2, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [200001 x i32], ptr @rt, i64 0, i64 %52
  %54 = load i32, ptr %6, align 4, !tbaa !5
  %55 = call noundef i32 @_Z8dsu_findRiiS_(ptr noundef nonnull align 4 dereferenceable(4) %53, i32 noundef %54, ptr noundef nonnull align 4 dereferenceable(4) %8)
  store i32 %55, ptr %6, align 4, !tbaa !5
  %56 = load i32, ptr %5, align 4, !tbaa !5
  %57 = load i32, ptr %6, align 4, !tbaa !5
  %58 = icmp eq i32 %56, %57
  br i1 %58, label %59, label %60

59:                                               ; preds = %45
  store i32 4, ptr %3, align 4
  br label %98

60:                                               ; preds = %45
  %61 = load i32, ptr %7, align 4, !tbaa !5
  %62 = load i32, ptr %8, align 4, !tbaa !5
  %63 = icmp slt i32 %61, %62
  br i1 %63, label %64, label %71

64:                                               ; preds = %60
  %65 = load i32, ptr %2, align 4, !tbaa !5
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [200001 x i32], ptr @rt, i64 0, i64 %66
  %68 = load i32, ptr @n, align 4, !tbaa !5
  %69 = load i32, ptr %6, align 4, !tbaa !5
  %70 = load i32, ptr %5, align 4, !tbaa !5
  call void @_Z6updateRiiiii(ptr noundef nonnull align 4 dereferenceable(4) %67, i32 noundef 1, i32 noundef %68, i32 noundef %69, i32 noundef %70)
  br label %97

71:                                               ; preds = %60
  %72 = load i32, ptr %7, align 4, !tbaa !5
  %73 = load i32, ptr %8, align 4, !tbaa !5
  %74 = icmp sgt i32 %72, %73
  br i1 %74, label %75, label %82

75:                                               ; preds = %71
  %76 = load i32, ptr %2, align 4, !tbaa !5
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [200001 x i32], ptr @rt, i64 0, i64 %77
  %79 = load i32, ptr @n, align 4, !tbaa !5
  %80 = load i32, ptr %5, align 4, !tbaa !5
  %81 = load i32, ptr %6, align 4, !tbaa !5
  call void @_Z6updateRiiiii(ptr noundef nonnull align 4 dereferenceable(4) %78, i32 noundef 1, i32 noundef %79, i32 noundef %80, i32 noundef %81)
  br label %96

82:                                               ; preds = %71
  %83 = load i32, ptr %2, align 4, !tbaa !5
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [200001 x i32], ptr @rt, i64 0, i64 %84
  %86 = load i32, ptr @n, align 4, !tbaa !5
  %87 = load i32, ptr %5, align 4, !tbaa !5
  %88 = load i32, ptr %7, align 4, !tbaa !5
  %89 = add nsw i32 %88, -1
  store i32 %89, ptr %7, align 4, !tbaa !5
  call void @_Z6updateRiiiii(ptr noundef nonnull align 4 dereferenceable(4) %85, i32 noundef 1, i32 noundef %86, i32 noundef %87, i32 noundef %89)
  %90 = load i32, ptr %2, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [200001 x i32], ptr @rt, i64 0, i64 %91
  %93 = load i32, ptr @n, align 4, !tbaa !5
  %94 = load i32, ptr %6, align 4, !tbaa !5
  %95 = load i32, ptr %5, align 4, !tbaa !5
  call void @_Z6updateRiiiii(ptr noundef nonnull align 4 dereferenceable(4) %92, i32 noundef 1, i32 noundef %93, i32 noundef %94, i32 noundef %95)
  br label %96

96:                                               ; preds = %82, %75
  br label %97

97:                                               ; preds = %96, %64
  store i32 0, ptr %3, align 4
  br label %98

98:                                               ; preds = %97, %59
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  %99 = load i32, ptr %3, align 4
  switch i32 %99, label %135 [
    i32 0, label %100
  ]

100:                                              ; preds = %98
  br label %134

101:                                              ; preds = %34
  %102 = load i32, ptr %4, align 4, !tbaa !5
  %103 = icmp eq i32 %102, 2
  br i1 %103, label %104, label %112

104:                                              ; preds = %101
  %105 = load i32, ptr %5, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [200001 x i32], ptr @rt, i64 0, i64 %106
  %108 = load i32, ptr %107, align 4, !tbaa !5
  %109 = load i32, ptr %2, align 4, !tbaa !5
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [200001 x i32], ptr @rt, i64 0, i64 %110
  store i32 %108, ptr %111, align 4, !tbaa !5
  br label %133

112:                                              ; preds = %101
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  %113 = load i32, ptr %2, align 4, !tbaa !5
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [200001 x i32], ptr @rt, i64 0, i64 %114
  %116 = load i32, ptr %5, align 4, !tbaa !5
  %117 = call noundef i32 @_Z8dsu_findRiiS_(ptr noundef nonnull align 4 dereferenceable(4) %115, i32 noundef %116, ptr noundef nonnull align 4 dereferenceable(4) %9)
  store i32 %117, ptr %5, align 4, !tbaa !5
  %118 = load i32, ptr %2, align 4, !tbaa !5
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [200001 x i32], ptr @rt, i64 0, i64 %119
  %121 = load i32, ptr %6, align 4, !tbaa !5
  %122 = call noundef i32 @_Z8dsu_findRiiS_(ptr noundef nonnull align 4 dereferenceable(4) %120, i32 noundef %121, ptr noundef nonnull align 4 dereferenceable(4) %9)
  store i32 %122, ptr %6, align 4, !tbaa !5
  %123 = load i32, ptr %5, align 4, !tbaa !5
  %124 = load i32, ptr %6, align 4, !tbaa !5
  %125 = icmp eq i32 %123, %124
  %126 = zext i1 %125 to i32
  store i32 %126, ptr @_ZZ4mainE7lastans, align 4, !tbaa !5
  br i1 %125, label %127, label %128

127:                                              ; preds = %112
  br label %129

128:                                              ; preds = %112
  br label %129

129:                                              ; preds = %128, %127
  %130 = phi ptr [ @.str.2, %127 ], [ @.str.3, %128 ]
  %131 = getelementptr inbounds [2 x i8], ptr %130, i64 0, i64 0
  %132 = call i32 @puts(ptr noundef %131)
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  br label %133

133:                                              ; preds = %129, %104
  br label %134

134:                                              ; preds = %133, %100
  store i32 0, ptr %3, align 4
  br label %135

135:                                              ; preds = %134, %98
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  %136 = load i32, ptr %3, align 4
  switch i32 %136, label %142 [
    i32 0, label %137
    i32 4, label %138
  ]

137:                                              ; preds = %135
  br label %138

138:                                              ; preds = %137, %135
  %139 = load i32, ptr %2, align 4, !tbaa !5
  %140 = add nsw i32 %139, 1
  store i32 %140, ptr %2, align 4, !tbaa !5
  br label %12, !llvm.loop !9

141:                                              ; preds = %16
  ret i32 0

142:                                              ; preds = %135
  unreachable
}

declare i32 @__isoc99_scanf(ptr noundef, ...) #3

declare i32 @puts(ptr noundef) #3

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 = { 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 = { "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 = { 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"}


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

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@rt = external dso_local global [200001 x i32], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@_ZZ4mainE7lastans = external hidden local_unnamed_addr global i32, align 4
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5buildRiii(ptr noundef nonnull align 4 dereferenceable(4), 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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z6updateRiiiii(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z8dsu_findRiiS_(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef, ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 {
  %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 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @m)
  %8 = load i32, ptr @n, align 4, !tbaa !5
  tail call void @_Z5buildRiii(ptr noundef nonnull align 4 dereferenceable(4) @rt, i32 noundef 1, i32 noundef %8)
  %9 = load i32, ptr @m, align 4, !tbaa !5
  %.not21 = icmp slt i32 %9, 1
  br i1 %.not21, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %65, %0
  ret i32 0

.lr.ph:                                           ; preds = %0, %65
  %indvars.iv = phi i64 [ %indvars.iv.next, %65 ], [ 1, %0 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #4
  %10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %1)
  %11 = load i32, ptr %1, align 4, !tbaa !5
  %12 = icmp eq i32 %11, 2
  br i1 %12, label %13, label %18

13:                                               ; preds = %.lr.ph
  %14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %2)
  %15 = load i32, ptr @_ZZ4mainE7lastans, align 4, !tbaa !5
  %16 = load i32, ptr %2, align 4, !tbaa !5
  %17 = xor i32 %16, %15
  br label %25

18:                                               ; preds = %.lr.ph
  %19 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %2, ptr noundef nonnull %3)
  %20 = load i32, ptr @_ZZ4mainE7lastans, align 4, !tbaa !5
  %21 = load i32, ptr %2, align 4, !tbaa !5
  %22 = xor i32 %21, %20
  %23 = load i32, ptr %3, align 4, !tbaa !5
  %24 = xor i32 %23, %20
  store i32 %24, ptr %3, align 4, !tbaa !5
  br label %25

25:                                               ; preds = %18, %13
  %26 = phi i32 [ %17, %13 ], [ %22, %18 ]
  store i32 %26, ptr %2, align 4
  %27 = add nsw i64 %indvars.iv, -1
  %28 = getelementptr inbounds [200001 x i32], ptr @rt, i64 0, i64 %27
  %29 = load i32, ptr %28, align 4, !tbaa !5
  %30 = getelementptr inbounds [200001 x i32], ptr @rt, i64 0, i64 %indvars.iv
  store i32 %29, ptr %30, align 4, !tbaa !5
  %31 = load i32, ptr %1, align 4, !tbaa !5
  switch i32 %31, label %57 [
    i32 1, label %32
    i32 2, label %53
  ]

32:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #4
  %33 = call noundef i32 @_Z8dsu_findRiiS_(ptr noundef nonnull align 4 dereferenceable(4) %30, i32 noundef %26, ptr noundef nonnull align 4 dereferenceable(4) %4)
  store i32 %33, ptr %2, align 4, !tbaa !5
  %34 = load i32, ptr %3, align 4, !tbaa !5
  %35 = call noundef i32 @_Z8dsu_findRiiS_(ptr noundef nonnull align 4 dereferenceable(4) %30, i32 noundef %34, ptr noundef nonnull align 4 dereferenceable(4) %5)
  store i32 %35, ptr %3, align 4, !tbaa !5
  %36 = load i32, ptr %2, align 4, !tbaa !5
  %.not20 = icmp eq i32 %36, %35
  br i1 %.not20, label %.critedge, label %37

37:                                               ; preds = %32
  %38 = load i32, ptr %4, align 4, !tbaa !5
  %39 = load i32, ptr %5, align 4, !tbaa !5
  %40 = icmp slt i32 %38, %39
  br i1 %40, label %41, label %43

41:                                               ; preds = %37
  %42 = load i32, ptr @n, align 4, !tbaa !5
  call void @_Z6updateRiiiii(ptr noundef nonnull align 4 dereferenceable(4) %30, i32 noundef 1, i32 noundef %42, i32 noundef %35, i32 noundef %36)
  br label %52

43:                                               ; preds = %37
  %44 = icmp sgt i32 %38, %39
  %45 = load i32, ptr @n, align 4, !tbaa !5
  br i1 %44, label %46, label %47

46:                                               ; preds = %43
  call void @_Z6updateRiiiii(ptr noundef nonnull align 4 dereferenceable(4) %30, i32 noundef 1, i32 noundef %45, i32 noundef %36, i32 noundef %35)
  br label %52

47:                                               ; preds = %43
  %48 = add nsw i32 %38, -1
  store i32 %48, ptr %4, align 4, !tbaa !5
  call void @_Z6updateRiiiii(ptr noundef nonnull align 4 dereferenceable(4) %30, i32 noundef 1, i32 noundef %45, i32 noundef %36, i32 noundef %48)
  %49 = load i32, ptr @n, align 4, !tbaa !5
  %50 = load i32, ptr %3, align 4, !tbaa !5
  %51 = load i32, ptr %2, align 4, !tbaa !5
  call void @_Z6updateRiiiii(ptr noundef nonnull align 4 dereferenceable(4) %30, i32 noundef 1, i32 noundef %49, i32 noundef %50, i32 noundef %51)
  br label %52

52:                                               ; preds = %41, %47, %46
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #4
  br label %65

53:                                               ; preds = %25
  %54 = sext i32 %26 to i64
  %55 = getelementptr inbounds [200001 x i32], ptr @rt, i64 0, i64 %54
  %56 = load i32, ptr %55, align 4, !tbaa !5
  store i32 %56, ptr %30, align 4, !tbaa !5
  br label %65

57:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #4
  %58 = call noundef i32 @_Z8dsu_findRiiS_(ptr noundef nonnull align 4 dereferenceable(4) %30, i32 noundef %26, ptr noundef nonnull align 4 dereferenceable(4) %6)
  store i32 %58, ptr %2, align 4, !tbaa !5
  %59 = load i32, ptr %3, align 4, !tbaa !5
  %60 = call noundef i32 @_Z8dsu_findRiiS_(ptr noundef nonnull align 4 dereferenceable(4) %30, i32 noundef %59, ptr noundef nonnull align 4 dereferenceable(4) %6)
  store i32 %60, ptr %3, align 4, !tbaa !5
  %61 = load i32, ptr %2, align 4, !tbaa !5
  %62 = icmp eq i32 %61, %60
  %63 = zext i1 %62 to i32
  store i32 %63, ptr @_ZZ4mainE7lastans, align 4, !tbaa !5
  %.str.2..str.3 = select i1 %62, ptr @.str.2, ptr @.str.3
  %64 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.2..str.3)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #4
  br label %65

.critedge:                                        ; preds = %32
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #4
  br label %65

65:                                               ; preds = %52, %57, %53, %.critedge
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #4
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %66 = load i32, ptr @m, align 4, !tbaa !5
  %67 = sext i32 %66 to i64
  %.not.not = icmp slt i64 %indvars.iv, %67
  br i1 %.not.not, label %.lr.ph, label %._crit_edge, !llvm.loop !9
}

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

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

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 = { 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 = { 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 #4 = { 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"}


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