; LLVM IR from eyangch/competitive-programming :: Codeforces/1257 (f)

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

%struct.trie = type { [31 x ptr], i64, i64 }
%"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" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@N = external dso_local global i64, align 8
@A = external dso_local global [100 x i64], align 16
@al = external dso_local global [100 x i64], align 16
@ar = external dso_local global [100 x i64], align 16
@t = external dso_local global %struct.trie, align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca i32, align 4
  %5 = alloca %"class.std::vector", align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i64, align 8
  %11 = alloca %"class.std::vector", align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  %15 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %16 = getelementptr i8, ptr %15, i64 -24
  %17 = load i64, ptr %16, align 8
  %18 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %17
  %19 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %18, ptr noundef null)
  %20 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %21 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @N)
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #7
  store i64 0, ptr %2, align 8, !tbaa !8
  br label %22

22:                                               ; preds = %43, %0
  %23 = load i64, ptr %2, align 8, !tbaa !8
  %24 = load i64, ptr @N, align 8, !tbaa !8
  %25 = icmp slt i64 %23, %24
  br i1 %25, label %27, label %26

26:                                               ; preds = %22
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #7
  br label %46

27:                                               ; preds = %22
  %28 = load i64, ptr %2, align 8, !tbaa !8
  %29 = getelementptr inbounds [100 x i64], ptr @A, i64 0, i64 %28
  %30 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %29)
  %31 = load i64, ptr %2, align 8, !tbaa !8
  %32 = getelementptr inbounds [100 x i64], ptr @A, i64 0, i64 %31
  %33 = load i64, ptr %32, align 8, !tbaa !8
  %34 = ashr i64 %33, 15
  %35 = load i64, ptr %2, align 8, !tbaa !8
  %36 = getelementptr inbounds [100 x i64], ptr @al, i64 0, i64 %35
  store i64 %34, ptr %36, align 8, !tbaa !8
  %37 = load i64, ptr %2, align 8, !tbaa !8
  %38 = getelementptr inbounds [100 x i64], ptr @A, i64 0, i64 %37
  %39 = load i64, ptr %38, align 8, !tbaa !8
  %40 = and i64 %39, 32767
  %41 = load i64, ptr %2, align 8, !tbaa !8
  %42 = getelementptr inbounds [100 x i64], ptr @ar, i64 0, i64 %41
  store i64 %40, ptr %42, align 8, !tbaa !8
  br label %43

43:                                               ; preds = %27
  %44 = load i64, ptr %2, align 8, !tbaa !8
  %45 = add nsw i64 %44, 1
  store i64 %45, ptr %2, align 8, !tbaa !8
  br label %22, !llvm.loop !11

46:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #7
  store i64 0, ptr %3, align 8, !tbaa !8
  br label %47

47:                                               ; preds = %87, %46
  %48 = load i64, ptr %3, align 8, !tbaa !8
  %49 = icmp slt i64 %48, 32768
  br i1 %49, label %51, label %50

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

51:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 24, ptr %5) #7
  call void @_ZNSt6vectorIxSaIxEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  store i64 1, ptr %6, align 8, !tbaa !8
  br label %52

52:                                               ; preds = %77, %51
  %53 = load i64, ptr %6, align 8, !tbaa !8
  %54 = load i64, ptr @N, align 8, !tbaa !8
  %55 = icmp slt i64 %53, %54
  br i1 %55, label %57, label %56

56:                                               ; preds = %52
  store i32 8, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  br label %84

57:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  %58 = load i64, ptr %6, align 8, !tbaa !8
  %59 = getelementptr inbounds [100 x i64], ptr @ar, i64 0, i64 %58
  %60 = load i64, ptr %59, align 8, !tbaa !8
  %61 = load i64, ptr %3, align 8, !tbaa !8
  %62 = xor i64 %60, %61
  %63 = trunc i64 %62 to i32
  %64 = call i32 @llvm.ctpop.i32(i32 %63)
  %65 = load i64, ptr %6, align 8, !tbaa !8
  %66 = sub nsw i64 %65, 1
  %67 = getelementptr inbounds [100 x i64], ptr @ar, i64 0, i64 %66
  %68 = load i64, ptr %67, align 8, !tbaa !8
  %69 = load i64, ptr %3, align 8, !tbaa !8
  %70 = xor i64 %68, %69
  %71 = trunc i64 %70 to i32
  %72 = call i32 @llvm.ctpop.i32(i32 %71)
  %73 = sub nsw i32 %64, %72
  %74 = add nsw i32 %73, 15
  %75 = sext i32 %74 to i64
  store i64 %75, ptr %7, align 8, !tbaa !8
  invoke void @_ZNSt6vectorIxSaIxEE9push_backEOx(ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull align 8 dereferenceable(8) %7)
          to label %76 unwind label %80

76:                                               ; preds = %57
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  br label %77

77:                                               ; preds = %76
  %78 = load i64, ptr %6, align 8, !tbaa !8
  %79 = add nsw i64 %78, 1
  store i64 %79, ptr %6, align 8, !tbaa !8
  br label %52, !llvm.loop !13

80:                                               ; preds = %57
  %81 = landingpad { ptr, i32 }
          cleanup
  %82 = extractvalue { ptr, i32 } %81, 0
  store ptr %82, ptr %8, align 8
  %83 = extractvalue { ptr, i32 } %81, 1
  store i32 %83, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  br label %94

84:                                               ; preds = %56
  %85 = load i64, ptr %3, align 8, !tbaa !8
  invoke void @_ZN4trie3insERSt6vectorIxSaIxEEx(ptr noundef nonnull align 8 dereferenceable(264) @t, ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %85)
          to label %86 unwind label %90

86:                                               ; preds = %84
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %5) #7
  br label %87

87:                                               ; preds = %86
  %88 = load i64, ptr %3, align 8, !tbaa !8
  %89 = add nsw i64 %88, 1
  store i64 %89, ptr %3, align 8, !tbaa !8
  br label %47, !llvm.loop !14

90:                                               ; preds = %84
  %91 = landingpad { ptr, i32 }
          cleanup
  %92 = extractvalue { ptr, i32 } %91, 0
  store ptr %92, ptr %8, align 8
  %93 = extractvalue { ptr, i32 } %91, 1
  store i32 %93, ptr %9, align 4
  br label %94

94:                                               ; preds = %90, %80
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #7
  br label %166

95:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  store i64 0, ptr %10, align 8, !tbaa !8
  br label %96

96:                                               ; preds = %155, %95
  %97 = load i64, ptr %10, align 8, !tbaa !8
  %98 = icmp slt i64 %97, 32768
  br i1 %98, label %100, label %99

99:                                               ; preds = %96
  store i32 11, ptr %4, align 4
  br label %159

100:                                              ; preds = %96
  call void @llvm.lifetime.start.p0(i64 24, ptr %11) #7
  call void @_ZNSt6vectorIxSaIxEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %11) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  store i64 1, ptr %12, align 8, !tbaa !8
  br label %101

101:                                              ; preds = %126, %100
  %102 = load i64, ptr %12, align 8, !tbaa !8
  %103 = load i64, ptr @N, align 8, !tbaa !8
  %104 = icmp slt i64 %102, %103
  br i1 %104, label %106, label %105

105:                                              ; preds = %101
  store i32 14, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  br label %133

106:                                              ; preds = %101
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  %107 = load i64, ptr %12, align 8, !tbaa !8
  %108 = getelementptr inbounds [100 x i64], ptr @al, i64 0, i64 %107
  %109 = load i64, ptr %108, align 8, !tbaa !8
  %110 = load i64, ptr %10, align 8, !tbaa !8
  %111 = xor i64 %109, %110
  %112 = trunc i64 %111 to i32
  %113 = call i32 @llvm.ctpop.i32(i32 %112)
  %114 = sub nsw i32 15, %113
  %115 = load i64, ptr %12, align 8, !tbaa !8
  %116 = sub nsw i64 %115, 1
  %117 = getelementptr inbounds [100 x i64], ptr @al, i64 0, i64 %116
  %118 = load i64, ptr %117, align 8, !tbaa !8
  %119 = load i64, ptr %10, align 8, !tbaa !8
  %120 = xor i64 %118, %119
  %121 = trunc i64 %120 to i32
  %122 = call i32 @llvm.ctpop.i32(i32 %121)
  %123 = add nsw i32 %114, %122
  %124 = sext i32 %123 to i64
  store i64 %124, ptr %13, align 8, !tbaa !8
  invoke void @_ZNSt6vectorIxSaIxEE9push_backEOx(ptr noundef nonnull align 8 dereferenceable(24) %11, ptr noundef nonnull align 8 dereferenceable(8) %13)
          to label %125 unwind label %129

125:                                              ; preds = %106
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  br label %126

126:                                              ; preds = %125
  %127 = load i64, ptr %12, align 8, !tbaa !8
  %128 = add nsw i64 %127, 1
  store i64 %128, ptr %12, align 8, !tbaa !8
  br label %101, !llvm.loop !15

129:                                              ; preds = %106
  %130 = landingpad { ptr, i32 }
          cleanup
  %131 = extractvalue { ptr, i32 } %130, 0
  store ptr %131, ptr %8, align 8
  %132 = extractvalue { ptr, i32 } %130, 1
  store i32 %132, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  br label %158

133:                                              ; preds = %105
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  %134 = invoke noundef i64 @_ZN4trie6searchERSt6vectorIxSaIxEE(ptr noundef nonnull align 8 dereferenceable(264) @t, ptr noundef nonnull align 8 dereferenceable(24) %11)
          to label %135 unwind label %147

135:                                              ; preds = %133
  store i64 %134, ptr %14, align 8, !tbaa !8
  %136 = load i64, ptr %14, align 8, !tbaa !8
  %137 = icmp sgt i64 %136, -1
  br i1 %137, label %138, label %151

138:                                              ; preds = %135
  %139 = load i64, ptr %10, align 8, !tbaa !8
  %140 = shl i64 %139, 15
  %141 = load i64, ptr %14, align 8, !tbaa !8
  %142 = add nsw i64 %140, %141
  %143 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %142)
          to label %144 unwind label %147

144:                                              ; preds = %138
  %145 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %143, i8 noundef signext 10)
          to label %146 unwind label %147

146:                                              ; preds = %144
  store i32 0, ptr %1, align 4
  store i32 1, ptr %4, align 4
  br label %152

147:                                              ; preds = %144, %138, %133
  %148 = landingpad { ptr, i32 }
          cleanup
  %149 = extractvalue { ptr, i32 } %148, 0
  store ptr %149, ptr %8, align 8
  %150 = extractvalue { ptr, i32 } %148, 1
  store i32 %150, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  br label %158

151:                                              ; preds = %135
  store i32 0, ptr %4, align 4
  br label %152

152:                                              ; preds = %151, %146
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %11) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %11) #7
  %153 = load i32, ptr %4, align 4
  switch i32 %153, label %159 [
    i32 0, label %154
  ]

154:                                              ; preds = %152
  br label %155

155:                                              ; preds = %154
  %156 = load i64, ptr %10, align 8, !tbaa !8
  %157 = add nsw i64 %156, 1
  store i64 %157, ptr %10, align 8, !tbaa !8
  br label %96, !llvm.loop !16

158:                                              ; preds = %147, %129
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %11) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  br label %166

159:                                              ; preds = %152, %99
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  %160 = load i32, ptr %4, align 4
  switch i32 %160, label %171 [
    i32 11, label %161
    i32 1, label %164
  ]

161:                                              ; preds = %159
  %162 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef -1)
  %163 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %162, i8 noundef signext 10)
  br label %164

164:                                              ; preds = %161, %159
  %165 = load i32, ptr %1, align 4
  ret i32 %165

166:                                              ; preds = %158, %94
  %167 = load ptr, ptr %8, align 8
  %168 = load i32, ptr %9, align 4
  %169 = insertvalue { ptr, i32 } poison, ptr %167, 0
  %170 = insertvalue { ptr, i32 } %169, i32 %168, 1
  resume { ptr, i32 } %170

171:                                              ; preds = %159
  unreachable
}

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIxSaIxEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1 align 2

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.ctpop.i32(i32) #5

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4trie3insERSt6vectorIxSaIxEEx(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZN4trie6searchERSt6vectorIxSaIxEE(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef nonnull align 8 dereferenceable(24)) #3 align 2

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

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

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #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 = { 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 #2 = { "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" }
attributes #4 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = !{!"long long", !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}
!16 = distinct !{!16, !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"

%struct.trie = type { [31 x ptr], i64, i64 }
%"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" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@N = external dso_local global i64, align 8
@A = external dso_local global [100 x i64], align 16
@al = external dso_local local_unnamed_addr global [100 x i64], align 16
@ar = external dso_local local_unnamed_addr global [100 x i64], align 16
@t = external dso_local global %struct.trie, align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.std::vector", align 8
  %2 = alloca i64, align 8
  %3 = alloca %"class.std::vector", align 8
  %4 = alloca i64, align 8
  %5 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %6 = getelementptr i8, ptr %5, i64 -24
  %7 = load i64, ptr %6, align 8
  %8 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %7
  %9 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %8, ptr noundef null)
  %10 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %11 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @N)
  %12 = load i64, ptr @N, align 8, !tbaa !8
  %13 = icmp sgt i64 %12, 0
  br i1 %13, label %.lr.ph, label %.preheader53.preheader

.lr.ph:                                           ; preds = %0, %.lr.ph
  %.04357 = phi i64 [ %21, %.lr.ph ], [ 0, %0 ]
  %14 = getelementptr inbounds [100 x i64], ptr @A, i64 0, i64 %.04357
  %15 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %14)
  %16 = load i64, ptr %14, align 8, !tbaa !8
  %17 = ashr i64 %16, 15
  %18 = getelementptr inbounds [100 x i64], ptr @al, i64 0, i64 %.04357
  store i64 %17, ptr %18, align 8, !tbaa !8
  %19 = and i64 %16, 32767
  %20 = getelementptr inbounds [100 x i64], ptr @ar, i64 0, i64 %.04357
  store i64 %19, ptr %20, align 8, !tbaa !8
  %21 = add nuw nsw i64 %.04357, 1
  %22 = load i64, ptr @N, align 8, !tbaa !8
  %23 = icmp slt i64 %21, %22
  br i1 %23, label %.lr.ph, label %.preheader53.preheader, !llvm.loop !11

.preheader53.preheader:                           ; preds = %.lr.ph, %0
  br label %.preheader53

.preheader53:                                     ; preds = %.preheader53.preheader, %46
  %.04260 = phi i64 [ %47, %46 ], [ 0, %.preheader53.preheader ]
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %1) #7
  call void @_ZNSt6vectorIxSaIxEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %1) #7
  %24 = load i64, ptr @N, align 8, !tbaa !8
  %25 = icmp sgt i64 %24, 1
  br i1 %25, label %.lr.ph59, label %._crit_edge

._crit_edge:                                      ; preds = %40, %.preheader53
  invoke void @_ZN4trie3insERSt6vectorIxSaIxEEx(ptr noundef nonnull align 8 dereferenceable(264) @t, ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %.04260)
          to label %46 unwind label %48

.lr.ph59:                                         ; preds = %.preheader53, %40
  %.03958 = phi i64 [ %41, %40 ], [ 1, %.preheader53 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #7
  %26 = getelementptr inbounds [100 x i64], ptr @ar, i64 0, i64 %.03958
  %27 = load i64, ptr %26, align 8, !tbaa !8
  %28 = xor i64 %27, %.04260
  %29 = trunc i64 %28 to i32
  %30 = call range(i32 0, 33) i32 @llvm.ctpop.i32(i32 %29)
  %31 = add nsw i64 %.03958, -1
  %32 = getelementptr inbounds [100 x i64], ptr @ar, i64 0, i64 %31
  %33 = load i64, ptr %32, align 8, !tbaa !8
  %34 = xor i64 %33, %.04260
  %35 = trunc i64 %34 to i32
  %36 = call range(i32 0, 33) i32 @llvm.ctpop.i32(i32 %35)
  %37 = add nuw nsw i32 %30, 15
  %38 = sub nsw i32 %37, %36
  %39 = sext i32 %38 to i64
  store i64 %39, ptr %2, align 8, !tbaa !8
  invoke void @_ZNSt6vectorIxSaIxEE9push_backEOx(ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(8) %2)
          to label %40 unwind label %44

40:                                               ; preds = %.lr.ph59
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #7
  %41 = add nuw nsw i64 %.03958, 1
  %42 = load i64, ptr @N, align 8, !tbaa !8
  %43 = icmp slt i64 %41, %42
  br i1 %43, label %.lr.ph59, label %._crit_edge, !llvm.loop !13

44:                                               ; preds = %.lr.ph59
  %45 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #7
  br label %50

46:                                               ; preds = %._crit_edge
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %1) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %1) #7
  %47 = add nuw nsw i64 %.04260, 1
  %exitcond.not = icmp eq i64 %47, 32768
  br i1 %exitcond.not, label %.preheader, label %.preheader53, !llvm.loop !14

48:                                               ; preds = %._crit_edge
  %49 = landingpad { ptr, i32 }
          cleanup
  br label %50

50:                                               ; preds = %48, %44
  %.pn46 = phi { ptr, i32 } [ %45, %44 ], [ %49, %48 ]
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %1) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %1) #7
  br label %89

.preheader:                                       ; preds = %46, %81
  %.03265 = phi i64 [ %82, %81 ], [ 0, %46 ]
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #7
  call void @_ZNSt6vectorIxSaIxEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #7
  %51 = load i64, ptr @N, align 8, !tbaa !8
  %52 = icmp sgt i64 %51, 1
  br i1 %52, label %.lr.ph63, label %._crit_edge64

._crit_edge64:                                    ; preds = %67, %.preheader
  %53 = invoke noundef i64 @_ZN4trie6searchERSt6vectorIxSaIxEE(ptr noundef nonnull align 8 dereferenceable(264) @t, ptr noundef nonnull align 8 dereferenceable(24) %3)
          to label %73 unwind label %.loopexit

.lr.ph63:                                         ; preds = %.preheader, %67
  %.03161 = phi i64 [ %68, %67 ], [ 1, %.preheader ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  %54 = getelementptr inbounds [100 x i64], ptr @al, i64 0, i64 %.03161
  %55 = load i64, ptr %54, align 8, !tbaa !8
  %56 = xor i64 %55, %.03265
  %57 = trunc i64 %56 to i32
  %58 = call range(i32 0, 33) i32 @llvm.ctpop.i32(i32 %57)
  %59 = add nsw i64 %.03161, -1
  %60 = getelementptr inbounds [100 x i64], ptr @al, i64 0, i64 %59
  %61 = load i64, ptr %60, align 8, !tbaa !8
  %62 = xor i64 %61, %.03265
  %63 = trunc i64 %62 to i32
  %64 = call range(i32 0, 33) i32 @llvm.ctpop.i32(i32 %63)
  %reass.sub66 = sub nsw i32 %64, %58
  %65 = add nsw i32 %reass.sub66, 15
  %66 = sext i32 %65 to i64
  store i64 %66, ptr %4, align 8, !tbaa !8
  invoke void @_ZNSt6vectorIxSaIxEE9push_backEOx(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 8 dereferenceable(8) %4)
          to label %67 unwind label %71

67:                                               ; preds = %.lr.ph63
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  %68 = add nuw nsw i64 %.03161, 1
  %69 = load i64, ptr @N, align 8, !tbaa !8
  %70 = icmp slt i64 %68, %69
  br i1 %70, label %.lr.ph63, label %._crit_edge64, !llvm.loop !15

71:                                               ; preds = %.lr.ph63
  %72 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  br label %83

73:                                               ; preds = %._crit_edge64
  %74 = icmp slt i64 %53, 0
  br i1 %74, label %81, label %75

75:                                               ; preds = %73
  %76 = shl nuw nsw i64 %.03265, 15
  %77 = add nuw nsw i64 %53, %76
  %78 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %77)
          to label %79 unwind label %.loopexit.split-lp

79:                                               ; preds = %75
  %80 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %78, i8 noundef signext 10)
          to label %84 unwind label %.loopexit.split-lp

.loopexit:                                        ; preds = %._crit_edge64
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %83

.loopexit.split-lp:                               ; preds = %75, %79
  %lpad.loopexit.split-lp = landingpad { ptr, i32 }
          cleanup
  br label %83

81:                                               ; preds = %73
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #7
  %82 = add nuw nsw i64 %.03265, 1
  %exitcond71.not = icmp eq i64 %82, 32768
  br i1 %exitcond71.not, label %85, label %.preheader, !llvm.loop !16

83:                                               ; preds = %.loopexit, %.loopexit.split-lp, %71
  %.pn = phi { ptr, i32 } [ %72, %71 ], [ %lpad.loopexit, %.loopexit ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ]
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #7
  br label %89

84:                                               ; preds = %79
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #7
  br label %88

85:                                               ; preds = %81
  %86 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef -1)
  %87 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %86, i8 noundef signext 10)
  br label %88

88:                                               ; preds = %84, %85
  ret i32 0

89:                                               ; preds = %83, %50
  %.pn46.pn = phi { ptr, i32 } [ %.pn46, %50 ], [ %.pn, %83 ]
  resume { ptr, i32 } %.pn46.pn
}

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIxSaIxEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1 align 2

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.ctpop.i32(i32) #5

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4trie3insERSt6vectorIxSaIxEEx(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZN4trie6searchERSt6vectorIxSaIxEE(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3 align 2

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

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

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #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 = { 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 #2 = { "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" }
attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = !{!"long long", !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}
!16 = distinct !{!16, !12}


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