; LLVM IR from kazunetakahashi/atcoder :: 2017/0122_AGC009 (A)

; 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 i64], align 16
@B = external dso_local global [100010 x i64], align 16
@C = external dso_local global [100010 x i64], align 16
@n = external dso_local global [100010 x i64], align 16
@ans = 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 i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %10 = 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) #6
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %11

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

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

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

25:                                               ; preds = %16
  %26 = load i32, ptr %2, align 4, !tbaa !5
  %27 = add nsw i32 %26, 1
  store i32 %27, ptr %2, align 4, !tbaa !5
  br label %11, !llvm.loop !9

28:                                               ; preds = %15
  %29 = load i32, ptr @N, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds i64, ptr @A, i64 %30
  call void @_ZSt7reverseIPxEvT_S1_(ptr noundef @A, ptr noundef %31)
  %32 = load i32, ptr @N, align 4, !tbaa !5
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds i64, ptr @B, i64 %33
  call void @_ZSt7reverseIPxEvT_S1_(ptr noundef @B, ptr noundef %34)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %35

35:                                               ; preds = %72, %28
  %36 = load i32, ptr %3, align 4, !tbaa !5
  %37 = load i32, ptr @N, align 4, !tbaa !5
  %38 = icmp slt i32 %36, %37
  br i1 %38, label %40, label %39

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

40:                                               ; preds = %35
  %41 = load i32, ptr %3, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [100010 x i64], ptr @A, i64 0, i64 %42
  %44 = load i64, ptr %43, align 8, !tbaa !11
  %45 = load i32, ptr %3, align 4, !tbaa !5
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [100010 x i64], ptr @B, i64 0, i64 %46
  %48 = load i64, ptr %47, align 8, !tbaa !11
  %49 = srem i64 %44, %48
  %50 = load i32, ptr %3, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [100010 x i64], ptr @C, i64 0, i64 %51
  store i64 %49, ptr %52, align 8, !tbaa !11
  %53 = load i32, ptr %3, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [100010 x i64], ptr @C, i64 0, i64 %54
  %56 = load i64, ptr %55, align 8, !tbaa !11
  %57 = icmp ne i64 %56, 0
  br i1 %57, label %58, label %71

58:                                               ; preds = %40
  %59 = load i32, ptr %3, align 4, !tbaa !5
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [100010 x i64], ptr @B, i64 0, i64 %60
  %62 = load i64, ptr %61, align 8, !tbaa !11
  %63 = load i32, ptr %3, align 4, !tbaa !5
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [100010 x i64], ptr @C, i64 0, i64 %64
  %66 = load i64, ptr %65, align 8, !tbaa !11
  %67 = sub nsw i64 %62, %66
  %68 = load i32, ptr %3, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [100010 x i64], ptr @C, i64 0, i64 %69
  store i64 %67, ptr %70, align 8, !tbaa !11
  br label %71

71:                                               ; preds = %58, %40
  br label %72

72:                                               ; preds = %71
  %73 = load i32, ptr %3, align 4, !tbaa !5
  %74 = add nsw i32 %73, 1
  store i32 %74, ptr %3, align 4, !tbaa !5
  br label %35, !llvm.loop !13

75:                                               ; preds = %39
  %76 = load i64, ptr @C, align 16, !tbaa !11
  store i64 %76, ptr @ans, align 16, !tbaa !11
  store i64 0, ptr @n, align 16, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %77

77:                                               ; preds = %165, %75
  %78 = load i32, ptr %4, align 4, !tbaa !5
  %79 = load i32, ptr @N, align 4, !tbaa !5
  %80 = sub nsw i32 %79, 1
  %81 = icmp slt i32 %78, %80
  br i1 %81, label %83, label %82

82:                                               ; preds = %77
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  br label %168

83:                                               ; preds = %77
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  %84 = load i32, ptr %4, align 4, !tbaa !5
  %85 = add nsw i32 %84, 1
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [100010 x i64], ptr @C, i64 0, i64 %86
  %88 = load i64, ptr %87, align 8, !tbaa !11
  %89 = load i32, ptr %4, align 4, !tbaa !5
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [100010 x i64], ptr @C, i64 0, i64 %90
  %92 = load i64, ptr %91, align 8, !tbaa !11
  %93 = sub nsw i64 %88, %92
  %94 = load i32, ptr %4, align 4, !tbaa !5
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [100010 x i64], ptr @B, i64 0, i64 %95
  %97 = load i64, ptr %96, align 8, !tbaa !11
  %98 = load i32, ptr %4, align 4, !tbaa !5
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [100010 x i64], ptr @n, i64 0, i64 %99
  %101 = load i64, ptr %100, align 8, !tbaa !11
  %102 = mul nsw i64 %97, %101
  %103 = sub nsw i64 %93, %102
  store i64 %103, ptr %5, align 8, !tbaa !11
  %104 = load i64, ptr %5, align 8, !tbaa !11
  %105 = icmp sge i64 %104, 0
  br i1 %105, label %106, label %116

106:                                              ; preds = %83
  %107 = load i64, ptr %5, align 8, !tbaa !11
  %108 = load i32, ptr %4, align 4, !tbaa !5
  %109 = add nsw i32 %108, 1
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [100010 x i64], ptr @ans, i64 0, i64 %110
  store i64 %107, ptr %111, align 8, !tbaa !11
  %112 = load i32, ptr %4, align 4, !tbaa !5
  %113 = add nsw i32 %112, 1
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [100010 x i64], ptr @n, i64 0, i64 %114
  store i64 0, ptr %115, align 8, !tbaa !11
  br label %164

116:                                              ; preds = %83
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  %117 = load i64, ptr %5, align 8, !tbaa !11
  %118 = call noundef i64 @_ZSt3absx(i64 noundef %117)
  %119 = load i32, ptr %4, align 4, !tbaa !5
  %120 = add nsw i32 %119, 1
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [100010 x i64], ptr @B, i64 0, i64 %121
  %123 = load i64, ptr %122, align 8, !tbaa !11
  %124 = srem i64 %118, %123
  store i64 %124, ptr %6, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %125 = load i64, ptr %5, align 8, !tbaa !11
  %126 = call noundef i64 @_ZSt3absx(i64 noundef %125)
  %127 = load i32, ptr %4, align 4, !tbaa !5
  %128 = add nsw i32 %127, 1
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds [100010 x i64], ptr @B, i64 0, i64 %129
  %131 = load i64, ptr %130, align 8, !tbaa !11
  %132 = sdiv i64 %126, %131
  store i64 %132, ptr %7, align 8, !tbaa !11
  %133 = load i64, ptr %6, align 8, !tbaa !11
  %134 = icmp eq i64 %133, 0
  br i1 %134, label %135, label %145

135:                                              ; preds = %116
  %136 = load i32, ptr %4, align 4, !tbaa !5
  %137 = add nsw i32 %136, 1
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds [100010 x i64], ptr @ans, i64 0, i64 %138
  store i64 0, ptr %139, align 8, !tbaa !11
  %140 = load i64, ptr %7, align 8, !tbaa !11
  %141 = load i32, ptr %4, align 4, !tbaa !5
  %142 = add nsw i32 %141, 1
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds [100010 x i64], ptr @n, i64 0, i64 %143
  store i64 %140, ptr %144, align 8, !tbaa !11
  br label %163

145:                                              ; preds = %116
  %146 = load i32, ptr %4, align 4, !tbaa !5
  %147 = add nsw i32 %146, 1
  %148 = sext i32 %147 to i64
  %149 = getelementptr inbounds [100010 x i64], ptr @B, i64 0, i64 %148
  %150 = load i64, ptr %149, align 8, !tbaa !11
  %151 = load i64, ptr %6, align 8, !tbaa !11
  %152 = sub nsw i64 %150, %151
  %153 = load i32, ptr %4, align 4, !tbaa !5
  %154 = add nsw i32 %153, 1
  %155 = sext i32 %154 to i64
  %156 = getelementptr inbounds [100010 x i64], ptr @ans, i64 0, i64 %155
  store i64 %152, ptr %156, align 8, !tbaa !11
  %157 = load i64, ptr %7, align 8, !tbaa !11
  %158 = add nsw i64 %157, 1
  %159 = load i32, ptr %4, align 4, !tbaa !5
  %160 = add nsw i32 %159, 1
  %161 = sext i32 %160 to i64
  %162 = getelementptr inbounds [100010 x i64], ptr @n, i64 0, i64 %161
  store i64 %158, ptr %162, align 8, !tbaa !11
  br label %163

163:                                              ; preds = %145, %135
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  br label %164

164:                                              ; preds = %163, %106
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  br label %165

165:                                              ; preds = %164
  %166 = load i32, ptr %4, align 4, !tbaa !5
  %167 = add nsw i32 %166, 1
  store i32 %167, ptr %4, align 4, !tbaa !5
  br label %77, !llvm.loop !14

168:                                              ; preds = %82
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  store i64 0, ptr %8, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %169

169:                                              ; preds = %181, %168
  %170 = load i32, ptr %9, align 4, !tbaa !5
  %171 = load i32, ptr @N, align 4, !tbaa !5
  %172 = icmp slt i32 %170, %171
  br i1 %172, label %174, label %173

173:                                              ; preds = %169
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %184

174:                                              ; preds = %169
  %175 = load i32, ptr %9, align 4, !tbaa !5
  %176 = sext i32 %175 to i64
  %177 = getelementptr inbounds [100010 x i64], ptr @ans, i64 0, i64 %176
  %178 = load i64, ptr %177, align 8, !tbaa !11
  %179 = load i64, ptr %8, align 8, !tbaa !11
  %180 = add nsw i64 %179, %178
  store i64 %180, ptr %8, align 8, !tbaa !11
  br label %181

181:                                              ; preds = %174
  %182 = load i32, ptr %9, align 4, !tbaa !5
  %183 = add nsw i32 %182, 1
  store i32 %183, ptr %9, align 4, !tbaa !5
  br label %169, !llvm.loop !15

184:                                              ; preds = %173
  %185 = load i64, ptr %8, align 8, !tbaa !11
  %186 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %185)
  %187 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %186, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  %188 = load i32, ptr %1, align 4
  ret i32 %188
}

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: 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.end.p0(i64 immarg, ptr nocapture) #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt7reverseIPxEvT_S1_(ptr noundef, ptr noundef) #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZSt3absx(i64 noundef) #5

; 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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #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)) #4

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 = { 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 = { 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 #5 = { 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 #6 = { 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 = !{!12, !12, i64 0}
!12 = !{!"long long", !7, i64 0}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !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 i64], align 16
@B = external dso_local global [100010 x i64], align 16
@C = external dso_local local_unnamed_addr global [100010 x i64], align 16
@n = external dso_local local_unnamed_addr global [100010 x i64], align 16
@ans = 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 %.._crit_edge_crit_edge

.._crit_edge_crit_edge:                           ; preds = %0
  %.pre = sext i32 %2 to i64
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.._crit_edge_crit_edge
  %.pre-phi = phi i64 [ %.pre, %.._crit_edge_crit_edge ], [ %17, %.lr.ph ]
  %4 = getelementptr inbounds i64, ptr @A, i64 %.pre-phi
  tail call void @_ZSt7reverseIPxEvT_S1_(ptr noundef nonnull @A, ptr noundef nonnull %4)
  %5 = load i32, ptr @N, align 4, !tbaa !5
  %6 = sext i32 %5 to i64
  %7 = getelementptr inbounds i64, ptr @B, i64 %6
  tail call void @_ZSt7reverseIPxEvT_S1_(ptr noundef nonnull @B, ptr noundef nonnull %7)
  %8 = load i32, ptr @N, align 4, !tbaa !5
  %9 = icmp sgt i32 %8, 0
  br i1 %9, label %.lr.ph56.preheader, label %.preheader.thread

.preheader.thread:                                ; preds = %._crit_edge
  %10 = load i64, ptr @C, align 16, !tbaa !9
  store i64 %10, ptr @ans, align 16, !tbaa !9
  store i64 0, ptr @n, align 16, !tbaa !9
  br label %._crit_edge65

.lr.ph56.preheader:                               ; preds = %._crit_edge
  %wide.trip.count = zext nneg i32 %8 to i64
  %xtraiter = and i64 %wide.trip.count, 1
  %11 = icmp eq i32 %8, 1
  br i1 %11, label %._crit_edge57.unr-lcssa, label %.lr.ph56.preheader.new

.lr.ph56.preheader.new:                           ; preds = %.lr.ph56.preheader
  %unroll_iter = and i64 %wide.trip.count, 2147483646
  br label %.lr.ph56

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %12 = getelementptr inbounds [100010 x i64], ptr @A, i64 0, i64 %indvars.iv
  %13 = 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) %12)
  %14 = getelementptr inbounds [100010 x i64], ptr @B, i64 0, i64 %indvars.iv
  %15 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %13, ptr noundef nonnull align 8 dereferenceable(8) %14)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %16 = load i32, ptr @N, align 4, !tbaa !5
  %17 = sext i32 %16 to i64
  %18 = icmp slt i64 %indvars.iv.next, %17
  br i1 %18, label %.lr.ph, label %._crit_edge, !llvm.loop !11

._crit_edge57.unr-lcssa:                          ; preds = %.lr.ph56, %.lr.ph56.preheader
  %indvars.iv71.unr = phi i64 [ 0, %.lr.ph56.preheader ], [ %indvars.iv.next72.1, %.lr.ph56 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge57, label %.lr.ph56.epil

.lr.ph56.epil:                                    ; preds = %._crit_edge57.unr-lcssa
  %19 = getelementptr inbounds [100010 x i64], ptr @A, i64 0, i64 %indvars.iv71.unr
  %20 = load i64, ptr %19, align 8, !tbaa !9
  %21 = getelementptr inbounds [100010 x i64], ptr @B, i64 0, i64 %indvars.iv71.unr
  %22 = load i64, ptr %21, align 8, !tbaa !9
  %23 = srem i64 %20, %22
  %24 = getelementptr inbounds [100010 x i64], ptr @C, i64 0, i64 %indvars.iv71.unr
  %.not.epil = icmp eq i64 %23, 0
  %25 = sub nsw i64 %22, %23
  %spec.select.epil = select i1 %.not.epil, i64 0, i64 %25
  store i64 %spec.select.epil, ptr %24, align 8, !tbaa !9
  br label %._crit_edge57

._crit_edge57:                                    ; preds = %._crit_edge57.unr-lcssa, %.lr.ph56.epil
  %26 = load i64, ptr @C, align 16, !tbaa !9
  store i64 %26, ptr @ans, align 16, !tbaa !9
  store i64 0, ptr @n, align 16, !tbaa !9
  %.not87 = icmp eq i32 %8, 1
  br i1 %.not87, label %.preheader, label %.lr.ph60

.lr.ph56:                                         ; preds = %.lr.ph56, %.lr.ph56.preheader.new
  %indvars.iv71 = phi i64 [ 0, %.lr.ph56.preheader.new ], [ %indvars.iv.next72.1, %.lr.ph56 ]
  %niter = phi i64 [ 0, %.lr.ph56.preheader.new ], [ %niter.next.1, %.lr.ph56 ]
  %27 = getelementptr inbounds [100010 x i64], ptr @A, i64 0, i64 %indvars.iv71
  %28 = load i64, ptr %27, align 16, !tbaa !9
  %29 = getelementptr inbounds [100010 x i64], ptr @B, i64 0, i64 %indvars.iv71
  %30 = load i64, ptr %29, align 16, !tbaa !9
  %31 = srem i64 %28, %30
  %32 = getelementptr inbounds [100010 x i64], ptr @C, i64 0, i64 %indvars.iv71
  %.not = icmp eq i64 %31, 0
  %33 = sub nsw i64 %30, %31
  %spec.select = select i1 %.not, i64 0, i64 %33
  store i64 %spec.select, ptr %32, align 16, !tbaa !9
  %indvars.iv.next72 = or disjoint i64 %indvars.iv71, 1
  %34 = getelementptr inbounds [100010 x i64], ptr @A, i64 0, i64 %indvars.iv.next72
  %35 = load i64, ptr %34, align 8, !tbaa !9
  %36 = getelementptr inbounds [100010 x i64], ptr @B, i64 0, i64 %indvars.iv.next72
  %37 = load i64, ptr %36, align 8, !tbaa !9
  %38 = srem i64 %35, %37
  %39 = getelementptr inbounds [100010 x i64], ptr @C, i64 0, i64 %indvars.iv.next72
  %.not.1 = icmp eq i64 %38, 0
  %40 = sub nsw i64 %37, %38
  %spec.select.1 = select i1 %.not.1, i64 0, i64 %40
  store i64 %spec.select.1, ptr %39, align 8, !tbaa !9
  %indvars.iv.next72.1 = add nuw nsw i64 %indvars.iv71, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge57.unr-lcssa, label %.lr.ph56, !llvm.loop !13

.preheader:                                       ; preds = %77, %._crit_edge57
  %.lcssa = phi i32 [ %8, %._crit_edge57 ], [ %79, %77 ]
  %41 = icmp sgt i32 %.lcssa, 0
  br i1 %41, label %.lr.ph64.preheader, label %._crit_edge65

.lr.ph64.preheader:                               ; preds = %.preheader
  %wide.trip.count80 = zext nneg i32 %.lcssa to i64
  %min.iters.check = icmp ult i32 %.lcssa, 4
  br i1 %min.iters.check, label %.lr.ph64.preheader93, label %vector.ph

.lr.ph64.preheader93:                             ; preds = %middle.block, %.lr.ph64.preheader
  %indvars.iv77.ph = phi i64 [ 0, %.lr.ph64.preheader ], [ %n.vec, %middle.block ]
  %.04262.ph = phi i64 [ 0, %.lr.ph64.preheader ], [ %47, %middle.block ]
  br label %.lr.ph64

vector.ph:                                        ; preds = %.lr.ph64.preheader
  %n.vec = and i64 %wide.trip.count80, 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 ], [ %44, %vector.body ]
  %vec.phi91 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %45, %vector.body ]
  %42 = getelementptr inbounds [100010 x i64], ptr @ans, i64 0, i64 %index
  %43 = getelementptr inbounds i8, ptr %42, i64 16
  %wide.load = load <2 x i64>, ptr %42, align 16, !tbaa !9
  %wide.load92 = load <2 x i64>, ptr %43, align 16, !tbaa !9
  %44 = add <2 x i64> %wide.load, %vec.phi
  %45 = add <2 x i64> %wide.load92, %vec.phi91
  %index.next = add nuw i64 %index, 4
  %46 = icmp eq i64 %index.next, %n.vec
  br i1 %46, label %middle.block, label %vector.body, !llvm.loop !14

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <2 x i64> %45, %44
  %47 = tail call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx)
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count80
  br i1 %cmp.n, label %._crit_edge65, label %.lr.ph64.preheader93

.lr.ph60:                                         ; preds = %._crit_edge57, %77
  %indvars.iv74 = phi i64 [ %indvars.iv.next75, %77 ], [ 0, %._crit_edge57 ]
  %indvars.iv.next75 = add nuw nsw i64 %indvars.iv74, 1
  %48 = getelementptr inbounds [100010 x i64], ptr @C, i64 0, i64 %indvars.iv.next75
  %49 = load i64, ptr %48, align 8, !tbaa !9
  %50 = getelementptr inbounds [100010 x i64], ptr @C, i64 0, i64 %indvars.iv74
  %51 = load i64, ptr %50, align 8, !tbaa !9
  %52 = getelementptr inbounds [100010 x i64], ptr @B, i64 0, i64 %indvars.iv74
  %53 = load i64, ptr %52, align 8, !tbaa !9
  %54 = getelementptr inbounds [100010 x i64], ptr @n, i64 0, i64 %indvars.iv74
  %55 = load i64, ptr %54, align 8, !tbaa !9
  %56 = mul nsw i64 %55, %53
  %57 = add i64 %51, %56
  %58 = sub i64 %49, %57
  %59 = icmp sgt i64 %58, -1
  br i1 %59, label %60, label %62

60:                                               ; preds = %.lr.ph60
  %61 = getelementptr inbounds [100010 x i64], ptr @ans, i64 0, i64 %indvars.iv.next75
  store i64 %58, ptr %61, align 8, !tbaa !9
  br label %77

62:                                               ; preds = %.lr.ph60
  %63 = tail call noundef i64 @_ZSt3absx(i64 noundef %58)
  %64 = getelementptr inbounds [100010 x i64], ptr @B, i64 0, i64 %indvars.iv.next75
  %65 = load i64, ptr %64, align 8, !tbaa !9
  %66 = srem i64 %63, %65
  %67 = tail call noundef i64 @_ZSt3absx(i64 noundef %58)
  %68 = load i64, ptr %64, align 8, !tbaa !9
  %69 = sdiv i64 %67, %68
  %70 = icmp eq i64 %66, 0
  br i1 %70, label %71, label %73

71:                                               ; preds = %62
  %72 = getelementptr inbounds [100010 x i64], ptr @ans, i64 0, i64 %indvars.iv.next75
  store i64 0, ptr %72, align 8, !tbaa !9
  br label %77

73:                                               ; preds = %62
  %74 = sub nsw i64 %68, %66
  %75 = getelementptr inbounds [100010 x i64], ptr @ans, i64 0, i64 %indvars.iv.next75
  store i64 %74, ptr %75, align 8, !tbaa !9
  %76 = add nsw i64 %69, 1
  br label %77

77:                                               ; preds = %71, %73, %60
  %.sink = phi i64 [ %69, %71 ], [ %76, %73 ], [ 0, %60 ]
  %78 = getelementptr inbounds [100010 x i64], ptr @n, i64 0, i64 %indvars.iv.next75
  store i64 %.sink, ptr %78, align 8, !tbaa !9
  %79 = load i32, ptr @N, align 4, !tbaa !5
  %80 = add nsw i32 %79, -1
  %81 = sext i32 %80 to i64
  %82 = icmp slt i64 %indvars.iv.next75, %81
  br i1 %82, label %.lr.ph60, label %.preheader, !llvm.loop !17

._crit_edge65:                                    ; preds = %.lr.ph64, %middle.block, %.preheader.thread, %.preheader
  %.042.lcssa = phi i64 [ 0, %.preheader ], [ 0, %.preheader.thread ], [ %47, %middle.block ], [ %87, %.lr.ph64 ]
  %83 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %.042.lcssa)
  %84 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %83, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  ret i32 0

.lr.ph64:                                         ; preds = %.lr.ph64.preheader93, %.lr.ph64
  %indvars.iv77 = phi i64 [ %indvars.iv.next78, %.lr.ph64 ], [ %indvars.iv77.ph, %.lr.ph64.preheader93 ]
  %.04262 = phi i64 [ %87, %.lr.ph64 ], [ %.04262.ph, %.lr.ph64.preheader93 ]
  %85 = getelementptr inbounds [100010 x i64], ptr @ans, i64 0, i64 %indvars.iv77
  %86 = load i64, ptr %85, align 8, !tbaa !9
  %87 = add nsw i64 %86, %.04262
  %indvars.iv.next78 = add nuw nsw i64 %indvars.iv77, 1
  %exitcond81.not = icmp eq i64 %indvars.iv.next78, %wide.trip.count80
  br i1 %exitcond81.not, label %._crit_edge65, label %.lr.ph64, !llvm.loop !18
}

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt7reverseIPxEvT_S1_(ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZSt3absx(i64 noundef) local_unnamed_addr #4

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

; 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 = { 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 = { 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 = { 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 #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 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12, !15, !16}
!15 = !{!"llvm.loop.isvectorized", i32 1}
!16 = !{!"llvm.loop.unroll.runtime.disable"}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12, !16, !15}


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