; LLVM IR from Tunghohin/Competitive_Coding :: Uva (uva1391)

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

@age = external dso_local global [100010 x i32], align 16
@head = external dso_local global [200020 x i32], align 16
@tot = external dso_local global i32, align 4
@dfn = external dso_local global [200020 x i32], align 16
@timestamp = external dso_local global i32, align 4
@top = external dso_local global i32, align 4
@in_stk = external dso_local global [200020 x i8], align 16
@scc_cnt = external dso_local global i32, align 4
@scc_id = external dso_local global [200020 x i32], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [14 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z8add_edgeii(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 noundef zeroext i1 @_Z7two_sati(i32 noundef) #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 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 i32, align 4
  store i32 0, ptr %1, align 4
  %11 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %12 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %13 = getelementptr i8, ptr %12, i64 -24
  %14 = load i64, ptr %13, align 8
  %15 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %14
  %16 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %15, ptr noundef null)
  %17 = load ptr, ptr @_ZSt4cout, align 8, !tbaa !5
  %18 = getelementptr i8, ptr %17, i64 -24
  %19 = load i64, ptr %18, align 8
  %20 = getelementptr inbounds i8, ptr @_ZSt4cout, i64 %19
  %21 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %20, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  br label %22

22:                                               ; preds = %161, %159, %0
  %23 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %24 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %23, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %25 = load i32, ptr %2, align 4, !tbaa !8
  %26 = icmp ne i32 %25, 0
  br i1 %26, label %30, label %27

27:                                               ; preds = %22
  %28 = load i32, ptr %3, align 4, !tbaa !8
  %29 = icmp ne i32 %28, 0
  br label %30

30:                                               ; preds = %27, %22
  %31 = phi i1 [ true, %22 ], [ %29, %27 ]
  br i1 %31, label %32, label %162

32:                                               ; preds = %30
  call void @llvm.memset.p0.i64(ptr align 16 @dfn, i8 0, i64 800080, i1 false)
  call void @llvm.memset.p0.i64(ptr align 16 @head, i8 0, i64 800080, i1 false)
  call void @llvm.memset.p0.i64(ptr align 16 @scc_id, i8 0, i64 800080, i1 false)
  call void @llvm.memset.p0.i64(ptr align 16 @in_stk, i8 0, i64 200020, i1 false)
  store i32 0, ptr @scc_cnt, align 4, !tbaa !8
  store i32 0, ptr @timestamp, align 4, !tbaa !8
  store i32 0, ptr @top, align 4, !tbaa !8
  store i32 0, ptr @tot, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  store i32 0, ptr %4, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  store i32 1, ptr %5, align 4, !tbaa !8
  br label %33

33:                                               ; preds = %49, %32
  %34 = load i32, ptr %5, align 4, !tbaa !8
  %35 = load i32, ptr %2, align 4, !tbaa !8
  %36 = icmp sle i32 %34, %35
  br i1 %36, label %38, label %37

37:                                               ; preds = %33
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  br label %52

38:                                               ; preds = %33
  %39 = load i32, ptr %5, align 4, !tbaa !8
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [100010 x i32], ptr @age, i64 0, i64 %40
  %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) %41)
  %43 = load i32, ptr %5, align 4, !tbaa !8
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [100010 x i32], ptr @age, i64 0, i64 %44
  %46 = load i32, ptr %45, align 4, !tbaa !8
  %47 = load i32, ptr %4, align 4, !tbaa !8
  %48 = add nsw i32 %47, %46
  store i32 %48, ptr %4, align 4, !tbaa !8
  br label %49

49:                                               ; preds = %38
  %50 = load i32, ptr %5, align 4, !tbaa !8
  %51 = add nsw i32 %50, 1
  store i32 %51, ptr %5, align 4, !tbaa !8
  br label %33, !llvm.loop !11

52:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  store i32 1, ptr %6, align 4, !tbaa !8
  br label %53

53:                                               ; preds = %110, %52
  %54 = load i32, ptr %6, align 4, !tbaa !8
  %55 = load i32, ptr %3, align 4, !tbaa !8
  %56 = icmp sle i32 %54, %55
  br i1 %56, label %58, label %57

57:                                               ; preds = %53
  store i32 7, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  br label %113

58:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  %59 = 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)
  %60 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %59, ptr noundef nonnull align 4 dereferenceable(4) %9)
  %61 = load i32, ptr %8, align 4, !tbaa !8
  %62 = load i32, ptr %9, align 4, !tbaa !8
  %63 = icmp eq i32 %61, %62
  br i1 %63, label %64, label %65

64:                                               ; preds = %58
  store i32 9, ptr %7, align 4
  br label %107

65:                                               ; preds = %58
  %66 = load i32, ptr %8, align 4, !tbaa !8
  %67 = mul nsw i32 2, %66
  %68 = load i32, ptr %9, align 4, !tbaa !8
  %69 = mul nsw i32 2, %68
  %70 = sub nsw i32 %69, 1
  call void @_Z8add_edgeii(i32 noundef %67, i32 noundef %70)
  %71 = load i32, ptr %9, align 4, !tbaa !8
  %72 = mul nsw i32 2, %71
  %73 = load i32, ptr %8, align 4, !tbaa !8
  %74 = mul nsw i32 2, %73
  %75 = sub nsw i32 %74, 1
  call void @_Z8add_edgeii(i32 noundef %72, i32 noundef %75)
  %76 = load i32, ptr %8, align 4, !tbaa !8
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [100010 x i32], ptr @age, i64 0, i64 %77
  %79 = load i32, ptr %78, align 4, !tbaa !8
  %80 = load i32, ptr %2, align 4, !tbaa !8
  %81 = mul nsw i32 %79, %80
  %82 = load i32, ptr %4, align 4, !tbaa !8
  %83 = icmp sge i32 %81, %82
  %84 = zext i1 %83 to i32
  %85 = load i32, ptr %9, align 4, !tbaa !8
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [100010 x i32], ptr @age, i64 0, i64 %86
  %88 = load i32, ptr %87, align 4, !tbaa !8
  %89 = load i32, ptr %2, align 4, !tbaa !8
  %90 = mul nsw i32 %88, %89
  %91 = load i32, ptr %4, align 4, !tbaa !8
  %92 = icmp sge i32 %90, %91
  %93 = zext i1 %92 to i32
  %94 = icmp eq i32 %84, %93
  br i1 %94, label %95, label %106

95:                                               ; preds = %65
  %96 = load i32, ptr %8, align 4, !tbaa !8
  %97 = mul nsw i32 2, %96
  %98 = sub nsw i32 %97, 1
  %99 = load i32, ptr %9, align 4, !tbaa !8
  %100 = mul nsw i32 2, %99
  call void @_Z8add_edgeii(i32 noundef %98, i32 noundef %100)
  %101 = load i32, ptr %9, align 4, !tbaa !8
  %102 = mul nsw i32 2, %101
  %103 = sub nsw i32 %102, 1
  %104 = load i32, ptr %8, align 4, !tbaa !8
  %105 = mul nsw i32 2, %104
  call void @_Z8add_edgeii(i32 noundef %103, i32 noundef %105)
  br label %106

106:                                              ; preds = %95, %65
  store i32 0, ptr %7, align 4
  br label %107

107:                                              ; preds = %106, %64
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  %108 = load i32, ptr %7, align 4
  switch i32 %108, label %164 [
    i32 0, label %109
    i32 9, label %110
  ]

109:                                              ; preds = %107
  br label %110

110:                                              ; preds = %109, %107
  %111 = load i32, ptr %6, align 4, !tbaa !8
  %112 = add nsw i32 %111, 1
  store i32 %112, ptr %6, align 4, !tbaa !8
  br label %53, !llvm.loop !13

113:                                              ; preds = %57
  %114 = load i32, ptr %2, align 4, !tbaa !8
  %115 = call noundef zeroext i1 @_Z7two_sati(i32 noundef %114)
  br i1 %115, label %118, label %116

116:                                              ; preds = %113
  %117 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
  store i32 2, ptr %7, align 4
  br label %159, !llvm.loop !14

118:                                              ; preds = %113
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  store i32 1, ptr %10, align 4, !tbaa !8
  br label %119

119:                                              ; preds = %155, %118
  %120 = load i32, ptr %10, align 4, !tbaa !8
  %121 = load i32, ptr %2, align 4, !tbaa !8
  %122 = mul nsw i32 2, %121
  %123 = icmp sle i32 %120, %122
  br i1 %123, label %125, label %124

124:                                              ; preds = %119
  store i32 10, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %158

125:                                              ; preds = %119
  %126 = load i32, ptr %10, align 4, !tbaa !8
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds [200020 x i32], ptr @scc_id, i64 0, i64 %127
  %129 = load i32, ptr %128, align 4, !tbaa !8
  %130 = load i32, ptr %10, align 4, !tbaa !8
  %131 = add nsw i32 %130, 1
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds [200020 x i32], ptr @scc_id, i64 0, i64 %132
  %134 = load i32, ptr %133, align 4, !tbaa !8
  %135 = icmp sgt i32 %129, %134
  br i1 %135, label %136, label %138

136:                                              ; preds = %125
  %137 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.1)
  br label %154

138:                                              ; preds = %125
  %139 = load i32, ptr %10, align 4, !tbaa !8
  %140 = add nsw i32 %139, 1
  %141 = sdiv i32 %140, 2
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds [100010 x i32], ptr @age, i64 0, i64 %142
  %144 = load i32, ptr %143, align 4, !tbaa !8
  %145 = load i32, ptr %2, align 4, !tbaa !8
  %146 = mul nsw i32 %144, %145
  %147 = load i32, ptr %4, align 4, !tbaa !8
  %148 = icmp sge i32 %146, %147
  br i1 %148, label %149, label %151

149:                                              ; preds = %138
  %150 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.2)
  br label %153

151:                                              ; preds = %138
  %152 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.3)
  br label %153

153:                                              ; preds = %151, %149
  br label %154

154:                                              ; preds = %153, %136
  br label %155

155:                                              ; preds = %154
  %156 = load i32, ptr %10, align 4, !tbaa !8
  %157 = add nsw i32 %156, 2
  store i32 %157, ptr %10, align 4, !tbaa !8
  br label %119, !llvm.loop !15

158:                                              ; preds = %124
  store i32 0, ptr %7, align 4
  br label %159

159:                                              ; preds = %158, %116
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  %160 = load i32, ptr %7, align 4
  switch i32 %160, label %164 [
    i32 0, label %161
    i32 2, label %22
  ]

161:                                              ; preds = %159
  br label %22, !llvm.loop !14

162:                                              ; preds = %30
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  %163 = load i32, ptr %1, align 4
  ret i32 %163

164:                                              ; preds = %159, %107
  unreachable
}

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) #4

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #6

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

@age = external dso_local global [100010 x i32], align 16
@head = external dso_local local_unnamed_addr global [200020 x i32], align 16
@tot = external dso_local local_unnamed_addr global i32, align 4
@dfn = external dso_local local_unnamed_addr global [200020 x i32], align 16
@timestamp = external dso_local local_unnamed_addr global i32, align 4
@top = external dso_local local_unnamed_addr global i32, align 4
@in_stk = external dso_local local_unnamed_addr global [200020 x i8], align 16
@scc_cnt = external dso_local local_unnamed_addr global i32, align 4
@scc_id = external dso_local local_unnamed_addr global [200020 x i32], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [14 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z8add_edgeii(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 noundef zeroext i1 @_Z7two_sati(i32 noundef) local_unnamed_addr #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 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %6 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %7 = getelementptr i8, ptr %6, i64 -24
  %8 = load i64, ptr %7, align 8
  %9 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %8
  %10 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %9, ptr noundef null)
  %11 = load ptr, ptr @_ZSt4cout, align 8, !tbaa !5
  %12 = getelementptr i8, ptr %11, i64 -24
  %13 = load i64, ptr %12, align 8
  %14 = getelementptr inbounds i8, ptr @_ZSt4cout, i64 %13
  %15 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %14, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  %16 = 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)
  %17 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %16, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %18 = load i32, ptr %1, align 4, !tbaa !8
  %19 = icmp ne i32 %18, 0
  %20 = load i32, ptr %2, align 4
  %21 = icmp ne i32 %20, 0
  %22 = select i1 %19, i1 true, i1 %21
  br i1 %22, label %.lr.ph35, label %._crit_edge36

.lr.ph35:                                         ; preds = %0, %.loopexit
  %23 = phi i32 [ %100, %.loopexit ], [ %20, %0 ]
  %24 = phi i32 [ %98, %.loopexit ], [ %18, %0 ]
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(800080) @dfn, i8 0, i64 800080, i1 false)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(800080) @head, i8 0, i64 800080, i1 false)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(800080) @scc_id, i8 0, i64 800080, i1 false)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(200020) @in_stk, i8 0, i64 200020, i1 false)
  store i32 0, ptr @scc_cnt, align 4, !tbaa !8
  store i32 0, ptr @timestamp, align 4, !tbaa !8
  store i32 0, ptr @top, align 4, !tbaa !8
  store i32 0, ptr @tot, align 4, !tbaa !8
  %.not25 = icmp slt i32 %24, 1
  br i1 %.not25, label %.preheader24, label %.lr.ph

.preheader24.loopexit:                            ; preds = %.lr.ph
  %.pre = load i32, ptr %2, align 4, !tbaa !8
  br label %.preheader24

.preheader24:                                     ; preds = %.preheader24.loopexit, %.lr.ph35
  %25 = phi i32 [ %24, %.lr.ph35 ], [ %31, %.preheader24.loopexit ]
  %26 = phi i32 [ %23, %.lr.ph35 ], [ %.pre, %.preheader24.loopexit ]
  %.018.lcssa = phi i32 [ 0, %.lr.ph35 ], [ %30, %.preheader24.loopexit ]
  %.not2128 = icmp slt i32 %26, 1
  br i1 %.not2128, label %._crit_edge, label %.lr.ph30

.lr.ph:                                           ; preds = %.lr.ph35, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %.lr.ph35 ]
  %.01826 = phi i32 [ %30, %.lr.ph ], [ 0, %.lr.ph35 ]
  %27 = getelementptr inbounds [100010 x i32], ptr @age, i64 0, i64 %indvars.iv
  %28 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %27)
  %29 = load i32, ptr %27, align 4, !tbaa !8
  %30 = add nsw i32 %29, %.01826
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %31 = load i32, ptr %1, align 4, !tbaa !8
  %32 = sext i32 %31 to i64
  %.not.not = icmp slt i64 %indvars.iv, %32
  br i1 %.not.not, label %.lr.ph, label %.preheader24.loopexit, !llvm.loop !11

._crit_edge.loopexit:                             ; preds = %73
  %.pre41 = load i32, ptr %1, align 4, !tbaa !8
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader24
  %33 = phi i32 [ %.pre41, %._crit_edge.loopexit ], [ %25, %.preheader24 ]
  %34 = call noundef zeroext i1 @_Z7two_sati(i32 noundef %33)
  br i1 %34, label %.preheader, label %76

.preheader:                                       ; preds = %._crit_edge
  %35 = load i32, ptr %1, align 4, !tbaa !8
  %.not2231 = icmp slt i32 %35, 1
  br i1 %.not2231, label %.loopexit, label %.lr.ph33

.lr.ph30:                                         ; preds = %.preheader24, %73
  %.01629 = phi i32 [ %74, %73 ], [ 1, %.preheader24 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #7
  %36 = 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)
  %37 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %36, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %38 = load i32, ptr %3, align 4, !tbaa !8
  %39 = load i32, ptr %4, align 4, !tbaa !8
  %40 = icmp eq i32 %38, %39
  br i1 %40, label %73, label %41

41:                                               ; preds = %.lr.ph30
  %42 = shl nsw i32 %38, 1
  %43 = shl nsw i32 %39, 1
  %44 = add nsw i32 %43, -1
  call void @_Z8add_edgeii(i32 noundef %42, i32 noundef %44)
  %45 = load i32, ptr %4, align 4, !tbaa !8
  %46 = shl nsw i32 %45, 1
  %47 = load i32, ptr %3, align 4, !tbaa !8
  %48 = shl nsw i32 %47, 1
  %49 = add nsw i32 %48, -1
  call void @_Z8add_edgeii(i32 noundef %46, i32 noundef %49)
  %50 = load i32, ptr %3, align 4, !tbaa !8
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [100010 x i32], ptr @age, i64 0, i64 %51
  %53 = load i32, ptr %52, align 4, !tbaa !8
  %54 = load i32, ptr %1, align 4, !tbaa !8
  %55 = mul nsw i32 %54, %53
  %56 = icmp sge i32 %55, %.018.lcssa
  %57 = load i32, ptr %4, align 4, !tbaa !8
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [100010 x i32], ptr @age, i64 0, i64 %58
  %60 = load i32, ptr %59, align 4, !tbaa !8
  %61 = mul nsw i32 %60, %54
  %62 = icmp slt i32 %61, %.018.lcssa
  %63 = xor i1 %56, %62
  br i1 %63, label %64, label %73

64:                                               ; preds = %41
  %65 = shl nsw i32 %50, 1
  %66 = add nsw i32 %65, -1
  %67 = shl nsw i32 %57, 1
  call void @_Z8add_edgeii(i32 noundef %66, i32 noundef %67)
  %68 = load i32, ptr %4, align 4, !tbaa !8
  %69 = shl nsw i32 %68, 1
  %70 = add nsw i32 %69, -1
  %71 = load i32, ptr %3, align 4, !tbaa !8
  %72 = shl nsw i32 %71, 1
  call void @_Z8add_edgeii(i32 noundef %70, i32 noundef %72)
  br label %73

73:                                               ; preds = %41, %64, %.lr.ph30
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  %74 = add nuw nsw i32 %.01629, 1
  %75 = load i32, ptr %2, align 4, !tbaa !8
  %.not21.not = icmp slt i32 %.01629, %75
  br i1 %.not21.not, label %.lr.ph30, label %._crit_edge.loopexit, !llvm.loop !13

76:                                               ; preds = %._crit_edge
  %77 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str)
  br label %.loopexit, !llvm.loop !14

.lr.ph33:                                         ; preds = %.preheader, %91
  %indvars.iv38 = phi i64 [ %indvars.iv.next39, %91 ], [ 1, %.preheader ]
  %78 = phi i32 [ %93, %91 ], [ %35, %.preheader ]
  %79 = getelementptr inbounds [200020 x i32], ptr @scc_id, i64 0, i64 %indvars.iv38
  %80 = load i32, ptr %79, align 4, !tbaa !8
  %81 = add nuw nsw i64 %indvars.iv38, 1
  %82 = getelementptr inbounds [200020 x i32], ptr @scc_id, i64 0, i64 %81
  %83 = load i32, ptr %82, align 4, !tbaa !8
  %84 = icmp sgt i32 %80, %83
  br i1 %84, label %91, label %85

85:                                               ; preds = %.lr.ph33
  %86 = lshr i64 %81, 1
  %87 = and i64 %86, 2147483647
  %88 = getelementptr inbounds [100010 x i32], ptr @age, i64 0, i64 %87
  %89 = load i32, ptr %88, align 4, !tbaa !8
  %90 = mul nsw i32 %89, %78
  %.not23 = icmp slt i32 %90, %.018.lcssa
  %.str.3..str.2 = select i1 %.not23, ptr @.str.3, ptr @.str.2
  br label %91

91:                                               ; preds = %85, %.lr.ph33
  %.str.1.sink = phi ptr [ @.str.1, %.lr.ph33 ], [ %.str.3..str.2, %85 ]
  %92 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull %.str.1.sink)
  %indvars.iv.next39 = add nuw nsw i64 %indvars.iv38, 2
  %93 = load i32, ptr %1, align 4, !tbaa !8
  %94 = shl nsw i32 %93, 1
  %95 = trunc nuw i64 %indvars.iv.next39 to i32
  %.not22 = icmp slt i32 %94, %95
  br i1 %.not22, label %.loopexit, label %.lr.ph33, !llvm.loop !15

.loopexit:                                        ; preds = %91, %.preheader, %76
  %96 = 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)
  %97 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %96, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %98 = load i32, ptr %1, align 4, !tbaa !8
  %99 = icmp ne i32 %98, 0
  %100 = load i32, ptr %2, align 4
  %101 = icmp ne i32 %100, 0
  %102 = select i1 %99, i1 true, i1 %101
  br i1 %102, label %.lr.ph35, label %._crit_edge36

._crit_edge36:                                    ; preds = %.loopexit, %0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  ret i32 0
}

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) local_unnamed_addr #4

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

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 #4

; 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: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #6

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


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