; LLVM IR from eyangch/competitive-programming :: Codeforces/1415 (d)

; 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 [100000 x i32], align 16
@pfx = external dso_local global [100001 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
  store i32 0, ptr %1, align 4
  %13 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %14 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %15 = getelementptr i8, ptr %14, i64 -24
  %16 = load i64, ptr %15, align 8
  %17 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %16
  %18 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %17, ptr noundef null)
  %19 = 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) #7
  store i32 0, ptr %2, align 4, !tbaa !8
  br label %20

20:                                               ; preds = %43, %0
  %21 = load i32, ptr %2, align 4, !tbaa !8
  %22 = load i32, ptr @N, align 4, !tbaa !8
  %23 = icmp slt i32 %21, %22
  br i1 %23, label %25, label %24

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

25:                                               ; preds = %20
  %26 = load i32, ptr %2, align 4, !tbaa !8
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %27
  %29 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %28)
  %30 = load i32, ptr %2, align 4, !tbaa !8
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [100001 x i32], ptr @pfx, i64 0, i64 %31
  %33 = load i32, ptr %32, align 4, !tbaa !8
  %34 = load i32, ptr %2, align 4, !tbaa !8
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %35
  %37 = load i32, ptr %36, align 4, !tbaa !8
  %38 = xor i32 %33, %37
  %39 = load i32, ptr %2, align 4, !tbaa !8
  %40 = add nsw i32 %39, 1
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [100001 x i32], ptr @pfx, i64 0, i64 %41
  store i32 %38, ptr %42, align 4, !tbaa !8
  br label %43

43:                                               ; preds = %25
  %44 = load i32, ptr %2, align 4, !tbaa !8
  %45 = add nsw i32 %44, 1
  store i32 %45, ptr %2, align 4, !tbaa !8
  br label %20, !llvm.loop !11

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

47:                                               ; preds = %85, %46
  %48 = load i32, ptr %3, align 4, !tbaa !8
  %49 = load i32, ptr @N, align 4, !tbaa !8
  %50 = sub nsw i32 %49, 1
  %51 = icmp slt i32 %48, %50
  br i1 %51, label %53, label %52

52:                                               ; preds = %47
  store i32 5, ptr %4, align 4
  br label %88

53:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  %54 = load i32, ptr %3, align 4, !tbaa !8
  %55 = sub nsw i32 %54, 1
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %56
  %58 = load i32, ptr %57, align 4, !tbaa !8
  %59 = call i32 @llvm.ctlz.i32(i32 %58, i1 true)
  store i32 %59, ptr %5, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  %60 = load i32, ptr %3, align 4, !tbaa !8
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %61
  %63 = load i32, ptr %62, align 4, !tbaa !8
  %64 = call i32 @llvm.ctlz.i32(i32 %63, i1 true)
  store i32 %64, ptr %6, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  %65 = load i32, ptr %3, align 4, !tbaa !8
  %66 = add nsw i32 %65, 1
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %67
  %69 = load i32, ptr %68, align 4, !tbaa !8
  %70 = call i32 @llvm.ctlz.i32(i32 %69, i1 true)
  store i32 %70, ptr %7, align 4, !tbaa !8
  %71 = load i32, ptr %5, align 4, !tbaa !8
  %72 = load i32, ptr %6, align 4, !tbaa !8
  %73 = icmp eq i32 %71, %72
  br i1 %73, label %74, label %81

74:                                               ; preds = %53
  %75 = load i32, ptr %6, align 4, !tbaa !8
  %76 = load i32, ptr %7, align 4, !tbaa !8
  %77 = icmp eq i32 %75, %76
  br i1 %77, label %78, label %81

78:                                               ; preds = %74
  %79 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 1)
  %80 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %79, ptr noundef @.str)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %4, align 4
  br label %82

81:                                               ; preds = %74, %53
  store i32 0, ptr %4, align 4
  br label %82

82:                                               ; preds = %81, %78
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  %83 = load i32, ptr %4, align 4
  switch i32 %83, label %88 [
    i32 0, label %84
  ]

84:                                               ; preds = %82
  br label %85

85:                                               ; preds = %84
  %86 = load i32, ptr %3, align 4, !tbaa !8
  %87 = add nsw i32 %86, 1
  store i32 %87, ptr %3, align 4, !tbaa !8
  br label %47, !llvm.loop !13

88:                                               ; preds = %82, %52
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  %89 = load i32, ptr %4, align 4
  switch i32 %89, label %168 [
    i32 5, label %90
    i32 1, label %166
  ]

90:                                               ; preds = %88
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  store i32 1000000000, ptr %8, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  store i32 1, ptr %9, align 4, !tbaa !8
  br label %91

91:                                               ; preds = %152, %90
  %92 = load i32, ptr %9, align 4, !tbaa !8
  %93 = load i32, ptr @N, align 4, !tbaa !8
  %94 = icmp sle i32 %92, %93
  br i1 %94, label %96, label %95

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

96:                                               ; preds = %91
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  %97 = load i32, ptr %9, align 4, !tbaa !8
  store i32 %97, ptr %10, align 4, !tbaa !8
  br label %98

98:                                               ; preds = %148, %96
  %99 = load i32, ptr %10, align 4, !tbaa !8
  %100 = load i32, ptr @N, align 4, !tbaa !8
  %101 = icmp sle i32 %99, %100
  br i1 %101, label %103, label %102

102:                                              ; preds = %98
  store i32 11, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %151

103:                                              ; preds = %98
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  %104 = load i32, ptr %10, align 4, !tbaa !8
  %105 = add nsw i32 %104, 1
  store i32 %105, ptr %11, align 4, !tbaa !8
  br label %106

106:                                              ; preds = %144, %103
  %107 = load i32, ptr %11, align 4, !tbaa !8
  %108 = load i32, ptr @N, align 4, !tbaa !8
  %109 = icmp sle i32 %107, %108
  br i1 %109, label %111, label %110

110:                                              ; preds = %106
  store i32 14, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %147

111:                                              ; preds = %106
  %112 = load i32, ptr %10, align 4, !tbaa !8
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds [100001 x i32], ptr @pfx, i64 0, i64 %113
  %115 = load i32, ptr %114, align 4, !tbaa !8
  %116 = load i32, ptr %9, align 4, !tbaa !8
  %117 = sub nsw i32 %116, 1
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [100001 x i32], ptr @pfx, i64 0, i64 %118
  %120 = load i32, ptr %119, align 4, !tbaa !8
  %121 = xor i32 %115, %120
  %122 = load i32, ptr %11, align 4, !tbaa !8
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds [100001 x i32], ptr @pfx, i64 0, i64 %123
  %125 = load i32, ptr %124, align 4, !tbaa !8
  %126 = load i32, ptr %10, align 4, !tbaa !8
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds [100001 x i32], ptr @pfx, i64 0, i64 %127
  %129 = load i32, ptr %128, align 4, !tbaa !8
  %130 = xor i32 %125, %129
  %131 = icmp sgt i32 %121, %130
  br i1 %131, label %132, label %143

132:                                              ; preds = %111
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  %133 = load i32, ptr %11, align 4, !tbaa !8
  %134 = load i32, ptr %10, align 4, !tbaa !8
  %135 = sub nsw i32 %133, %134
  %136 = sub nsw i32 %135, 1
  %137 = load i32, ptr %10, align 4, !tbaa !8
  %138 = add nsw i32 %136, %137
  %139 = load i32, ptr %9, align 4, !tbaa !8
  %140 = sub nsw i32 %138, %139
  store i32 %140, ptr %12, align 4, !tbaa !8
  %141 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 4 dereferenceable(4) %12)
  %142 = load i32, ptr %141, align 4, !tbaa !8
  store i32 %142, ptr %8, align 4, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  br label %143

143:                                              ; preds = %132, %111
  br label %144

144:                                              ; preds = %143
  %145 = load i32, ptr %11, align 4, !tbaa !8
  %146 = add nsw i32 %145, 1
  store i32 %146, ptr %11, align 4, !tbaa !8
  br label %106, !llvm.loop !14

147:                                              ; preds = %110
  br label %148

148:                                              ; preds = %147
  %149 = load i32, ptr %10, align 4, !tbaa !8
  %150 = add nsw i32 %149, 1
  store i32 %150, ptr %10, align 4, !tbaa !8
  br label %98, !llvm.loop !15

151:                                              ; preds = %102
  br label %152

152:                                              ; preds = %151
  %153 = load i32, ptr %9, align 4, !tbaa !8
  %154 = add nsw i32 %153, 1
  store i32 %154, ptr %9, align 4, !tbaa !8
  br label %91, !llvm.loop !16

155:                                              ; preds = %95
  %156 = load i32, ptr %8, align 4, !tbaa !8
  %157 = sitofp i32 %156 to double
  %158 = fcmp olt double %157, 1.000000e+09
  br i1 %158, label %159, label %161

159:                                              ; preds = %155
  %160 = load i32, ptr %8, align 4, !tbaa !8
  br label %162

161:                                              ; preds = %155
  br label %162

162:                                              ; preds = %161, %159
  %163 = phi i32 [ %160, %159 ], [ -1, %161 ]
  %164 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %163)
  %165 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %164, ptr noundef @.str)
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  br label %166

166:                                              ; preds = %162, %88
  %167 = load i32, ptr %1, align 4
  ret i32 %167

168:                                              ; preds = %88
  unreachable
}

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

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) #2 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)) #1

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.ctlz.i32(i32, i1 immarg) #4

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #6

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

%"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 [100000 x i32], align 16
@pfx = external dso_local local_unnamed_addr global [100001 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 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %4 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %5 = getelementptr i8, ptr %4, i64 -24
  %6 = load i64, ptr %5, align 8
  %7 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %6
  %8 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %7, ptr noundef null)
  %9 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @N)
  %10 = load i32, ptr @N, align 4, !tbaa !8
  %11 = icmp sgt i32 %10, 0
  br i1 %11, label %.lr.ph, label %._crit_edge.thread

._crit_edge.thread:                               ; preds = %0
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  store i32 1000000000, ptr %1, align 4, !tbaa !8
  br label %._crit_edge61.thread

.preheader47:                                     ; preds = %.lr.ph
  %12 = icmp sgt i32 %21, 2
  br i1 %12, label %.lr.ph50.preheader, label %._crit_edge

.lr.ph50.preheader:                               ; preds = %.preheader47
  %13 = add nsw i32 %21, -1
  %wide.trip.count = zext nneg i32 %13 to i64
  %.pre = load i32, ptr @a, align 16, !tbaa !8
  br label %.lr.ph50

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %14 = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %indvars.iv
  %15 = 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) %14)
  %16 = getelementptr inbounds [100001 x i32], ptr @pfx, i64 0, i64 %indvars.iv
  %17 = load i32, ptr %16, align 4, !tbaa !8
  %18 = load i32, ptr %14, align 4, !tbaa !8
  %19 = xor i32 %18, %17
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %20 = getelementptr inbounds [100001 x i32], ptr @pfx, i64 0, i64 %indvars.iv.next
  store i32 %19, ptr %20, align 4, !tbaa !8
  %21 = load i32, ptr @N, align 4, !tbaa !8
  %22 = sext i32 %21 to i64
  %23 = icmp slt i64 %indvars.iv.next, %22
  br i1 %23, label %.lr.ph, label %.preheader47, !llvm.loop !11

.lr.ph50:                                         ; preds = %.lr.ph50.preheader, %35
  %24 = phi i32 [ %.pre, %.lr.ph50.preheader ], [ %27, %35 ]
  %indvars.iv64 = phi i64 [ 1, %.lr.ph50.preheader ], [ %indvars.iv.next65, %35 ]
  %25 = tail call range(i32 0, 33) i32 @llvm.ctlz.i32(i32 %24, i1 true)
  %26 = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %indvars.iv64
  %27 = load i32, ptr %26, align 4, !tbaa !8
  %28 = tail call range(i32 0, 33) i32 @llvm.ctlz.i32(i32 %27, i1 true)
  %indvars.iv.next65 = add nuw nsw i64 %indvars.iv64, 1
  %29 = icmp eq i32 %25, %28
  br i1 %29, label %30, label %35

30:                                               ; preds = %.lr.ph50
  %31 = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %indvars.iv.next65
  %32 = load i32, ptr %31, align 4, !tbaa !8
  %33 = tail call range(i32 0, 33) i32 @llvm.ctlz.i32(i32 %32, i1 true)
  %34 = icmp eq i32 %25, %33
  br i1 %34, label %36, label %35

35:                                               ; preds = %30, %.lr.ph50
  %exitcond.not = icmp eq i64 %indvars.iv.next65, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph50, !llvm.loop !13

36:                                               ; preds = %30
  %37 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 1)
  %38 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %37, ptr noundef nonnull @.str)
  br label %83

._crit_edge:                                      ; preds = %35, %.preheader47
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  store i32 1000000000, ptr %1, align 4, !tbaa !8
  %.not59 = icmp slt i32 %21, 1
  br i1 %.not59, label %._crit_edge61.thread, label %.preheader

.preheader:                                       ; preds = %._crit_edge, %._crit_edge58
  %39 = phi i32 [ %.fr, %._crit_edge58 ], [ 1000000000, %._crit_edge ]
  %40 = phi i32 [ %54, %._crit_edge58 ], [ %21, %._crit_edge ]
  %indvars.iv74 = phi i64 [ %indvars.iv.next75, %._crit_edge58 ], [ 1, %._crit_edge ]
  %indvars.iv67 = phi i64 [ %indvars.iv.next68, %._crit_edge58 ], [ 2, %._crit_edge ]
  %41 = sext i32 %40 to i64
  %.not4255 = icmp sgt i64 %indvars.iv74, %41
  br i1 %.not4255, label %._crit_edge58, label %.lr.ph57

.lr.ph57:                                         ; preds = %.preheader
  %42 = add nsw i64 %indvars.iv74, -1
  %43 = getelementptr inbounds [100001 x i32], ptr @pfx, i64 0, i64 %42
  %44 = trunc i64 %indvars.iv74 to i32
  %45 = xor i32 %44, -1
  br label %55

._crit_edge61:                                    ; preds = %._crit_edge58
  %46 = icmp slt i32 %.fr, 1000000000
  %spec.select = select i1 %46, i32 %.fr, i32 -1
  br label %._crit_edge61.thread

._crit_edge61.thread:                             ; preds = %._crit_edge61, %._crit_edge.thread, %._crit_edge
  %47 = phi i32 [ -1, %._crit_edge ], [ -1, %._crit_edge.thread ], [ %spec.select, %._crit_edge61 ]
  %48 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %47)
  %49 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %48, ptr noundef nonnull @.str)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  br label %83

.loopexit.loopexit:                               ; preds = %78
  %.pre82 = sext i32 %81 to i64
  br label %.loopexit

.loopexit:                                        ; preds = %.loopexit.loopexit, %55
  %.pre-phi83 = phi i64 [ %.pre82, %.loopexit.loopexit ], [ %59, %55 ]
  %50 = phi i32 [ %79, %.loopexit.loopexit ], [ %56, %55 ]
  %51 = phi i32 [ %80, %.loopexit.loopexit ], [ %57, %55 ]
  %52 = phi i32 [ %81, %.loopexit.loopexit ], [ %58, %55 ]
  %.not42.not = icmp slt i64 %indvars.iv76, %.pre-phi83
  %indvars.iv.next70 = add nuw nsw i64 %indvars.iv69, 1
  br i1 %.not42.not, label %55, label %._crit_edge58.loopexit, !llvm.loop !14

._crit_edge58.loopexit:                           ; preds = %.loopexit
  %.pre81 = sext i32 %51 to i64
  br label %._crit_edge58

._crit_edge58:                                    ; preds = %._crit_edge58.loopexit, %.preheader
  %.pre-phi = phi i64 [ %.pre81, %._crit_edge58.loopexit ], [ %41, %.preheader ]
  %53 = phi i32 [ %50, %._crit_edge58.loopexit ], [ %39, %.preheader ]
  %54 = phi i32 [ %51, %._crit_edge58.loopexit ], [ %40, %.preheader ]
  %.fr = freeze i32 %53
  %indvars.iv.next75 = add nuw nsw i64 %indvars.iv74, 1
  %.not.not = icmp slt i64 %indvars.iv74, %.pre-phi
  %indvars.iv.next68 = add nuw nsw i64 %indvars.iv67, 1
  br i1 %.not.not, label %.preheader, label %._crit_edge61, !llvm.loop !15

55:                                               ; preds = %.lr.ph57, %.loopexit
  %56 = phi i32 [ %39, %.lr.ph57 ], [ %50, %.loopexit ]
  %57 = phi i32 [ %40, %.lr.ph57 ], [ %51, %.loopexit ]
  %58 = phi i32 [ %40, %.lr.ph57 ], [ %52, %.loopexit ]
  %indvars.iv76 = phi i64 [ %indvars.iv74, %.lr.ph57 ], [ %indvars.iv.next77, %.loopexit ]
  %indvars.iv69 = phi i64 [ %indvars.iv67, %.lr.ph57 ], [ %indvars.iv.next70, %.loopexit ]
  %indvars.iv.next77 = add nuw nsw i64 %indvars.iv76, 1
  %59 = sext i32 %58 to i64
  %.not4351.not = icmp slt i64 %indvars.iv76, %59
  br i1 %.not4351.not, label %.lr.ph54, label %.loopexit

.lr.ph54:                                         ; preds = %55
  %60 = getelementptr inbounds [100001 x i32], ptr @pfx, i64 0, i64 %indvars.iv76
  br label %61

61:                                               ; preds = %.lr.ph54, %78
  %62 = phi i32 [ %56, %.lr.ph54 ], [ %79, %78 ]
  %63 = phi i32 [ %57, %.lr.ph54 ], [ %80, %78 ]
  %64 = phi i32 [ %58, %.lr.ph54 ], [ %81, %78 ]
  %65 = phi i32 [ %58, %.lr.ph54 ], [ %82, %78 ]
  %indvars.iv71 = phi i64 [ %indvars.iv69, %.lr.ph54 ], [ %indvars.iv.next72, %78 ]
  %66 = load i32, ptr %60, align 4, !tbaa !8
  %67 = load i32, ptr %43, align 4, !tbaa !8
  %68 = xor i32 %67, %66
  %69 = getelementptr inbounds [100001 x i32], ptr @pfx, i64 0, i64 %indvars.iv71
  %70 = load i32, ptr %69, align 4, !tbaa !8
  %71 = xor i32 %70, %66
  %72 = icmp sgt i32 %68, %71
  br i1 %72, label %73, label %._crit_edge84

._crit_edge84:                                    ; preds = %61
  %.pre85 = trunc nuw i64 %indvars.iv71 to i32
  br label %78

73:                                               ; preds = %61
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  %74 = trunc nuw i64 %indvars.iv71 to i32
  %75 = add nsw i32 %74, %45
  store i32 %75, ptr %2, align 4, !tbaa !8
  %76 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %77 = load i32, ptr %76, align 4, !tbaa !8
  store i32 %77, ptr %1, align 4, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  %.pre80 = load i32, ptr @N, align 4, !tbaa !8
  br label %78

78:                                               ; preds = %._crit_edge84, %73
  %.pre-phi86 = phi i32 [ %.pre85, %._crit_edge84 ], [ %74, %73 ]
  %79 = phi i32 [ %62, %._crit_edge84 ], [ %77, %73 ]
  %80 = phi i32 [ %63, %._crit_edge84 ], [ %.pre80, %73 ]
  %81 = phi i32 [ %64, %._crit_edge84 ], [ %.pre80, %73 ]
  %82 = phi i32 [ %65, %._crit_edge84 ], [ %.pre80, %73 ]
  %indvars.iv.next72 = add nuw nsw i64 %indvars.iv71, 1
  %.not43.not = icmp slt i32 %.pre-phi86, %82
  br i1 %.not43.not, label %61, label %.loopexit.loopexit, !llvm.loop !16

83:                                               ; preds = %36, %._crit_edge61.thread
  ret i32 0
}

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

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) local_unnamed_addr #2 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 #1

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

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.ctlz.i32(i32, i1 immarg) #4

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #6

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


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