; LLVM IR from tangjz/acm-icpc :: codeforces/complete (547D)

; 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::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"struct.std::pair" = type <{ %"struct.std::_Rb_tree_const_iterator", i8, [7 x i8] }>
%"struct.std::_Rb_tree_const_iterator" = type { ptr }

@out = external dso_local global ptr, align 8
@n = external dso_local global i32, align 4
@x = external dso_local global [200001 x i32], align 16
@y = external dso_local global [200001 x i32], align 16
@ans = external dso_local global [200001 x i32], align 16
@str = external dso_local global [200001 x i8], align 16
@e = external dso_local global [400002 x %"class.std::set"], align 16
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3dfsi(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: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt3setIiSt4lessIiESaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48)) #2 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 uwtable
declare dso_local noundef i64 @_ZNSt3setIiSt4lessIiESaIiEE5eraseERKi(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4)) #0 align 2

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #3 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca %"struct.std::pair", align 8
  %4 = alloca %"struct.std::pair", align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef @n)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %9

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

13:                                               ; preds = %9
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  br label %50

14:                                               ; preds = %9
  %15 = load i32, ptr %2, align 4, !tbaa !5
  %16 = sext i32 %15 to i64
  %17 = getelementptr inbounds i32, ptr @x, i64 %16
  %18 = load i32, ptr %2, align 4, !tbaa !5
  %19 = sext i32 %18 to i64
  %20 = getelementptr inbounds i32, ptr @y, i64 %19
  %21 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef %17, ptr noundef %20)
  %22 = load i32, ptr %2, align 4, !tbaa !5
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds [200001 x i32], ptr @x, i64 0, i64 %23
  %25 = load i32, ptr %24, align 4, !tbaa !5
  %26 = add nsw i32 %25, -1
  store i32 %26, ptr %24, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [400002 x %"class.std::set"], ptr @e, i64 0, i64 %27
  %29 = call { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) %28, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %30 = getelementptr inbounds { ptr, i8 }, ptr %3, i32 0, i32 0
  %31 = extractvalue { ptr, i8 } %29, 0
  store ptr %31, ptr %30, align 8
  %32 = getelementptr inbounds { ptr, i8 }, ptr %3, i32 0, i32 1
  %33 = extractvalue { ptr, i8 } %29, 1
  store i8 %33, ptr %32, align 8
  %34 = load i32, ptr %2, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [200001 x i32], ptr @y, i64 0, i64 %35
  %37 = load i32, ptr %36, align 4, !tbaa !5
  %38 = add nsw i32 %37, -1
  store i32 %38, ptr %36, align 4, !tbaa !5
  %39 = add nsw i32 200001, %38
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [400002 x %"class.std::set"], ptr @e, i64 0, i64 %40
  %42 = call { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) %41, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %43 = getelementptr inbounds { ptr, i8 }, ptr %4, i32 0, i32 0
  %44 = extractvalue { ptr, i8 } %42, 0
  store ptr %44, ptr %43, align 8
  %45 = getelementptr inbounds { ptr, i8 }, ptr %4, i32 0, i32 1
  %46 = extractvalue { ptr, i8 } %42, 1
  store i8 %46, ptr %45, align 8
  br label %47

47:                                               ; preds = %14
  %48 = load i32, ptr %2, align 4, !tbaa !5
  %49 = add nsw i32 %48, 1
  store i32 %49, ptr %2, align 4, !tbaa !5
  br label %9, !llvm.loop !9

50:                                               ; preds = %13
  call void @llvm.memset.p0.i64(ptr align 16 @ans, i8 -1, i64 800004, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %51

51:                                               ; preds = %65, %50
  %52 = load i32, ptr %5, align 4, !tbaa !5
  %53 = icmp slt i32 %52, 400002
  br i1 %53, label %55, label %54

54:                                               ; preds = %51
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  br label %68

55:                                               ; preds = %51
  %56 = load i32, ptr %5, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds [400002 x %"class.std::set"], ptr @e, i64 0, i64 %57
  %59 = call noundef i64 @_ZNKSt3setIiSt4lessIiESaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48) %58) #6
  %60 = and i64 %59, 1
  %61 = icmp ne i64 %60, 0
  br i1 %61, label %62, label %64

62:                                               ; preds = %55
  %63 = load i32, ptr %5, align 4, !tbaa !5
  call void @_Z3dfsi(i32 noundef %63)
  br label %64

64:                                               ; preds = %62, %55
  br label %65

65:                                               ; preds = %64
  %66 = load i32, ptr %5, align 4, !tbaa !5
  %67 = add nsw i32 %66, 1
  store i32 %67, ptr %5, align 4, !tbaa !5
  br label %51, !llvm.loop !11

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

69:                                               ; preds = %104, %68
  %70 = load i32, ptr %6, align 4, !tbaa !5
  %71 = load i32, ptr @n, align 4, !tbaa !5
  %72 = icmp slt i32 %70, %71
  br i1 %72, label %74, label %73

73:                                               ; preds = %69
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %107

74:                                               ; preds = %69
  %75 = load i32, ptr %6, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [200001 x i32], ptr @ans, i64 0, i64 %76
  %78 = load i32, ptr %77, align 4, !tbaa !5
  %79 = icmp eq i32 %78, -1
  br i1 %79, label %80, label %103

80:                                               ; preds = %74
  %81 = load i32, ptr %6, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [200001 x i32], ptr @ans, i64 0, i64 %82
  store i32 1, ptr %83, align 4, !tbaa !5
  %84 = load i32, ptr %6, align 4, !tbaa !5
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [200001 x i32], ptr @x, i64 0, i64 %85
  %87 = load i32, ptr %86, align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [400002 x %"class.std::set"], ptr @e, i64 0, i64 %88
  %90 = call noundef i64 @_ZNSt3setIiSt4lessIiESaIiEE5eraseERKi(ptr noundef nonnull align 8 dereferenceable(48) %89, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %91 = load i32, ptr %6, align 4, !tbaa !5
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [200001 x i32], ptr @y, i64 0, i64 %92
  %94 = load i32, ptr %93, align 4, !tbaa !5
  %95 = add nsw i32 200001, %94
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [400002 x %"class.std::set"], ptr @e, i64 0, i64 %96
  %98 = call noundef i64 @_ZNSt3setIiSt4lessIiESaIiEE5eraseERKi(ptr noundef nonnull align 8 dereferenceable(48) %97, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %99 = load i32, ptr %6, align 4, !tbaa !5
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [200001 x i32], ptr @x, i64 0, i64 %100
  %102 = load i32, ptr %101, align 4, !tbaa !5
  call void @_Z3dfsi(i32 noundef %102)
  br label %103

103:                                              ; preds = %80, %74
  br label %104

104:                                              ; preds = %103
  %105 = load i32, ptr %6, align 4, !tbaa !5
  %106 = add nsw i32 %105, 1
  store i32 %106, ptr %6, align 4, !tbaa !5
  br label %69, !llvm.loop !12

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

108:                                              ; preds = %125, %107
  %109 = load i32, ptr %7, align 4, !tbaa !5
  %110 = load i32, ptr @n, align 4, !tbaa !5
  %111 = icmp slt i32 %109, %110
  br i1 %111, label %113, label %112

112:                                              ; preds = %108
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %128

113:                                              ; preds = %108
  %114 = load ptr, ptr @out, align 8, !tbaa !13
  %115 = load i32, ptr %7, align 4, !tbaa !5
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds [200001 x i32], ptr @ans, i64 0, i64 %116
  %118 = load i32, ptr %117, align 4, !tbaa !5
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds i8, ptr %114, i64 %119
  %121 = load i8, ptr %120, align 1, !tbaa !15
  %122 = load i32, ptr %7, align 4, !tbaa !5
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds [200001 x i8], ptr @str, i64 0, i64 %123
  store i8 %121, ptr %124, align 1, !tbaa !15
  br label %125

125:                                              ; preds = %113
  %126 = load i32, ptr %7, align 4, !tbaa !5
  %127 = add nsw i32 %126, 1
  store i32 %127, ptr %7, align 4, !tbaa !5
  br label %108, !llvm.loop !16

128:                                              ; preds = %112
  %129 = load i32, ptr @n, align 4, !tbaa !5
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [200001 x i8], ptr @str, i64 0, i64 %130
  store i8 0, ptr %131, align 1, !tbaa !15
  %132 = call i32 @puts(ptr noundef @str)
  ret i32 0
}

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

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4)) #0 align 2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5

declare i32 @puts(ptr noundef) #4

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 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 = { "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: write) }
attributes #6 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = !{!14, !14, i64 0}
!14 = !{!"any pointer", !7, i64 0}
!15 = !{!7, !7, i64 0}
!16 = distinct !{!16, !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::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }

@out = external dso_local local_unnamed_addr global ptr, align 8
@n = external dso_local global i32, align 4
@x = external dso_local global [200001 x i32], align 16
@y = external dso_local global [200001 x i32], align 16
@ans = external dso_local local_unnamed_addr global [200001 x i32], align 16
@str = external dso_local global [200001 x i8], align 16
@e = external dso_local global [400002 x %"class.std::set"], align 16
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3dfsi(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 nounwind uwtable
declare dso_local noundef i64 @_ZNKSt3setIiSt4lessIiESaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #2 align 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 uwtable
declare dso_local noundef i64 @_ZNSt3setIiSt4lessIiESaIiEE5eraseERKi(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #0 align 2

; 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
  %3 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @n)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  store i32 0, ptr %1, align 4, !tbaa !5
  %4 = load i32, ptr @n, align 4, !tbaa !5
  %5 = icmp sgt i32 %4, 0
  br i1 %5, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(800004) @ans, i8 -1, i64 800004, i1 false)
  br label %34

.lr.ph:                                           ; preds = %0, %.lr.ph
  %storemerge15 = phi i32 [ %28, %.lr.ph ], [ 0, %0 ]
  %6 = sext i32 %storemerge15 to i64
  %7 = getelementptr inbounds i32, ptr @x, i64 %6
  %8 = getelementptr inbounds i32, ptr @y, i64 %6
  %9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %7, ptr noundef nonnull %8)
  %10 = load i32, ptr %1, align 4, !tbaa !5
  %11 = sext i32 %10 to i64
  %12 = getelementptr inbounds [200001 x i32], ptr @x, i64 0, i64 %11
  %13 = load i32, ptr %12, align 4, !tbaa !5
  %14 = add nsw i32 %13, -1
  store i32 %14, ptr %12, align 4, !tbaa !5
  %15 = sext i32 %14 to i64
  %16 = getelementptr inbounds [400002 x %"class.std::set"], ptr @e, i64 0, i64 %15
  %17 = call { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) %16, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %18 = load i32, ptr %1, align 4, !tbaa !5
  %19 = sext i32 %18 to i64
  %20 = getelementptr inbounds [200001 x i32], ptr @y, i64 0, i64 %19
  %21 = load i32, ptr %20, align 4, !tbaa !5
  %22 = add nsw i32 %21, -1
  store i32 %22, ptr %20, align 4, !tbaa !5
  %23 = add nsw i32 %21, 200000
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds [400002 x %"class.std::set"], ptr @e, i64 0, i64 %24
  %26 = call { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) %25, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %27 = load i32, ptr %1, align 4, !tbaa !5
  %28 = add nsw i32 %27, 1
  store i32 %28, ptr %1, align 4, !tbaa !5
  %29 = load i32, ptr @n, align 4, !tbaa !5
  %30 = icmp slt i32 %28, %29
  br i1 %30, label %.lr.ph, label %._crit_edge, !llvm.loop !9

31:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  store i32 0, ptr %2, align 4, !tbaa !5
  %32 = load i32, ptr @n, align 4, !tbaa !5
  %33 = icmp sgt i32 %32, 0
  br i1 %33, label %.lr.ph19, label %._crit_edge20.thread

._crit_edge20.thread:                             ; preds = %31
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  br label %._crit_edge24

34:                                               ; preds = %._crit_edge, %40
  %indvars.iv = phi i64 [ 0, %._crit_edge ], [ %indvars.iv.next, %40 ]
  %35 = getelementptr inbounds [400002 x %"class.std::set"], ptr @e, i64 0, i64 %indvars.iv
  %36 = call noundef i64 @_ZNKSt3setIiSt4lessIiESaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48) %35) #6
  %37 = and i64 %36, 1
  %.not = icmp eq i64 %37, 0
  br i1 %.not, label %40, label %38

38:                                               ; preds = %34
  %39 = trunc nuw nsw i64 %indvars.iv to i32
  call void @_Z3dfsi(i32 noundef %39)
  br label %40

40:                                               ; preds = %34, %38
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 400002
  br i1 %exitcond.not, label %31, label %34, !llvm.loop !11

._crit_edge20:                                    ; preds = %67
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  %41 = icmp sgt i32 %68, 0
  br i1 %41, label %.lr.ph23, label %._crit_edge24

.lr.ph23:                                         ; preds = %._crit_edge20
  %42 = load ptr, ptr @out, align 8, !tbaa !12
  %wide.trip.count = zext nneg i32 %68 to i64
  %xtraiter = and i64 %wide.trip.count, 3
  %43 = icmp ult i32 %68, 4
  br i1 %43, label %._crit_edge24.loopexit.unr-lcssa, label %.lr.ph23.new

.lr.ph23.new:                                     ; preds = %.lr.ph23
  %unroll_iter = and i64 %wide.trip.count, 2147483644
  br label %81

.lr.ph19:                                         ; preds = %31, %67
  %44 = phi i32 [ %68, %67 ], [ %32, %31 ]
  %storemerge1417 = phi i32 [ %70, %67 ], [ 0, %31 ]
  %45 = sext i32 %storemerge1417 to i64
  %46 = getelementptr inbounds [200001 x i32], ptr @ans, i64 0, i64 %45
  %47 = load i32, ptr %46, align 4, !tbaa !5
  %48 = icmp eq i32 %47, -1
  br i1 %48, label %49, label %67

49:                                               ; preds = %.lr.ph19
  store i32 1, ptr %46, align 4, !tbaa !5
  %50 = getelementptr inbounds [200001 x i32], ptr @x, i64 0, i64 %45
  %51 = load i32, ptr %50, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [400002 x %"class.std::set"], ptr @e, i64 0, i64 %52
  %54 = call noundef i64 @_ZNSt3setIiSt4lessIiESaIiEE5eraseERKi(ptr noundef nonnull align 8 dereferenceable(48) %53, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %55 = load i32, ptr %2, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [200001 x i32], ptr @y, i64 0, i64 %56
  %58 = load i32, ptr %57, align 4, !tbaa !5
  %59 = add nsw i32 %58, 200001
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [400002 x %"class.std::set"], ptr @e, i64 0, i64 %60
  %62 = call noundef i64 @_ZNSt3setIiSt4lessIiESaIiEE5eraseERKi(ptr noundef nonnull align 8 dereferenceable(48) %61, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %63 = load i32, ptr %2, align 4, !tbaa !5
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [200001 x i32], ptr @x, i64 0, i64 %64
  %66 = load i32, ptr %65, align 4, !tbaa !5
  call void @_Z3dfsi(i32 noundef %66)
  %.pre = load i32, ptr %2, align 4, !tbaa !5
  %.pre31 = load i32, ptr @n, align 4, !tbaa !5
  br label %67

67:                                               ; preds = %.lr.ph19, %49
  %68 = phi i32 [ %44, %.lr.ph19 ], [ %.pre31, %49 ]
  %69 = phi i32 [ %storemerge1417, %.lr.ph19 ], [ %.pre, %49 ]
  %70 = add nsw i32 %69, 1
  store i32 %70, ptr %2, align 4, !tbaa !5
  %71 = icmp slt i32 %70, %68
  br i1 %71, label %.lr.ph19, label %._crit_edge20, !llvm.loop !14

._crit_edge24.loopexit.unr-lcssa:                 ; preds = %81, %.lr.ph23
  %indvars.iv27.unr = phi i64 [ 0, %.lr.ph23 ], [ %indvars.iv.next28.3, %81 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge24, label %.epil.preheader

.epil.preheader:                                  ; preds = %._crit_edge24.loopexit.unr-lcssa, %.epil.preheader
  %indvars.iv27.epil = phi i64 [ %indvars.iv.next28.epil, %.epil.preheader ], [ %indvars.iv27.unr, %._crit_edge24.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.epil.preheader ], [ 0, %._crit_edge24.loopexit.unr-lcssa ]
  %72 = getelementptr inbounds [200001 x i32], ptr @ans, i64 0, i64 %indvars.iv27.epil
  %73 = load i32, ptr %72, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds i8, ptr %42, i64 %74
  %76 = load i8, ptr %75, align 1, !tbaa !15
  %77 = getelementptr inbounds [200001 x i8], ptr @str, i64 0, i64 %indvars.iv27.epil
  store i8 %76, ptr %77, align 1, !tbaa !15
  %indvars.iv.next28.epil = add nuw nsw i64 %indvars.iv27.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %._crit_edge24, label %.epil.preheader, !llvm.loop !16

._crit_edge24:                                    ; preds = %._crit_edge24.loopexit.unr-lcssa, %.epil.preheader, %._crit_edge20.thread, %._crit_edge20
  %.lcssa33 = phi i32 [ %32, %._crit_edge20.thread ], [ %68, %._crit_edge20 ], [ %68, %.epil.preheader ], [ %68, %._crit_edge24.loopexit.unr-lcssa ]
  %78 = sext i32 %.lcssa33 to i64
  %79 = getelementptr inbounds [200001 x i8], ptr @str, i64 0, i64 %78
  store i8 0, ptr %79, align 1, !tbaa !15
  %80 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @str)
  ret i32 0

81:                                               ; preds = %81, %.lr.ph23.new
  %indvars.iv27 = phi i64 [ 0, %.lr.ph23.new ], [ %indvars.iv.next28.3, %81 ]
  %niter = phi i64 [ 0, %.lr.ph23.new ], [ %niter.next.3, %81 ]
  %82 = getelementptr inbounds [200001 x i32], ptr @ans, i64 0, i64 %indvars.iv27
  %83 = load i32, ptr %82, align 16, !tbaa !5
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds i8, ptr %42, i64 %84
  %86 = load i8, ptr %85, align 1, !tbaa !15
  %87 = getelementptr inbounds [200001 x i8], ptr @str, i64 0, i64 %indvars.iv27
  store i8 %86, ptr %87, align 4, !tbaa !15
  %indvars.iv.next28 = or disjoint i64 %indvars.iv27, 1
  %88 = getelementptr inbounds [200001 x i32], ptr @ans, i64 0, i64 %indvars.iv.next28
  %89 = load i32, ptr %88, align 4, !tbaa !5
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds i8, ptr %42, i64 %90
  %92 = load i8, ptr %91, align 1, !tbaa !15
  %93 = getelementptr inbounds [200001 x i8], ptr @str, i64 0, i64 %indvars.iv.next28
  store i8 %92, ptr %93, align 1, !tbaa !15
  %indvars.iv.next28.1 = or disjoint i64 %indvars.iv27, 2
  %94 = getelementptr inbounds [200001 x i32], ptr @ans, i64 0, i64 %indvars.iv.next28.1
  %95 = load i32, ptr %94, align 8, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds i8, ptr %42, i64 %96
  %98 = load i8, ptr %97, align 1, !tbaa !15
  %99 = getelementptr inbounds [200001 x i8], ptr @str, i64 0, i64 %indvars.iv.next28.1
  store i8 %98, ptr %99, align 2, !tbaa !15
  %indvars.iv.next28.2 = or disjoint i64 %indvars.iv27, 3
  %100 = getelementptr inbounds [200001 x i32], ptr @ans, i64 0, i64 %indvars.iv.next28.2
  %101 = load i32, ptr %100, align 4, !tbaa !5
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds i8, ptr %42, i64 %102
  %104 = load i8, ptr %103, align 1, !tbaa !15
  %105 = getelementptr inbounds [200001 x i8], ptr @str, i64 0, i64 %indvars.iv.next28.2
  store i8 %104, ptr %105, align 1, !tbaa !15
  %indvars.iv.next28.3 = add nuw nsw i64 %indvars.iv27, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %._crit_edge24.loopexit.unr-lcssa, label %81, !llvm.loop !18
}

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

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5

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

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 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 = { 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 #5 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = !{!13, !13, i64 0}
!13 = !{!"any pointer", !7, i64 0}
!14 = distinct !{!14, !10}
!15 = !{!7, !7, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.unroll.disable"}
!18 = distinct !{!18, !10}


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