; LLVM IR from kazunetakahashi/atcoder :: 2017/1104_ARC084 (C)

; 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 [100010 x i32], align 16
@B = external dso_local global [100010 x i32], align 16
@C = external dso_local global [100010 x i32], align 16
@Bcnt = external dso_local global [100010 x i64], align 16
@Acnt = external dso_local global [100010 x i64], align 16
@_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 {
  %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 i64, align 8
  %10 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %11 = 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
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %12

12:                                               ; preds = %22, %0
  %13 = load i32, ptr %2, align 4, !tbaa !5
  %14 = load i32, ptr @N, align 4, !tbaa !5
  %15 = icmp slt i32 %13, %14
  br i1 %15, label %17, label %16

16:                                               ; preds = %12
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  br label %25

17:                                               ; preds = %12
  %18 = load i32, ptr %2, align 4, !tbaa !5
  %19 = sext i32 %18 to i64
  %20 = getelementptr inbounds [100010 x i32], ptr @A, i64 0, i64 %19
  %21 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %20)
  br label %22

22:                                               ; preds = %17
  %23 = load i32, ptr %2, align 4, !tbaa !5
  %24 = add nsw i32 %23, 1
  store i32 %24, ptr %2, align 4, !tbaa !5
  br label %12, !llvm.loop !9

25:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %26

26:                                               ; preds = %36, %25
  %27 = load i32, ptr %3, align 4, !tbaa !5
  %28 = load i32, ptr @N, align 4, !tbaa !5
  %29 = icmp slt i32 %27, %28
  br i1 %29, label %31, label %30

30:                                               ; preds = %26
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  br label %39

31:                                               ; preds = %26
  %32 = load i32, ptr %3, align 4, !tbaa !5
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [100010 x i32], ptr @B, i64 0, i64 %33
  %35 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %34)
  br label %36

36:                                               ; preds = %31
  %37 = load i32, ptr %3, align 4, !tbaa !5
  %38 = add nsw i32 %37, 1
  store i32 %38, ptr %3, align 4, !tbaa !5
  br label %26, !llvm.loop !11

39:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %40

40:                                               ; preds = %50, %39
  %41 = load i32, ptr %4, align 4, !tbaa !5
  %42 = load i32, ptr @N, align 4, !tbaa !5
  %43 = icmp slt i32 %41, %42
  br i1 %43, label %45, label %44

44:                                               ; preds = %40
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  br label %53

45:                                               ; preds = %40
  %46 = load i32, ptr %4, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [100010 x i32], ptr @C, i64 0, i64 %47
  %49 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %48)
  br label %50

50:                                               ; preds = %45
  %51 = load i32, ptr %4, align 4, !tbaa !5
  %52 = add nsw i32 %51, 1
  store i32 %52, ptr %4, align 4, !tbaa !5
  br label %40, !llvm.loop !12

53:                                               ; preds = %44
  %54 = load i32, ptr @N, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds i32, ptr @A, i64 %55
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef @A, ptr noundef %56)
  %57 = load i32, ptr @N, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds i32, ptr @B, i64 %58
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef @B, ptr noundef %59)
  %60 = load i32, ptr @N, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds i32, ptr @C, i64 %61
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef @C, ptr noundef %62)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  store i32 0, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %63

63:                                               ; preds = %95, %53
  %64 = load i32, ptr %5, align 4, !tbaa !5
  %65 = load i32, ptr @N, align 4, !tbaa !5
  %66 = icmp slt i32 %64, %65
  br i1 %66, label %67, label %71

67:                                               ; preds = %63
  %68 = load i32, ptr %6, align 4, !tbaa !5
  %69 = load i32, ptr @N, align 4, !tbaa !5
  %70 = icmp slt i32 %68, %69
  br label %71

71:                                               ; preds = %67, %63
  %72 = phi i1 [ false, %63 ], [ %70, %67 ]
  br i1 %72, label %73, label %96

73:                                               ; preds = %71
  %74 = load i32, ptr %5, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [100010 x i32], ptr @B, i64 0, i64 %75
  %77 = load i32, ptr %76, align 4, !tbaa !5
  %78 = load i32, ptr %6, align 4, !tbaa !5
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [100010 x i32], ptr @C, i64 0, i64 %79
  %81 = load i32, ptr %80, align 4, !tbaa !5
  %82 = icmp sge i32 %77, %81
  br i1 %82, label %83, label %86

83:                                               ; preds = %73
  %84 = load i32, ptr %6, align 4, !tbaa !5
  %85 = add nsw i32 %84, 1
  store i32 %85, ptr %6, align 4, !tbaa !5
  br label %95

86:                                               ; preds = %73
  %87 = load i32, ptr @N, align 4, !tbaa !5
  %88 = load i32, ptr %6, align 4, !tbaa !5
  %89 = sub nsw i32 %87, %88
  %90 = sext i32 %89 to i64
  %91 = load i32, ptr %5, align 4, !tbaa !5
  %92 = add nsw i32 %91, 1
  store i32 %92, ptr %5, align 4, !tbaa !5
  %93 = sext i32 %91 to i64
  %94 = getelementptr inbounds [100010 x i64], ptr @Bcnt, i64 0, i64 %93
  store i64 %90, ptr %94, align 8, !tbaa !13
  br label %95

95:                                               ; preds = %86, %83
  br label %63, !llvm.loop !15

96:                                               ; preds = %71
  br label %97

97:                                               ; preds = %101, %96
  %98 = load i32, ptr %5, align 4, !tbaa !5
  %99 = load i32, ptr @N, align 4, !tbaa !5
  %100 = icmp slt i32 %98, %99
  br i1 %100, label %101, label %106

101:                                              ; preds = %97
  %102 = load i32, ptr %5, align 4, !tbaa !5
  %103 = add nsw i32 %102, 1
  store i32 %103, ptr %5, align 4, !tbaa !5
  %104 = sext i32 %102 to i64
  %105 = getelementptr inbounds [100010 x i64], ptr @Bcnt, i64 0, i64 %104
  store i64 0, ptr %105, align 8, !tbaa !13
  br label %97, !llvm.loop !16

106:                                              ; preds = %97
  %107 = load i32, ptr @N, align 4, !tbaa !5
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [100010 x i64], ptr @Bcnt, i64 0, i64 %108
  store i64 0, ptr %109, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  %110 = load i32, ptr @N, align 4, !tbaa !5
  store i32 %110, ptr %7, align 4, !tbaa !5
  br label %111

111:                                              ; preds = %126, %106
  %112 = load i32, ptr %7, align 4, !tbaa !5
  %113 = icmp sge i32 %112, 1
  br i1 %113, label %115, label %114

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

115:                                              ; preds = %111
  %116 = load i32, ptr %7, align 4, !tbaa !5
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds [100010 x i64], ptr @Bcnt, i64 0, i64 %117
  %119 = load i64, ptr %118, align 8, !tbaa !13
  %120 = load i32, ptr %7, align 4, !tbaa !5
  %121 = sub nsw i32 %120, 1
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds [100010 x i64], ptr @Bcnt, i64 0, i64 %122
  %124 = load i64, ptr %123, align 8, !tbaa !13
  %125 = add nsw i64 %124, %119
  store i64 %125, ptr %123, align 8, !tbaa !13
  br label %126

126:                                              ; preds = %115
  %127 = load i32, ptr %7, align 4, !tbaa !5
  %128 = add nsw i32 %127, -1
  store i32 %128, ptr %7, align 4, !tbaa !5
  br label %111, !llvm.loop !17

129:                                              ; preds = %114
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 0, ptr %8, align 4, !tbaa !5
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %130

130:                                              ; preds = %162, %129
  %131 = load i32, ptr %8, align 4, !tbaa !5
  %132 = load i32, ptr @N, align 4, !tbaa !5
  %133 = icmp slt i32 %131, %132
  br i1 %133, label %134, label %138

134:                                              ; preds = %130
  %135 = load i32, ptr %5, align 4, !tbaa !5
  %136 = load i32, ptr @N, align 4, !tbaa !5
  %137 = icmp slt i32 %135, %136
  br label %138

138:                                              ; preds = %134, %130
  %139 = phi i1 [ false, %130 ], [ %137, %134 ]
  br i1 %139, label %140, label %163

140:                                              ; preds = %138
  %141 = load i32, ptr %8, align 4, !tbaa !5
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds [100010 x i32], ptr @A, i64 0, i64 %142
  %144 = load i32, ptr %143, align 4, !tbaa !5
  %145 = load i32, ptr %5, align 4, !tbaa !5
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds [100010 x i32], ptr @B, i64 0, i64 %146
  %148 = load i32, ptr %147, align 4, !tbaa !5
  %149 = icmp sge i32 %144, %148
  br i1 %149, label %150, label %153

150:                                              ; preds = %140
  %151 = load i32, ptr %5, align 4, !tbaa !5
  %152 = add nsw i32 %151, 1
  store i32 %152, ptr %5, align 4, !tbaa !5
  br label %162

153:                                              ; preds = %140
  %154 = load i32, ptr %5, align 4, !tbaa !5
  %155 = sext i32 %154 to i64
  %156 = getelementptr inbounds [100010 x i64], ptr @Bcnt, i64 0, i64 %155
  %157 = load i64, ptr %156, align 8, !tbaa !13
  %158 = load i32, ptr %8, align 4, !tbaa !5
  %159 = add nsw i32 %158, 1
  store i32 %159, ptr %8, align 4, !tbaa !5
  %160 = sext i32 %158 to i64
  %161 = getelementptr inbounds [100010 x i64], ptr @Acnt, i64 0, i64 %160
  store i64 %157, ptr %161, align 8, !tbaa !13
  br label %162

162:                                              ; preds = %153, %150
  br label %130, !llvm.loop !18

163:                                              ; preds = %138
  br label %164

164:                                              ; preds = %168, %163
  %165 = load i32, ptr %8, align 4, !tbaa !5
  %166 = load i32, ptr @N, align 4, !tbaa !5
  %167 = icmp slt i32 %165, %166
  br i1 %167, label %168, label %173

168:                                              ; preds = %164
  %169 = load i32, ptr %8, align 4, !tbaa !5
  %170 = add nsw i32 %169, 1
  store i32 %170, ptr %8, align 4, !tbaa !5
  %171 = sext i32 %169 to i64
  %172 = getelementptr inbounds [100010 x i64], ptr @Acnt, i64 0, i64 %171
  store i64 0, ptr %172, align 8, !tbaa !13
  br label %164, !llvm.loop !19

173:                                              ; preds = %164
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  store i64 0, ptr %9, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %174

174:                                              ; preds = %186, %173
  %175 = load i32, ptr %10, align 4, !tbaa !5
  %176 = load i32, ptr @N, align 4, !tbaa !5
  %177 = icmp slt i32 %175, %176
  br i1 %177, label %179, label %178

178:                                              ; preds = %174
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %189

179:                                              ; preds = %174
  %180 = load i32, ptr %10, align 4, !tbaa !5
  %181 = sext i32 %180 to i64
  %182 = getelementptr inbounds [100010 x i64], ptr @Acnt, i64 0, i64 %181
  %183 = load i64, ptr %182, align 8, !tbaa !13
  %184 = load i64, ptr %9, align 8, !tbaa !13
  %185 = add nsw i64 %184, %183
  store i64 %185, ptr %9, align 8, !tbaa !13
  br label %186

186:                                              ; preds = %179
  %187 = load i32, ptr %10, align 4, !tbaa !5
  %188 = add nsw i32 %187, 1
  store i32 %188, ptr %10, align 4, !tbaa !5
  br label %174, !llvm.loop !20

189:                                              ; preds = %178
  %190 = load i64, ptr %9, align 8, !tbaa !13
  %191 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %190)
  %192 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %191, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  %193 = load i32, ptr %1, align 4
  ret i32 %193
}

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 dso_local void @_ZSt4sortIPiEvT_S1_(ptr noundef, ptr noundef) #3

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

; 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}
!13 = !{!14, !14, i64 0}
!14 = !{!"long long", !7, i64 0}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !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 [100010 x i32], align 16
@B = external dso_local global [100010 x i32], align 16
@C = external dso_local global [100010 x i32], align 16
@Bcnt = external dso_local local_unnamed_addr global [100010 x i64], align 16
@Acnt = external dso_local local_unnamed_addr global [100010 x i64], align 16
@_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 {
  %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)
  %2 = load i32, ptr @N, align 4, !tbaa !5
  %3 = icmp sgt i32 %2, 0
  br i1 %3, label %.lr.ph, label %.preheader55.._crit_edge_crit_edge

.preheader56:                                     ; preds = %.lr.ph
  %4 = icmp sgt i32 %7, 0
  br i1 %4, label %.lr.ph60, label %.preheader55.._crit_edge_crit_edge

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %5 = getelementptr inbounds [100010 x i32], ptr @A, i64 0, i64 %indvars.iv
  %6 = 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) %5)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %7 = load i32, ptr @N, align 4, !tbaa !5
  %8 = sext i32 %7 to i64
  %9 = icmp slt i64 %indvars.iv.next, %8
  br i1 %9, label %.lr.ph, label %.preheader56, !llvm.loop !9

.preheader55:                                     ; preds = %.lr.ph60
  %10 = icmp sgt i32 %14, 0
  br i1 %10, label %.lr.ph62, label %.preheader55.._crit_edge_crit_edge

.preheader55.._crit_edge_crit_edge:               ; preds = %0, %.preheader56, %.preheader55
  %11 = phi i32 [ %14, %.preheader55 ], [ %7, %.preheader56 ], [ %2, %0 ]
  %.pre107 = sext i32 %11 to i64
  br label %._crit_edge

.lr.ph60:                                         ; preds = %.preheader56, %.lr.ph60
  %indvars.iv88 = phi i64 [ %indvars.iv.next89, %.lr.ph60 ], [ 0, %.preheader56 ]
  %12 = getelementptr inbounds [100010 x i32], ptr @B, i64 0, i64 %indvars.iv88
  %13 = 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) %12)
  %indvars.iv.next89 = add nuw nsw i64 %indvars.iv88, 1
  %14 = load i32, ptr @N, align 4, !tbaa !5
  %15 = sext i32 %14 to i64
  %16 = icmp slt i64 %indvars.iv.next89, %15
  br i1 %16, label %.lr.ph60, label %.preheader55, !llvm.loop !11

._crit_edge:                                      ; preds = %.lr.ph62, %.preheader55.._crit_edge_crit_edge
  %.pre-phi = phi i64 [ %.pre107, %.preheader55.._crit_edge_crit_edge ], [ %29, %.lr.ph62 ]
  %17 = getelementptr inbounds i32, ptr @A, i64 %.pre-phi
  tail call void @_ZSt4sortIPiEvT_S1_(ptr noundef nonnull @A, ptr noundef nonnull %17)
  %18 = load i32, ptr @N, align 4, !tbaa !5
  %19 = sext i32 %18 to i64
  %20 = getelementptr inbounds i32, ptr @B, i64 %19
  tail call void @_ZSt4sortIPiEvT_S1_(ptr noundef nonnull @B, ptr noundef nonnull %20)
  %21 = load i32, ptr @N, align 4, !tbaa !5
  %22 = sext i32 %21 to i64
  %23 = getelementptr inbounds i32, ptr @C, i64 %22
  tail call void @_ZSt4sortIPiEvT_S1_(ptr noundef nonnull @C, ptr noundef nonnull %23)
  %24 = load i32, ptr @N, align 4
  %25 = icmp sgt i32 %24, 0
  br i1 %25, label %.lr.ph66, label %.preheader54

.lr.ph62:                                         ; preds = %.preheader55, %.lr.ph62
  %indvars.iv91 = phi i64 [ %indvars.iv.next92, %.lr.ph62 ], [ 0, %.preheader55 ]
  %26 = getelementptr inbounds [100010 x i32], ptr @C, i64 0, i64 %indvars.iv91
  %27 = 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) %26)
  %indvars.iv.next92 = add nuw nsw i64 %indvars.iv91, 1
  %28 = load i32, ptr @N, align 4, !tbaa !5
  %29 = sext i32 %28 to i64
  %30 = icmp slt i64 %indvars.iv.next92, %29
  br i1 %30, label %.lr.ph62, label %._crit_edge, !llvm.loop !12

.preheader54:                                     ; preds = %52, %._crit_edge
  %.042.lcssa = phi i32 [ 0, %._crit_edge ], [ %.143, %52 ]
  %31 = icmp slt i32 %.042.lcssa, %24
  br i1 %31, label %.lr.ph70.preheader, label %._crit_edge71

.lr.ph70.preheader:                               ; preds = %.preheader54
  %32 = sext i32 %.042.lcssa to i64
  %33 = shl nsw i64 %32, 3
  %scevgep = getelementptr i8, ptr @Bcnt, i64 %33
  %34 = xor i32 %.042.lcssa, -1
  %35 = add i32 %24, %34
  %36 = zext i32 %35 to i64
  %37 = shl nuw nsw i64 %36, 3
  %38 = add nuw nsw i64 %37, 8
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(1) %scevgep, i8 0, i64 %38, i1 false), !tbaa !13
  br label %._crit_edge71

.lr.ph66:                                         ; preds = %._crit_edge, %52
  %.04064 = phi i32 [ %.141, %52 ], [ 0, %._crit_edge ]
  %.04263 = phi i32 [ %.143, %52 ], [ 0, %._crit_edge ]
  %39 = sext i32 %.04263 to i64
  %40 = getelementptr inbounds [100010 x i32], ptr @B, i64 0, i64 %39
  %41 = load i32, ptr %40, align 4, !tbaa !5
  %42 = sext i32 %.04064 to i64
  %43 = getelementptr inbounds [100010 x i32], ptr @C, i64 0, i64 %42
  %44 = load i32, ptr %43, align 4, !tbaa !5
  %.not51 = icmp slt i32 %41, %44
  br i1 %.not51, label %47, label %45

45:                                               ; preds = %.lr.ph66
  %46 = add nsw i32 %.04064, 1
  br label %52

47:                                               ; preds = %.lr.ph66
  %48 = sub nsw i32 %24, %.04064
  %49 = sext i32 %48 to i64
  %50 = add nsw i32 %.04263, 1
  %51 = getelementptr inbounds [100010 x i64], ptr @Bcnt, i64 0, i64 %39
  store i64 %49, ptr %51, align 8, !tbaa !13
  br label %52

52:                                               ; preds = %47, %45
  %.143 = phi i32 [ %.04263, %45 ], [ %50, %47 ]
  %.141 = phi i32 [ %46, %45 ], [ %.04064, %47 ]
  %53 = icmp slt i32 %.143, %24
  %54 = icmp slt i32 %.141, %24
  %55 = select i1 %53, i1 %54, i1 false
  br i1 %55, label %.lr.ph66, label %.preheader54, !llvm.loop !15

._crit_edge71:                                    ; preds = %.lr.ph70.preheader, %.preheader54
  %56 = sext i32 %24 to i64
  %57 = getelementptr inbounds [100010 x i64], ptr @Bcnt, i64 0, i64 %56
  store i64 0, ptr %57, align 8, !tbaa !13
  br i1 %25, label %.lr.ph74.preheader, label %.preheader52

.lr.ph74.preheader:                               ; preds = %._crit_edge71
  %58 = zext nneg i32 %24 to i64
  %.phi.trans.insert = getelementptr inbounds [100010 x i64], ptr @Bcnt, i64 0, i64 %58
  %.pre = load i64, ptr %.phi.trans.insert, align 8, !tbaa !13
  %xtraiter = and i64 %58, 3
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.lr.ph74.prol.loopexit, label %.lr.ph74.prol

.lr.ph74.prol:                                    ; preds = %.lr.ph74.preheader, %.lr.ph74.prol
  %59 = phi i64 [ %62, %.lr.ph74.prol ], [ %.pre, %.lr.ph74.preheader ]
  %indvars.iv97.prol = phi i64 [ %indvars.iv.next98.prol, %.lr.ph74.prol ], [ %58, %.lr.ph74.preheader ]
  %prol.iter = phi i64 [ %prol.iter.next, %.lr.ph74.prol ], [ 0, %.lr.ph74.preheader ]
  %indvars.iv.next98.prol = add nsw i64 %indvars.iv97.prol, -1
  %60 = getelementptr inbounds [100010 x i64], ptr @Bcnt, i64 0, i64 %indvars.iv.next98.prol
  %61 = load i64, ptr %60, align 8, !tbaa !13
  %62 = add nsw i64 %61, %59
  store i64 %62, ptr %60, align 8, !tbaa !13
  %prol.iter.next = add i64 %prol.iter, 1
  %prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
  br i1 %prol.iter.cmp.not, label %.lr.ph74.prol.loopexit, label %.lr.ph74.prol, !llvm.loop !16

.lr.ph74.prol.loopexit:                           ; preds = %.lr.ph74.prol, %.lr.ph74.preheader
  %.unr = phi i64 [ %.pre, %.lr.ph74.preheader ], [ %62, %.lr.ph74.prol ]
  %indvars.iv97.unr = phi i64 [ %58, %.lr.ph74.preheader ], [ %indvars.iv.next98.prol, %.lr.ph74.prol ]
  %63 = icmp ult i32 %24, 4
  br i1 %63, label %.preheader53, label %.lr.ph74

.preheader53:                                     ; preds = %.lr.ph74, %.lr.ph74.prol.loopexit
  br i1 %25, label %.lr.ph77, label %.preheader52

.lr.ph74:                                         ; preds = %.lr.ph74.prol.loopexit, %.lr.ph74
  %64 = phi i64 [ %76, %.lr.ph74 ], [ %.unr, %.lr.ph74.prol.loopexit ]
  %indvars.iv97 = phi i64 [ %indvars.iv.next98.3, %.lr.ph74 ], [ %indvars.iv97.unr, %.lr.ph74.prol.loopexit ]
  %indvars.iv.next98 = add nsw i64 %indvars.iv97, -1
  %65 = getelementptr inbounds [100010 x i64], ptr @Bcnt, i64 0, i64 %indvars.iv.next98
  %66 = load i64, ptr %65, align 8, !tbaa !13
  %67 = add nsw i64 %66, %64
  store i64 %67, ptr %65, align 8, !tbaa !13
  %indvars.iv.next98.1 = add nsw i64 %indvars.iv97, -2
  %68 = getelementptr inbounds [100010 x i64], ptr @Bcnt, i64 0, i64 %indvars.iv.next98.1
  %69 = load i64, ptr %68, align 8, !tbaa !13
  %70 = add nsw i64 %69, %67
  store i64 %70, ptr %68, align 8, !tbaa !13
  %indvars.iv.next98.2 = add nsw i64 %indvars.iv97, -3
  %71 = getelementptr inbounds [100010 x i64], ptr @Bcnt, i64 0, i64 %indvars.iv.next98.2
  %72 = load i64, ptr %71, align 8, !tbaa !13
  %73 = add nsw i64 %72, %70
  store i64 %73, ptr %71, align 8, !tbaa !13
  %indvars.iv.next98.3 = add nsw i64 %indvars.iv97, -4
  %74 = getelementptr inbounds [100010 x i64], ptr @Bcnt, i64 0, i64 %indvars.iv.next98.3
  %75 = load i64, ptr %74, align 8, !tbaa !13
  %76 = add nsw i64 %75, %73
  store i64 %76, ptr %74, align 8, !tbaa !13
  %77 = icmp ugt i64 %indvars.iv.next98.2, 1
  br i1 %77, label %.lr.ph74, label %.preheader53, !llvm.loop !18

.preheader52:                                     ; preds = %99, %._crit_edge71, %.preheader53
  %.038.lcssa = phi i32 [ 0, %.preheader53 ], [ 0, %._crit_edge71 ], [ %.1, %99 ]
  %78 = icmp slt i32 %.038.lcssa, %24
  br i1 %78, label %.lr.ph80.preheader, label %.preheader

.lr.ph80.preheader:                               ; preds = %.preheader52
  %79 = sext i32 %.038.lcssa to i64
  %80 = shl nsw i64 %79, 3
  %scevgep100 = getelementptr i8, ptr @Acnt, i64 %80
  %81 = xor i32 %.038.lcssa, -1
  %82 = add i32 %24, %81
  %83 = zext i32 %82 to i64
  %84 = shl nuw nsw i64 %83, 3
  %85 = add nuw nsw i64 %84, 8
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(1) %scevgep100, i8 0, i64 %85, i1 false), !tbaa !13
  br label %.preheader

.lr.ph77:                                         ; preds = %.preheader53, %99
  %.03876 = phi i32 [ %.1, %99 ], [ 0, %.preheader53 ]
  %.375 = phi i32 [ %.4, %99 ], [ 0, %.preheader53 ]
  %86 = sext i32 %.03876 to i64
  %87 = getelementptr inbounds [100010 x i32], ptr @A, i64 0, i64 %86
  %88 = load i32, ptr %87, align 4, !tbaa !5
  %89 = sext i32 %.375 to i64
  %90 = getelementptr inbounds [100010 x i32], ptr @B, i64 0, i64 %89
  %91 = load i32, ptr %90, align 4, !tbaa !5
  %.not = icmp slt i32 %88, %91
  br i1 %.not, label %94, label %92

92:                                               ; preds = %.lr.ph77
  %93 = add nsw i32 %.375, 1
  br label %99

94:                                               ; preds = %.lr.ph77
  %95 = getelementptr inbounds [100010 x i64], ptr @Bcnt, i64 0, i64 %89
  %96 = load i64, ptr %95, align 8, !tbaa !13
  %97 = add nsw i32 %.03876, 1
  %98 = getelementptr inbounds [100010 x i64], ptr @Acnt, i64 0, i64 %86
  store i64 %96, ptr %98, align 8, !tbaa !13
  br label %99

99:                                               ; preds = %94, %92
  %.4 = phi i32 [ %93, %92 ], [ %.375, %94 ]
  %.1 = phi i32 [ %.03876, %92 ], [ %97, %94 ]
  %100 = icmp slt i32 %.1, %24
  %101 = icmp slt i32 %.4, %24
  %102 = select i1 %100, i1 %101, i1 false
  br i1 %102, label %.lr.ph77, label %.preheader52, !llvm.loop !19

.preheader:                                       ; preds = %.lr.ph80.preheader, %.preheader52
  br i1 %25, label %.lr.ph83.preheader, label %._crit_edge84

.lr.ph83.preheader:                               ; preds = %.preheader
  %wide.trip.count = zext nneg i32 %24 to i64
  %min.iters.check = icmp ult i32 %24, 4
  br i1 %min.iters.check, label %.lr.ph83.preheader116, label %vector.ph

.lr.ph83.preheader116:                            ; preds = %middle.block, %.lr.ph83.preheader
  %indvars.iv104.ph = phi i64 [ 0, %.lr.ph83.preheader ], [ %n.vec, %middle.block ]
  %.03781.ph = phi i64 [ 0, %.lr.ph83.preheader ], [ %108, %middle.block ]
  br label %.lr.ph83

vector.ph:                                        ; preds = %.lr.ph83.preheader
  %n.vec = and i64 %wide.trip.count, 2147483644
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.phi = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %105, %vector.body ]
  %vec.phi114 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %106, %vector.body ]
  %103 = getelementptr inbounds [100010 x i64], ptr @Acnt, i64 0, i64 %index
  %104 = getelementptr inbounds i8, ptr %103, i64 16
  %wide.load = load <2 x i64>, ptr %103, align 16, !tbaa !13
  %wide.load115 = load <2 x i64>, ptr %104, align 16, !tbaa !13
  %105 = add <2 x i64> %wide.load, %vec.phi
  %106 = add <2 x i64> %wide.load115, %vec.phi114
  %index.next = add nuw i64 %index, 4
  %107 = icmp eq i64 %index.next, %n.vec
  br i1 %107, label %middle.block, label %vector.body, !llvm.loop !20

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <2 x i64> %106, %105
  %108 = tail call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx)
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  br i1 %cmp.n, label %._crit_edge84, label %.lr.ph83.preheader116

._crit_edge84:                                    ; preds = %.lr.ph83, %middle.block, %.preheader
  %.037.lcssa = phi i64 [ 0, %.preheader ], [ %108, %middle.block ], [ %113, %.lr.ph83 ]
  %109 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %.037.lcssa)
  %110 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %109, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  ret i32 0

.lr.ph83:                                         ; preds = %.lr.ph83.preheader116, %.lr.ph83
  %indvars.iv104 = phi i64 [ %indvars.iv.next105, %.lr.ph83 ], [ %indvars.iv104.ph, %.lr.ph83.preheader116 ]
  %.03781 = phi i64 [ %113, %.lr.ph83 ], [ %.03781.ph, %.lr.ph83.preheader116 ]
  %111 = getelementptr inbounds [100010 x i64], ptr @Acnt, i64 0, i64 %indvars.iv104
  %112 = load i64, ptr %111, align 8, !tbaa !13
  %113 = add nsw i64 %112, %.03781
  %indvars.iv.next105 = add nuw nsw i64 %indvars.iv104, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next105, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge84, label %.lr.ph83, !llvm.loop !23
}

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 dso_local void @_ZSt4sortIPiEvT_S1_(ptr noundef, ptr noundef) local_unnamed_addr #2

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

; 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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.add.v2i64(<2 x i64>) #5

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" }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }

!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}
!13 = !{!14, !14, i64 0}
!14 = !{!"long long", !7, i64 0}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.unroll.disable"}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10, !21, !22}
!21 = !{!"llvm.loop.isvectorized", i32 1}
!22 = !{!"llvm.loop.unroll.runtime.disable"}
!23 = distinct !{!23, !10, !22, !21}


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