; LLVM IR from Izaron/ACM-ICPC :: Timus Online Judge/Volume 3/1210. Kind Spirits (main)

; 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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::pair<long long, long long>, std::allocator<std::pair<long long, long long>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<long long, long long>, std::allocator<std::pair<long long, long long>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<long long, long long>, std::allocator<std::pair<long long, long long>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<long long, long long>, std::allocator<std::pair<long long, long long>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"struct.std::pair" = type { i64, i64 }
%"struct.std::pair.0" = type { i32, i32 }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }

@n = external dso_local global i32, align 4
@g = external dso_local global [35 x [35 x %"class.std::vector"]], align 16
@ans = external dso_local global [35 x i64], align 16
@ansid = external dso_local global [35 x [35 x i64]], align 16
@ansed = external dso_local global i64, align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3dfsiix(i32 noundef, i32 noundef, i64 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 norecurse uwtable
define dso_local noundef i32 @main() #2 personality ptr @__gxx_personality_v0 {
  %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
  %10 = alloca %"struct.std::pair", align 8
  %11 = alloca %"struct.std::pair.0", align 4
  %12 = alloca %"class.std::__cxx11::basic_string", align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %15

15:                                               ; preds = %38, %0
  %16 = load i32, ptr %2, align 4, !tbaa !5
  %17 = icmp slt i32 %16, 35
  br i1 %17, label %19, label %18

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

19:                                               ; preds = %15
  %20 = load i32, ptr %2, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds [35 x i64], ptr @ans, i64 0, i64 %21
  store i64 1000000000000, ptr %22, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %23

23:                                               ; preds = %34, %19
  %24 = load i32, ptr %4, align 4, !tbaa !5
  %25 = icmp slt i32 %24, 35
  br i1 %25, label %27, label %26

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

27:                                               ; preds = %23
  %28 = load i32, ptr %2, align 4, !tbaa !5
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds [35 x [35 x i64]], ptr @ansid, i64 0, i64 %29
  %31 = load i32, ptr %4, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [35 x i64], ptr %30, i64 0, i64 %32
  store i64 1000000000000, ptr %33, align 8, !tbaa !9
  br label %34

34:                                               ; preds = %27
  %35 = load i32, ptr %4, align 4, !tbaa !5
  %36 = add nsw i32 %35, 1
  store i32 %36, ptr %4, align 4, !tbaa !5
  br label %23, !llvm.loop !11

37:                                               ; preds = %26
  br label %38

38:                                               ; preds = %37
  %39 = load i32, ptr %2, align 4, !tbaa !5
  %40 = add nsw i32 %39, 1
  store i32 %40, ptr %2, align 4, !tbaa !5
  br label %15, !llvm.loop !13

41:                                               ; preds = %18
  %42 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @n)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  store i32 1, ptr %5, align 4, !tbaa !5
  br label %43

43:                                               ; preds = %95, %41
  %44 = load i32, ptr %5, align 4, !tbaa !5
  %45 = load i32, ptr @n, align 4, !tbaa !5
  %46 = icmp sle i32 %44, %45
  br i1 %46, label %48, label %47

47:                                               ; preds = %43
  store i32 8, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br label %98

48:                                               ; preds = %43
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  %49 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %6)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %50

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

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

55:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  br label %56

56:                                               ; preds = %67, %55
  %57 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %8)
  %58 = load ptr, ptr %57, align 8, !tbaa !14
  %59 = getelementptr i8, ptr %58, i64 -24
  %60 = load i64, ptr %59, align 8
  %61 = getelementptr inbounds i8, ptr %57, i64 %60
  %62 = call noundef zeroext i1 @_ZNKSt9basic_iosIcSt11char_traitsIcEEcvbEv(ptr noundef nonnull align 8 dereferenceable(264) %61)
  br i1 %62, label %63, label %79

63:                                               ; preds = %56
  %64 = load i32, ptr %8, align 4, !tbaa !5
  %65 = icmp eq i32 %64, 0
  br i1 %65, label %66, label %67

66:                                               ; preds = %63
  br label %79

67:                                               ; preds = %63
  %68 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %9)
  %69 = load i32, ptr %8, align 4, !tbaa !5
  %70 = add nsw i32 %69, -1
  store i32 %70, ptr %8, align 4, !tbaa !5
  %71 = load i32, ptr %5, align 4, !tbaa !5
  %72 = sub nsw i32 %71, 1
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [35 x [35 x %"class.std::vector"]], ptr @g, i64 0, i64 %73
  %75 = load i32, ptr %8, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [35 x %"class.std::vector"], ptr %74, i64 0, i64 %76
  call void @llvm.lifetime.start.p0(i64 16, ptr %10) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %78 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %9)
  store i64 %78, ptr %11, align 4
  call void @_ZNSt4pairIxxEC2IiiTnNSt9enable_ifIXaaclsr6_PCCFPIT_T0_EE22_MoveConstructiblePairIS3_S4_EEclsr6_PCCFPIS3_S4_EE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS_IS3_S4_E(ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef nonnull align 4 dereferenceable(8) %11)
  call void @_ZNSt6vectorISt4pairIxxESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %77, ptr noundef nonnull align 8 dereferenceable(16) %10)
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #5
  br label %56, !llvm.loop !16

79:                                               ; preds = %66, %56
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %80

80:                                               ; preds = %79
  %81 = load i32, ptr %7, align 4, !tbaa !5
  %82 = add nsw i32 %81, 1
  store i32 %82, ptr %7, align 4, !tbaa !5
  br label %50, !llvm.loop !17

83:                                               ; preds = %54
  %84 = load i32, ptr %5, align 4, !tbaa !5
  %85 = load i32, ptr @n, align 4, !tbaa !5
  %86 = icmp ne i32 %84, %85
  br i1 %86, label %87, label %94

87:                                               ; preds = %83
  call void @llvm.lifetime.start.p0(i64 32, ptr %12) #5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #5
  %88 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(32) %12)
          to label %89 unwind label %90

89:                                               ; preds = %87
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #5
  br label %94

90:                                               ; preds = %87
  %91 = landingpad { ptr, i32 }
          cleanup
  %92 = extractvalue { ptr, i32 } %91, 0
  store ptr %92, ptr %13, align 8
  %93 = extractvalue { ptr, i32 } %91, 1
  store i32 %93, ptr %14, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br label %102

94:                                               ; preds = %89, %83
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %95

95:                                               ; preds = %94
  %96 = load i32, ptr %5, align 4, !tbaa !5
  %97 = add nsw i32 %96, 1
  store i32 %97, ptr %5, align 4, !tbaa !5
  br label %43, !llvm.loop !18

98:                                               ; preds = %47
  call void @_Z3dfsiix(i32 noundef 0, i32 noundef 0, i64 noundef 0)
  %99 = load i64, ptr @ansed, align 8, !tbaa !9
  %100 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %99)
  %101 = load i32, ptr %1, align 4
  ret i32 %101

102:                                              ; preds = %90
  %103 = load ptr, ptr %13, align 8
  %104 = load i32, ptr %14, align 4
  %105 = insertvalue { ptr, i32 } poison, ptr %103, 0
  %106 = insertvalue { ptr, i32 } %105, i32 %104, 1
  resume { ptr, i32 } %106
}

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

; Function Attrs: mustprogress uwtable
declare noundef zeroext i1 @_ZNKSt9basic_iosIcSt11char_traitsIcEEcvbEv(ptr noundef nonnull align 8 dereferenceable(264)) #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorISt4pairIxxESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(16)) #0 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt4pairIxxEC2IiiTnNSt9enable_ifIXaaclsr6_PCCFPIT_T0_EE22_MoveConstructiblePairIS3_S4_EEclsr6_PCCFPIS3_S4_EE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS_IS3_S4_E(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(8)) unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #4 align 2

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(32)) #3

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #4 align 2

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

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 = { 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 = { 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 = !{!"long long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = !{!15, !15, i64 0}
!15 = !{!"vtable pointer", !8, i64 0}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}


; 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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::pair<long long, long long>, std::allocator<std::pair<long long, long long>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<long long, long long>, std::allocator<std::pair<long long, long long>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<long long, long long>, std::allocator<std::pair<long long, long long>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<long long, long long>, std::allocator<std::pair<long long, long long>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"struct.std::pair" = type { i64, i64 }
%"struct.std::pair.0" = type { i32, i32 }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }

@n = external dso_local global i32, align 4
@g = external dso_local global [35 x [35 x %"class.std::vector"]], align 16
@ans = external dso_local local_unnamed_addr global [35 x i64], align 16
@ansid = external dso_local local_unnamed_addr global [35 x [35 x i64]], align 16
@ansed = external dso_local local_unnamed_addr global i64, align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3dfsiix(i32 noundef, i32 noundef, i64 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 norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca %"struct.std::pair", align 8
  %6 = alloca %"struct.std::pair.0", align 8
  %7 = alloca %"class.std::__cxx11::basic_string", align 8
  br label %11

8:                                                ; preds = %11
  %9 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @n)
  %10 = load i32, ptr @n, align 4, !tbaa !5
  %.not1625 = icmp slt i32 %10, 1
  br i1 %.not1625, label %._crit_edge29, label %.lr.ph28

11:                                               ; preds = %0, %11
  %indvars.iv = phi i64 [ 0, %0 ], [ %indvars.iv.next, %11 ]
  %12 = getelementptr inbounds [35 x i64], ptr @ans, i64 0, i64 %indvars.iv
  store i64 1000000000000, ptr %12, align 8, !tbaa !9
  %13 = getelementptr inbounds [35 x [35 x i64]], ptr @ansid, i64 0, i64 %indvars.iv, i64 0
  store i64 1000000000000, ptr %13, align 8, !tbaa !9
  %14 = getelementptr inbounds [35 x [35 x i64]], ptr @ansid, i64 0, i64 %indvars.iv, i64 1
  store i64 1000000000000, ptr %14, align 8, !tbaa !9
  %15 = getelementptr inbounds [35 x [35 x i64]], ptr @ansid, i64 0, i64 %indvars.iv, i64 2
  store i64 1000000000000, ptr %15, align 8, !tbaa !9
  %16 = getelementptr inbounds [35 x [35 x i64]], ptr @ansid, i64 0, i64 %indvars.iv, i64 3
  store i64 1000000000000, ptr %16, align 8, !tbaa !9
  %17 = getelementptr inbounds [35 x [35 x i64]], ptr @ansid, i64 0, i64 %indvars.iv, i64 4
  store i64 1000000000000, ptr %17, align 8, !tbaa !9
  %18 = getelementptr inbounds [35 x [35 x i64]], ptr @ansid, i64 0, i64 %indvars.iv, i64 5
  store i64 1000000000000, ptr %18, align 8, !tbaa !9
  %19 = getelementptr inbounds [35 x [35 x i64]], ptr @ansid, i64 0, i64 %indvars.iv, i64 6
  store i64 1000000000000, ptr %19, align 8, !tbaa !9
  %20 = getelementptr inbounds [35 x [35 x i64]], ptr @ansid, i64 0, i64 %indvars.iv, i64 7
  store i64 1000000000000, ptr %20, align 8, !tbaa !9
  %21 = getelementptr inbounds [35 x [35 x i64]], ptr @ansid, i64 0, i64 %indvars.iv, i64 8
  store i64 1000000000000, ptr %21, align 8, !tbaa !9
  %22 = getelementptr inbounds [35 x [35 x i64]], ptr @ansid, i64 0, i64 %indvars.iv, i64 9
  store i64 1000000000000, ptr %22, align 8, !tbaa !9
  %23 = getelementptr inbounds [35 x [35 x i64]], ptr @ansid, i64 0, i64 %indvars.iv, i64 10
  store i64 1000000000000, ptr %23, align 8, !tbaa !9
  %24 = getelementptr inbounds [35 x [35 x i64]], ptr @ansid, i64 0, i64 %indvars.iv, i64 11
  store i64 1000000000000, ptr %24, align 8, !tbaa !9
  %25 = getelementptr inbounds [35 x [35 x i64]], ptr @ansid, i64 0, i64 %indvars.iv, i64 12
  store i64 1000000000000, ptr %25, align 8, !tbaa !9
  %26 = getelementptr inbounds [35 x [35 x i64]], ptr @ansid, i64 0, i64 %indvars.iv, i64 13
  store i64 1000000000000, ptr %26, align 8, !tbaa !9
  %27 = getelementptr inbounds [35 x [35 x i64]], ptr @ansid, i64 0, i64 %indvars.iv, i64 14
  store i64 1000000000000, ptr %27, align 8, !tbaa !9
  %28 = getelementptr inbounds [35 x [35 x i64]], ptr @ansid, i64 0, i64 %indvars.iv, i64 15
  store i64 1000000000000, ptr %28, align 8, !tbaa !9
  %29 = getelementptr inbounds [35 x [35 x i64]], ptr @ansid, i64 0, i64 %indvars.iv, i64 16
  store i64 1000000000000, ptr %29, align 8, !tbaa !9
  %30 = getelementptr inbounds [35 x [35 x i64]], ptr @ansid, i64 0, i64 %indvars.iv, i64 17
  store i64 1000000000000, ptr %30, align 8, !tbaa !9
  %31 = getelementptr inbounds [35 x [35 x i64]], ptr @ansid, i64 0, i64 %indvars.iv, i64 18
  store i64 1000000000000, ptr %31, align 8, !tbaa !9
  %32 = getelementptr inbounds [35 x [35 x i64]], ptr @ansid, i64 0, i64 %indvars.iv, i64 19
  store i64 1000000000000, ptr %32, align 8, !tbaa !9
  %33 = getelementptr inbounds [35 x [35 x i64]], ptr @ansid, i64 0, i64 %indvars.iv, i64 20
  store i64 1000000000000, ptr %33, align 8, !tbaa !9
  %34 = getelementptr inbounds [35 x [35 x i64]], ptr @ansid, i64 0, i64 %indvars.iv, i64 21
  store i64 1000000000000, ptr %34, align 8, !tbaa !9
  %35 = getelementptr inbounds [35 x [35 x i64]], ptr @ansid, i64 0, i64 %indvars.iv, i64 22
  store i64 1000000000000, ptr %35, align 8, !tbaa !9
  %36 = getelementptr inbounds [35 x [35 x i64]], ptr @ansid, i64 0, i64 %indvars.iv, i64 23
  store i64 1000000000000, ptr %36, align 8, !tbaa !9
  %37 = getelementptr inbounds [35 x [35 x i64]], ptr @ansid, i64 0, i64 %indvars.iv, i64 24
  store i64 1000000000000, ptr %37, align 8, !tbaa !9
  %38 = getelementptr inbounds [35 x [35 x i64]], ptr @ansid, i64 0, i64 %indvars.iv, i64 25
  store i64 1000000000000, ptr %38, align 8, !tbaa !9
  %39 = getelementptr inbounds [35 x [35 x i64]], ptr @ansid, i64 0, i64 %indvars.iv, i64 26
  store i64 1000000000000, ptr %39, align 8, !tbaa !9
  %40 = getelementptr inbounds [35 x [35 x i64]], ptr @ansid, i64 0, i64 %indvars.iv, i64 27
  store i64 1000000000000, ptr %40, align 8, !tbaa !9
  %41 = getelementptr inbounds [35 x [35 x i64]], ptr @ansid, i64 0, i64 %indvars.iv, i64 28
  store i64 1000000000000, ptr %41, align 8, !tbaa !9
  %42 = getelementptr inbounds [35 x [35 x i64]], ptr @ansid, i64 0, i64 %indvars.iv, i64 29
  store i64 1000000000000, ptr %42, align 8, !tbaa !9
  %43 = getelementptr inbounds [35 x [35 x i64]], ptr @ansid, i64 0, i64 %indvars.iv, i64 30
  store i64 1000000000000, ptr %43, align 8, !tbaa !9
  %44 = getelementptr inbounds [35 x [35 x i64]], ptr @ansid, i64 0, i64 %indvars.iv, i64 31
  store i64 1000000000000, ptr %44, align 8, !tbaa !9
  %45 = getelementptr inbounds [35 x [35 x i64]], ptr @ansid, i64 0, i64 %indvars.iv, i64 32
  store i64 1000000000000, ptr %45, align 8, !tbaa !9
  %46 = getelementptr inbounds [35 x [35 x i64]], ptr @ansid, i64 0, i64 %indvars.iv, i64 33
  store i64 1000000000000, ptr %46, align 8, !tbaa !9
  %47 = getelementptr inbounds [35 x [35 x i64]], ptr @ansid, i64 0, i64 %indvars.iv, i64 34
  store i64 1000000000000, ptr %47, align 8, !tbaa !9
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 35
  br i1 %exitcond.not, label %8, label %11, !llvm.loop !11

._crit_edge29:                                    ; preds = %88, %8
  call void @_Z3dfsiix(i32 noundef 0, i32 noundef 0, i64 noundef 0)
  %48 = load i64, ptr @ansed, align 8, !tbaa !9
  %49 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %48)
  ret i32 0

.lr.ph28:                                         ; preds = %8, %88
  %indvars.iv32 = phi i64 [ %indvars.iv.next33, %88 ], [ 1, %8 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  %50 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #5
  store i32 0, ptr %2, align 4, !tbaa !5
  %51 = load i32, ptr %1, align 4, !tbaa !5
  %52 = icmp sgt i32 %51, 0
  br i1 %52, label %.lr.ph23, label %._crit_edge24

.lr.ph23:                                         ; preds = %.lr.ph28
  %53 = add nsw i64 %indvars.iv32, -1
  br label %56

._crit_edge24:                                    ; preds = %._crit_edge, %.lr.ph28
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #5
  %54 = load i32, ptr @n, align 4, !tbaa !5
  %55 = zext i32 %54 to i64
  %.not17 = icmp eq i64 %indvars.iv32, %55
  br i1 %.not17, label %88, label %83

56:                                               ; preds = %.lr.ph23, %._crit_edge
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #5
  %57 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %58 = load ptr, ptr %57, align 8, !tbaa !13
  %59 = getelementptr i8, ptr %58, i64 -24
  %60 = load i64, ptr %59, align 8
  %61 = getelementptr inbounds i8, ptr %57, i64 %60
  %62 = call noundef zeroext i1 @_ZNKSt9basic_iosIcSt11char_traitsIcEEcvbEv(ptr noundef nonnull align 8 dereferenceable(264) %61)
  %63 = load i32, ptr %3, align 4
  %64 = icmp ne i32 %63, 0
  %or.cond.not21 = select i1 %62, i1 %64, i1 false
  br i1 %or.cond.not21, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %56, %.lr.ph
  %65 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %66 = load i32, ptr %3, align 4, !tbaa !5
  %67 = add nsw i32 %66, -1
  store i32 %67, ptr %3, align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [35 x [35 x %"class.std::vector"]], ptr @g, i64 0, i64 %53, i64 %68
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #5
  %70 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %4)
  store i64 %70, ptr %6, align 8
  call void @_ZNSt4pairIxxEC2IiiTnNSt9enable_ifIXaaclsr6_PCCFPIT_T0_EE22_MoveConstructiblePairIS3_S4_EEclsr6_PCCFPIS3_S4_EE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS_IS3_S4_E(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 4 dereferenceable(8) %6)
  call void @_ZNSt6vectorISt4pairIxxESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %69, ptr noundef nonnull align 8 dereferenceable(16) %5)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #5
  %71 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %72 = load ptr, ptr %71, align 8, !tbaa !13
  %73 = getelementptr i8, ptr %72, i64 -24
  %74 = load i64, ptr %73, align 8
  %75 = getelementptr inbounds i8, ptr %71, i64 %74
  %76 = call noundef zeroext i1 @_ZNKSt9basic_iosIcSt11char_traitsIcEEcvbEv(ptr noundef nonnull align 8 dereferenceable(264) %75)
  %77 = load i32, ptr %3, align 4
  %78 = icmp ne i32 %77, 0
  %or.cond.not = select i1 %76, i1 %78, i1 false
  br i1 %or.cond.not, label %.lr.ph, label %._crit_edge, !llvm.loop !15

._crit_edge:                                      ; preds = %.lr.ph, %56
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #5
  %79 = load i32, ptr %2, align 4, !tbaa !5
  %80 = add nsw i32 %79, 1
  store i32 %80, ptr %2, align 4, !tbaa !5
  %81 = load i32, ptr %1, align 4, !tbaa !5
  %82 = icmp slt i32 %80, %81
  br i1 %82, label %56, label %._crit_edge24, !llvm.loop !16

83:                                               ; preds = %._crit_edge24
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %7) #5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #5
  %84 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(32) %7)
          to label %85 unwind label %86

85:                                               ; preds = %83
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #5
  %.pre = load i32, ptr @n, align 4, !tbaa !5
  br label %88

86:                                               ; preds = %83
  %87 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  resume { ptr, i32 } %87

88:                                               ; preds = %85, %._crit_edge24
  %89 = phi i32 [ %.pre, %85 ], [ %54, %._crit_edge24 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  %indvars.iv.next33 = add nuw nsw i64 %indvars.iv32, 1
  %90 = sext i32 %89 to i64
  %.not16.not = icmp slt i64 %indvars.iv32, %90
  br i1 %.not16.not, label %.lr.ph28, label %._crit_edge29, !llvm.loop !17
}

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

; Function Attrs: mustprogress uwtable
declare noundef zeroext i1 @_ZNKSt9basic_iosIcSt11char_traitsIcEEcvbEv(ptr noundef nonnull align 8 dereferenceable(264)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorISt4pairIxxESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt4pairIxxEC2IiiTnNSt9enable_ifIXaaclsr6_PCCFPIT_T0_EE22_MoveConstructiblePairIS3_S4_EEclsr6_PCCFPIS3_S4_EE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS_IS3_S4_E(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(8)) unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #4 align 2

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #3

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #4 align 2

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

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 = { "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 = { 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 = !{!"long long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !14, i64 0}
!14 = !{!"vtable pointer", !8, i64 0}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}


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