; LLVM IR from upupming/algorithm :: acwing/寒假每日一题（提高组）/week1/1414. 牛异或 (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::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" }

@n = external dso_local global i32, align 4
@a = external dso_local global i32, align 4
@sum = external dso_local global i32, align 4
@trie = external dso_local global [2300240 x [2 x i32]], align 16
@tot = external dso_local global i32, align 4
@idx = external dso_local global [2300240 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 [2 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %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
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %14 = 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 %2) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  store i32 -1, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  store i32 1, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 22, ptr %6, align 4, !tbaa !5
  br label %15

15:                                               ; preds = %31, %0
  %16 = load i32, ptr %6, align 4, !tbaa !5
  %17 = icmp sge i32 %16, 0
  br i1 %17, label %19, label %18

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

19:                                               ; preds = %15
  %20 = load i32, ptr @tot, align 4, !tbaa !5
  %21 = add nsw i32 %20, 1
  store i32 %21, ptr @tot, align 4, !tbaa !5
  %22 = load i32, ptr %5, align 4, !tbaa !5
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds [2300240 x [2 x i32]], ptr @trie, i64 0, i64 %23
  %25 = getelementptr inbounds [2 x i32], ptr %24, i64 0, i64 0
  store i32 %21, ptr %25, align 8, !tbaa !5
  %26 = load i32, ptr %5, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [2300240 x [2 x i32]], ptr @trie, i64 0, i64 %27
  %29 = getelementptr inbounds [2 x i32], ptr %28, i64 0, i64 0
  %30 = load i32, ptr %29, align 8, !tbaa !5
  store i32 %30, ptr %5, align 4, !tbaa !5
  br label %31

31:                                               ; preds = %19
  %32 = load i32, ptr %6, align 4, !tbaa !5
  %33 = add nsw i32 %32, -1
  store i32 %33, ptr %6, align 4, !tbaa !5
  br label %15, !llvm.loop !9

34:                                               ; preds = %18
  %35 = load i32, ptr %5, align 4, !tbaa !5
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [2300240 x i32], ptr @idx, i64 0, i64 %36
  store i32 0, ptr %37, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store i32 1, ptr %7, align 4, !tbaa !5
  br label %38

38:                                               ; preds = %135, %34
  %39 = load i32, ptr %7, align 4, !tbaa !5
  %40 = load i32, ptr @n, align 4, !tbaa !5
  %41 = icmp sle i32 %39, %40
  br i1 %41, label %43, label %42

42:                                               ; preds = %38
  store i32 5, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %138

43:                                               ; preds = %38
  %44 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @a)
  %45 = load i32, ptr @sum, align 4, !tbaa !5
  %46 = load i32, ptr @a, align 4, !tbaa !5
  %47 = xor i32 %45, %46
  store i32 %47, ptr @sum, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 1, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 1, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 0, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  store i32 22, ptr %12, align 4, !tbaa !5
  br label %48

48:                                               ; preds = %115, %43
  %49 = load i32, ptr %12, align 4, !tbaa !5
  %50 = icmp sge i32 %49, 0
  br i1 %50, label %52, label %51

51:                                               ; preds = %48
  store i32 8, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %118

52:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  %53 = load i32, ptr @sum, align 4, !tbaa !5
  %54 = load i32, ptr %12, align 4, !tbaa !5
  %55 = ashr i32 %53, %54
  %56 = and i32 %55, 1
  store i32 %56, ptr %13, align 4, !tbaa !5
  %57 = load i32, ptr %9, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [2300240 x [2 x i32]], ptr @trie, i64 0, i64 %58
  %60 = load i32, ptr %13, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [2 x i32], ptr %59, i64 0, i64 %61
  %63 = load i32, ptr %62, align 4, !tbaa !5
  %64 = icmp ne i32 %63, 0
  br i1 %64, label %74, label %65

65:                                               ; preds = %52
  %66 = load i32, ptr @tot, align 4, !tbaa !5
  %67 = add nsw i32 %66, 1
  store i32 %67, ptr @tot, align 4, !tbaa !5
  %68 = load i32, ptr %9, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [2300240 x [2 x i32]], ptr @trie, i64 0, i64 %69
  %71 = load i32, ptr %13, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [2 x i32], ptr %70, i64 0, i64 %72
  store i32 %67, ptr %73, align 4, !tbaa !5
  br label %74

74:                                               ; preds = %65, %52
  %75 = load i32, ptr %9, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [2300240 x [2 x i32]], ptr @trie, i64 0, i64 %76
  %78 = load i32, ptr %13, align 4, !tbaa !5
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [2 x i32], ptr %77, i64 0, i64 %79
  %81 = load i32, ptr %80, align 4, !tbaa !5
  store i32 %81, ptr %9, align 4, !tbaa !5
  %82 = load i32, ptr %10, align 4, !tbaa !5
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [2300240 x [2 x i32]], ptr @trie, i64 0, i64 %83
  %85 = load i32, ptr %13, align 4, !tbaa !5
  %86 = icmp ne i32 %85, 0
  %87 = xor i1 %86, true
  %88 = zext i1 %87 to i64
  %89 = getelementptr inbounds [2 x i32], ptr %84, i64 0, i64 %88
  %90 = load i32, ptr %89, align 4, !tbaa !5
  %91 = icmp ne i32 %90, 0
  br i1 %91, label %92, label %106

92:                                               ; preds = %74
  %93 = load i32, ptr %12, align 4, !tbaa !5
  %94 = shl i32 1, %93
  %95 = load i32, ptr %11, align 4, !tbaa !5
  %96 = or i32 %95, %94
  store i32 %96, ptr %11, align 4, !tbaa !5
  %97 = load i32, ptr %10, align 4, !tbaa !5
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [2300240 x [2 x i32]], ptr @trie, i64 0, i64 %98
  %100 = load i32, ptr %13, align 4, !tbaa !5
  %101 = icmp ne i32 %100, 0
  %102 = xor i1 %101, true
  %103 = zext i1 %102 to i64
  %104 = getelementptr inbounds [2 x i32], ptr %99, i64 0, i64 %103
  %105 = load i32, ptr %104, align 4, !tbaa !5
  store i32 %105, ptr %10, align 4, !tbaa !5
  br label %114

106:                                              ; preds = %74
  %107 = load i32, ptr %10, align 4, !tbaa !5
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [2300240 x [2 x i32]], ptr @trie, i64 0, i64 %108
  %110 = load i32, ptr %13, align 4, !tbaa !5
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [2 x i32], ptr %109, i64 0, i64 %111
  %113 = load i32, ptr %112, align 4, !tbaa !5
  store i32 %113, ptr %10, align 4, !tbaa !5
  br label %114

114:                                              ; preds = %106, %92
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %115

115:                                              ; preds = %114
  %116 = load i32, ptr %12, align 4, !tbaa !5
  %117 = add nsw i32 %116, -1
  store i32 %117, ptr %12, align 4, !tbaa !5
  br label %48, !llvm.loop !11

118:                                              ; preds = %51
  %119 = load i32, ptr %11, align 4, !tbaa !5
  %120 = load i32, ptr %4, align 4, !tbaa !5
  %121 = icmp sgt i32 %119, %120
  br i1 %121, label %122, label %130

122:                                              ; preds = %118
  %123 = load i32, ptr %11, align 4, !tbaa !5
  store i32 %123, ptr %4, align 4, !tbaa !5
  %124 = load i32, ptr %7, align 4, !tbaa !5
  store i32 %124, ptr %3, align 4, !tbaa !5
  %125 = load i32, ptr %10, align 4, !tbaa !5
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds [2300240 x i32], ptr @idx, i64 0, i64 %126
  %128 = load i32, ptr %127, align 4, !tbaa !5
  %129 = add nsw i32 %128, 1
  store i32 %129, ptr %2, align 4, !tbaa !5
  br label %130

130:                                              ; preds = %122, %118
  %131 = load i32, ptr %7, align 4, !tbaa !5
  %132 = load i32, ptr %9, align 4, !tbaa !5
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds [2300240 x i32], ptr @idx, i64 0, i64 %133
  store i32 %131, ptr %134, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %135

135:                                              ; preds = %130
  %136 = load i32, ptr %7, align 4, !tbaa !5
  %137 = add nsw i32 %136, 1
  store i32 %137, ptr %7, align 4, !tbaa !5
  br label %38, !llvm.loop !12

138:                                              ; preds = %42
  %139 = load i32, ptr %4, align 4, !tbaa !5
  %140 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %139)
  %141 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %140, ptr noundef @.str)
  %142 = load i32, ptr %2, align 4, !tbaa !5
  %143 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %141, i32 noundef %142)
  %144 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %143, ptr noundef @.str)
  %145 = load i32, ptr %3, align 4, !tbaa !5
  %146 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %144, i32 noundef %145)
  %147 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %146, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  %148 = load i32, ptr %1, align 4
  ret i32 %148
}

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

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2

; 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) #3

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #1

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #3

attributes #0 = { 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 #1 = { "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 #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress 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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !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::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" }

@n = external dso_local global i32, align 4
@a = external dso_local global i32, align 4
@sum = external dso_local local_unnamed_addr global i32, align 4
@trie = external dso_local local_unnamed_addr global [2300240 x [2 x i32]], align 16
@tot = external dso_local local_unnamed_addr global i32, align 4
@idx = external dso_local local_unnamed_addr global [2300240 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 [2 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = 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)
  %tot.promoted = load i32, ptr @tot, align 4, !tbaa !5
  %2 = add nsw i32 %tot.promoted, 1
  store i32 %2, ptr getelementptr inbounds (i8, ptr @trie, i64 8), align 8, !tbaa !5
  %3 = add nsw i32 %tot.promoted, 2
  %4 = sext i32 %2 to i64
  %5 = getelementptr inbounds [2300240 x [2 x i32]], ptr @trie, i64 0, i64 %4
  store i32 %3, ptr %5, align 8, !tbaa !5
  %6 = add nsw i32 %tot.promoted, 3
  %7 = sext i32 %3 to i64
  %8 = getelementptr inbounds [2300240 x [2 x i32]], ptr @trie, i64 0, i64 %7
  store i32 %6, ptr %8, align 8, !tbaa !5
  %9 = add nsw i32 %tot.promoted, 4
  %10 = sext i32 %6 to i64
  %11 = getelementptr inbounds [2300240 x [2 x i32]], ptr @trie, i64 0, i64 %10
  store i32 %9, ptr %11, align 8, !tbaa !5
  %12 = add nsw i32 %tot.promoted, 5
  %13 = sext i32 %9 to i64
  %14 = getelementptr inbounds [2300240 x [2 x i32]], ptr @trie, i64 0, i64 %13
  store i32 %12, ptr %14, align 8, !tbaa !5
  %15 = add nsw i32 %tot.promoted, 6
  %16 = sext i32 %12 to i64
  %17 = getelementptr inbounds [2300240 x [2 x i32]], ptr @trie, i64 0, i64 %16
  store i32 %15, ptr %17, align 8, !tbaa !5
  %18 = add nsw i32 %tot.promoted, 7
  %19 = sext i32 %15 to i64
  %20 = getelementptr inbounds [2300240 x [2 x i32]], ptr @trie, i64 0, i64 %19
  store i32 %18, ptr %20, align 8, !tbaa !5
  %21 = add nsw i32 %tot.promoted, 8
  %22 = sext i32 %18 to i64
  %23 = getelementptr inbounds [2300240 x [2 x i32]], ptr @trie, i64 0, i64 %22
  store i32 %21, ptr %23, align 8, !tbaa !5
  %24 = add nsw i32 %tot.promoted, 9
  %25 = sext i32 %21 to i64
  %26 = getelementptr inbounds [2300240 x [2 x i32]], ptr @trie, i64 0, i64 %25
  store i32 %24, ptr %26, align 8, !tbaa !5
  %27 = add nsw i32 %tot.promoted, 10
  %28 = sext i32 %24 to i64
  %29 = getelementptr inbounds [2300240 x [2 x i32]], ptr @trie, i64 0, i64 %28
  store i32 %27, ptr %29, align 8, !tbaa !5
  %30 = add nsw i32 %tot.promoted, 11
  %31 = sext i32 %27 to i64
  %32 = getelementptr inbounds [2300240 x [2 x i32]], ptr @trie, i64 0, i64 %31
  store i32 %30, ptr %32, align 8, !tbaa !5
  %33 = add nsw i32 %tot.promoted, 12
  %34 = sext i32 %30 to i64
  %35 = getelementptr inbounds [2300240 x [2 x i32]], ptr @trie, i64 0, i64 %34
  store i32 %33, ptr %35, align 8, !tbaa !5
  %36 = add nsw i32 %tot.promoted, 13
  %37 = sext i32 %33 to i64
  %38 = getelementptr inbounds [2300240 x [2 x i32]], ptr @trie, i64 0, i64 %37
  store i32 %36, ptr %38, align 8, !tbaa !5
  %39 = add nsw i32 %tot.promoted, 14
  %40 = sext i32 %36 to i64
  %41 = getelementptr inbounds [2300240 x [2 x i32]], ptr @trie, i64 0, i64 %40
  store i32 %39, ptr %41, align 8, !tbaa !5
  %42 = add nsw i32 %tot.promoted, 15
  %43 = sext i32 %39 to i64
  %44 = getelementptr inbounds [2300240 x [2 x i32]], ptr @trie, i64 0, i64 %43
  store i32 %42, ptr %44, align 8, !tbaa !5
  %45 = add nsw i32 %tot.promoted, 16
  %46 = sext i32 %42 to i64
  %47 = getelementptr inbounds [2300240 x [2 x i32]], ptr @trie, i64 0, i64 %46
  store i32 %45, ptr %47, align 8, !tbaa !5
  %48 = add nsw i32 %tot.promoted, 17
  %49 = sext i32 %45 to i64
  %50 = getelementptr inbounds [2300240 x [2 x i32]], ptr @trie, i64 0, i64 %49
  store i32 %48, ptr %50, align 8, !tbaa !5
  %51 = add nsw i32 %tot.promoted, 18
  %52 = sext i32 %48 to i64
  %53 = getelementptr inbounds [2300240 x [2 x i32]], ptr @trie, i64 0, i64 %52
  store i32 %51, ptr %53, align 8, !tbaa !5
  %54 = add nsw i32 %tot.promoted, 19
  %55 = sext i32 %51 to i64
  %56 = getelementptr inbounds [2300240 x [2 x i32]], ptr @trie, i64 0, i64 %55
  store i32 %54, ptr %56, align 8, !tbaa !5
  %57 = add nsw i32 %tot.promoted, 20
  %58 = sext i32 %54 to i64
  %59 = getelementptr inbounds [2300240 x [2 x i32]], ptr @trie, i64 0, i64 %58
  store i32 %57, ptr %59, align 8, !tbaa !5
  %60 = add nsw i32 %tot.promoted, 21
  %61 = sext i32 %57 to i64
  %62 = getelementptr inbounds [2300240 x [2 x i32]], ptr @trie, i64 0, i64 %61
  store i32 %60, ptr %62, align 8, !tbaa !5
  %63 = add nsw i32 %tot.promoted, 22
  %64 = sext i32 %60 to i64
  %65 = getelementptr inbounds [2300240 x [2 x i32]], ptr @trie, i64 0, i64 %64
  store i32 %63, ptr %65, align 8, !tbaa !5
  %66 = add nsw i32 %tot.promoted, 23
  %67 = sext i32 %63 to i64
  %68 = getelementptr inbounds [2300240 x [2 x i32]], ptr @trie, i64 0, i64 %67
  store i32 %66, ptr %68, align 8, !tbaa !5
  store i32 %66, ptr @tot, align 4, !tbaa !5
  %69 = sext i32 %66 to i64
  %70 = getelementptr inbounds [2300240 x i32], ptr @idx, i64 0, i64 %69
  store i32 0, ptr %70, align 4, !tbaa !5
  %71 = load i32, ptr @n, align 4, !tbaa !5
  %.not59 = icmp slt i32 %71, 1
  br i1 %.not59, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %115, %0
  %.046.lcssa = phi i32 [ undef, %0 ], [ %.147, %115 ]
  %.044.lcssa = phi i32 [ undef, %0 ], [ %.145, %115 ]
  %.042.lcssa = phi i32 [ -1, %0 ], [ %.143, %115 ]
  %72 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %.042.lcssa)
  %73 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %72, ptr noundef nonnull @.str)
  %74 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %73, i32 noundef %.046.lcssa)
  %75 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %74, ptr noundef nonnull @.str)
  %76 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %75, i32 noundef %.044.lcssa)
  %77 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %76, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  ret i32 0

.lr.ph:                                           ; preds = %0, %115
  %.03963 = phi i32 [ %118, %115 ], [ 1, %0 ]
  %.04262 = phi i32 [ %.143, %115 ], [ -1, %0 ]
  %.04461 = phi i32 [ %.145, %115 ], [ undef, %0 ]
  %.04660 = phi i32 [ %.147, %115 ], [ undef, %0 ]
  %78 = 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) @a)
  %79 = load i32, ptr @sum, align 4, !tbaa !5
  %80 = load i32, ptr @a, align 4, !tbaa !5
  %81 = xor i32 %80, %79
  store i32 %81, ptr @sum, align 4, !tbaa !5
  %tot.promoted54 = load i32, ptr @tot, align 4, !tbaa !5
  br label %84

82:                                               ; preds = %108
  %83 = icmp sgt i32 %.1, %.04262
  br i1 %83, label %110, label %115

84:                                               ; preds = %.lr.ph, %108
  %.058 = phi i32 [ 22, %.lr.ph ], [ %109, %108 ]
  %.03557 = phi i32 [ 0, %.lr.ph ], [ %.1, %108 ]
  %.03656 = phi i32 [ 1, %.lr.ph ], [ %.137, %108 ]
  %.03855 = phi i32 [ 1, %.lr.ph ], [ %95, %108 ]
  %85 = phi i32 [ %tot.promoted54, %.lr.ph ], [ %96, %108 ]
  %86 = lshr i32 %81, %.058
  %87 = and i32 %86, 1
  %88 = sext i32 %.03855 to i64
  %89 = zext nneg i32 %87 to i64
  %90 = getelementptr inbounds [2300240 x [2 x i32]], ptr @trie, i64 0, i64 %88, i64 %89
  %91 = load i32, ptr %90, align 4, !tbaa !5
  %.not49 = icmp eq i32 %91, 0
  br i1 %.not49, label %92, label %94

92:                                               ; preds = %84
  %93 = add nsw i32 %85, 1
  store i32 %93, ptr @tot, align 4, !tbaa !5
  store i32 %93, ptr %90, align 4, !tbaa !5
  br label %94

94:                                               ; preds = %92, %84
  %95 = phi i32 [ %93, %92 ], [ %91, %84 ]
  %96 = phi i32 [ %93, %92 ], [ %85, %84 ]
  %97 = sext i32 %.03656 to i64
  %98 = xor i32 %87, 1
  %99 = zext nneg i32 %98 to i64
  %100 = getelementptr inbounds [2300240 x [2 x i32]], ptr @trie, i64 0, i64 %97, i64 %99
  %101 = load i32, ptr %100, align 4, !tbaa !5
  %.not51 = icmp eq i32 %101, 0
  br i1 %.not51, label %105, label %102

102:                                              ; preds = %94
  %103 = shl nuw i32 1, %.058
  %104 = or i32 %103, %.03557
  br label %108

105:                                              ; preds = %94
  %106 = getelementptr inbounds [2300240 x [2 x i32]], ptr @trie, i64 0, i64 %97, i64 %89
  %107 = load i32, ptr %106, align 4, !tbaa !5
  br label %108

108:                                              ; preds = %105, %102
  %.137 = phi i32 [ %101, %102 ], [ %107, %105 ]
  %.1 = phi i32 [ %104, %102 ], [ %.03557, %105 ]
  %109 = add nsw i32 %.058, -1
  %.not = icmp eq i32 %.058, 0
  br i1 %.not, label %82, label %84, !llvm.loop !9

110:                                              ; preds = %82
  %111 = sext i32 %.137 to i64
  %112 = getelementptr inbounds [2300240 x i32], ptr @idx, i64 0, i64 %111
  %113 = load i32, ptr %112, align 4, !tbaa !5
  %114 = add nsw i32 %113, 1
  br label %115

115:                                              ; preds = %110, %82
  %.147 = phi i32 [ %114, %110 ], [ %.04660, %82 ]
  %.145 = phi i32 [ %.03963, %110 ], [ %.04461, %82 ]
  %.143 = phi i32 [ %.1, %110 ], [ %.04262, %82 ]
  %116 = sext i32 %95 to i64
  %117 = getelementptr inbounds [2300240 x i32], ptr @idx, i64 0, i64 %116
  store i32 %.03963, ptr %117, align 4, !tbaa !5
  %118 = add nuw nsw i32 %.03963, 1
  %119 = load i32, ptr @n, align 4, !tbaa !5
  %.not.not = icmp slt i32 %.03963, %119
  br i1 %.not.not, label %.lr.ph, label %._crit_edge, !llvm.loop !11
}

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

; 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 #2

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #1

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #2

attributes #0 = { 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 #1 = { "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 #2 = { 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 #3 = { 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" }

!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}


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