; LLVM IR from Tunghohin/Competitive_Coding :: Codeforces/cf1556_B.ll (Z5solvev)

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

@a = external dso_local global [100010 x i32], align 16
@c = external dso_local global [100010 x i32], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solvev() #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 i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i32, align 4
  %9 = alloca i64, align 8
  %10 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #6
  %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) %1)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 0, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store i32 0, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store i32 1, ptr %4, align 4, !tbaa !5
  br label %12

12:                                               ; preds = %39, %0
  %13 = load i32, ptr %4, align 4, !tbaa !5
  %14 = load i32, ptr %1, align 4, !tbaa !5
  %15 = icmp sle i32 %13, %14
  br i1 %15, label %17, label %16

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

17:                                               ; preds = %12
  %18 = load i32, ptr %4, 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)
  %22 = load i32, ptr %4, align 4, !tbaa !5
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %23
  %25 = load i32, ptr %24, align 4, !tbaa !5
  %26 = srem i32 %25, 2
  store i32 %26, ptr %24, align 4, !tbaa !5
  %27 = load i32, ptr %4, align 4, !tbaa !5
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %28
  %30 = load i32, ptr %29, align 4, !tbaa !5
  %31 = icmp ne i32 %30, 0
  br i1 %31, label %32, label %35

32:                                               ; preds = %17
  %33 = load i32, ptr %2, align 4, !tbaa !5
  %34 = add nsw i32 %33, 1
  store i32 %34, ptr %2, align 4, !tbaa !5
  br label %38

35:                                               ; preds = %17
  %36 = load i32, ptr %3, align 4, !tbaa !5
  %37 = add nsw i32 %36, 1
  store i32 %37, ptr %3, align 4, !tbaa !5
  br label %38

38:                                               ; preds = %35, %32
  br label %39

39:                                               ; preds = %38
  %40 = load i32, ptr %4, align 4, !tbaa !5
  %41 = add nsw i32 %40, 1
  store i32 %41, ptr %4, align 4, !tbaa !5
  br label %12, !llvm.loop !9

42:                                               ; preds = %16
  %43 = load i32, ptr %2, align 4, !tbaa !5
  %44 = load i32, ptr %3, align 4, !tbaa !5
  %45 = sub nsw i32 %43, %44
  %46 = call i32 @llvm.abs.i32(i32 %45, i1 true)
  %47 = icmp sgt i32 %46, 1
  br i1 %47, label %48, label %51

48:                                               ; preds = %42
  %49 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef -1)
  %50 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %49, i8 noundef signext 10)
  store i32 1, ptr %5, align 4
  br label %139

51:                                               ; preds = %42
  %52 = load i32, ptr %1, align 4, !tbaa !5
  %53 = icmp eq i32 %52, 1
  br i1 %53, label %54, label %57

54:                                               ; preds = %51
  %55 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 0)
  %56 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %55, i8 noundef signext 10)
  store i32 1, ptr %5, align 4
  br label %139

57:                                               ; preds = %51
  br label %58

58:                                               ; preds = %57
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  store i64 4557430888798830399, ptr %6, align 8, !tbaa !11
  %59 = load i32, ptr %2, align 4, !tbaa !5
  %60 = load i32, ptr %3, align 4, !tbaa !5
  %61 = icmp sge i32 %59, %60
  br i1 %61, label %62, label %96

62:                                               ; preds = %58
  store i32 1, ptr getelementptr inbounds ([100010 x i32], ptr @c, i64 0, i64 1), align 4, !tbaa !5
  store i32 2, ptr @c, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  store i64 0, ptr %7, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 1, ptr %8, align 4, !tbaa !5
  br label %63

63:                                               ; preds = %90, %62
  %64 = load i32, ptr %8, align 4, !tbaa !5
  %65 = load i32, ptr %1, align 4, !tbaa !5
  %66 = icmp sle i32 %64, %65
  br i1 %66, label %68, label %67

67:                                               ; preds = %63
  store i32 5, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %93

68:                                               ; preds = %63
  %69 = load i32, ptr %8, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %70
  %72 = load i32, ptr %71, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [100010 x i32], ptr @c, i64 0, i64 %73
  %75 = load i32, ptr %74, align 4, !tbaa !5
  %76 = load i32, ptr %8, align 4, !tbaa !5
  %77 = sub nsw i32 %75, %76
  %78 = call i32 @llvm.abs.i32(i32 %77, i1 true)
  %79 = sext i32 %78 to i64
  %80 = load i64, ptr %7, align 8, !tbaa !11
  %81 = add nsw i64 %80, %79
  store i64 %81, ptr %7, align 8, !tbaa !11
  %82 = load i32, ptr %8, align 4, !tbaa !5
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %83
  %85 = load i32, ptr %84, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [100010 x i32], ptr @c, i64 0, i64 %86
  %88 = load i32, ptr %87, align 4, !tbaa !5
  %89 = add nsw i32 %88, 2
  store i32 %89, ptr %87, align 4, !tbaa !5
  br label %90

90:                                               ; preds = %68
  %91 = load i32, ptr %8, align 4, !tbaa !5
  %92 = add nsw i32 %91, 1
  store i32 %92, ptr %8, align 4, !tbaa !5
  br label %63, !llvm.loop !13

93:                                               ; preds = %67
  %94 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7)
  %95 = load i64, ptr %94, align 8, !tbaa !11
  store i64 %95, ptr %6, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  br label %96

96:                                               ; preds = %93, %58
  %97 = load i32, ptr %2, align 4, !tbaa !5
  %98 = load i32, ptr %3, align 4, !tbaa !5
  %99 = icmp sle i32 %97, %98
  br i1 %99, label %100, label %134

100:                                              ; preds = %96
  store i32 2, ptr getelementptr inbounds ([100010 x i32], ptr @c, i64 0, i64 1), align 4, !tbaa !5
  store i32 1, ptr @c, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  store i64 0, ptr %9, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 1, ptr %10, align 4, !tbaa !5
  br label %101

101:                                              ; preds = %128, %100
  %102 = load i32, ptr %10, align 4, !tbaa !5
  %103 = load i32, ptr %1, align 4, !tbaa !5
  %104 = icmp sle i32 %102, %103
  br i1 %104, label %106, label %105

105:                                              ; preds = %101
  store i32 8, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %131

106:                                              ; preds = %101
  %107 = load i32, ptr %10, align 4, !tbaa !5
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %108
  %110 = load i32, ptr %109, align 4, !tbaa !5
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [100010 x i32], ptr @c, i64 0, i64 %111
  %113 = load i32, ptr %112, align 4, !tbaa !5
  %114 = load i32, ptr %10, align 4, !tbaa !5
  %115 = sub nsw i32 %113, %114
  %116 = call i32 @llvm.abs.i32(i32 %115, i1 true)
  %117 = sext i32 %116 to i64
  %118 = load i64, ptr %9, align 8, !tbaa !11
  %119 = add nsw i64 %118, %117
  store i64 %119, ptr %9, align 8, !tbaa !11
  %120 = load i32, ptr %10, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %121
  %123 = load i32, ptr %122, align 4, !tbaa !5
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds [100010 x i32], ptr @c, i64 0, i64 %124
  %126 = load i32, ptr %125, align 4, !tbaa !5
  %127 = add nsw i32 %126, 2
  store i32 %127, ptr %125, align 4, !tbaa !5
  br label %128

128:                                              ; preds = %106
  %129 = load i32, ptr %10, align 4, !tbaa !5
  %130 = add nsw i32 %129, 1
  store i32 %130, ptr %10, align 4, !tbaa !5
  br label %101, !llvm.loop !14

131:                                              ; preds = %105
  %132 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %9)
  %133 = load i64, ptr %132, align 8, !tbaa !11
  store i64 %133, ptr %6, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  br label %134

134:                                              ; preds = %131, %96
  %135 = load i64, ptr %6, align 8, !tbaa !11
  %136 = sdiv i64 %135, 2
  %137 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %136)
  %138 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %137, i8 noundef signext 10)
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  store i32 0, ptr %5, align 4
  br label %139

139:                                              ; preds = %134, %54, %48
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #6
  %140 = load i32, ptr %5, align 4
  switch i32 %140, label %142 [
    i32 0, label %141
    i32 1, label %141
  ]

141:                                              ; preds = %139, %139
  ret void

142:                                              ; preds = %139
  unreachable
}

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #5

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

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


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

@a = external dso_local global [100010 x i32], align 16
@c = external dso_local local_unnamed_addr global [100010 x i32], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solvev() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  %5 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %6 = load i32, ptr %1, align 4, !tbaa !5
  %.not34 = icmp slt i32 %6, 1
  br i1 %.not34, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %0
  %.026.lcssa = phi i32 [ 0, %0 ], [ %.127, %.lr.ph ]
  %.025.lcssa = phi i32 [ 0, %0 ], [ %.1, %.lr.ph ]
  %.lcssa = phi i32 [ %6, %0 ], [ %16, %.lr.ph ]
  %7 = sub nsw i32 %.026.lcssa, %.025.lcssa
  %8 = call i32 @llvm.abs.i32(i32 %7, i1 true)
  %9 = icmp ugt i32 %8, 1
  br i1 %9, label %18, label %21

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %0 ]
  %.02536 = phi i32 [ %.1, %.lr.ph ], [ 0, %0 ]
  %.02635 = phi i32 [ %.127, %.lr.ph ], [ 0, %0 ]
  %10 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %indvars.iv
  %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) %10)
  %12 = load i32, ptr %10, align 4, !tbaa !5
  %13 = srem i32 %12, 2
  store i32 %13, ptr %10, align 4, !tbaa !5
  %.not33 = icmp ne i32 %13, 0
  %14 = zext i1 %.not33 to i32
  %.127 = add nuw nsw i32 %.02635, %14
  %not..not33 = xor i1 %.not33, true
  %15 = zext i1 %not..not33 to i32
  %.1 = add nuw nsw i32 %.02536, %15
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %16 = load i32, ptr %1, align 4, !tbaa !5
  %17 = sext i32 %16 to i64
  %.not.not = icmp slt i64 %indvars.iv, %17
  br i1 %.not.not, label %.lr.ph, label %._crit_edge, !llvm.loop !9

18:                                               ; preds = %._crit_edge
  %19 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef -1)
  %20 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %19, i8 noundef signext 10)
  br label %112

21:                                               ; preds = %._crit_edge
  %22 = icmp eq i32 %.lcssa, 1
  br i1 %22, label %23, label %26

23:                                               ; preds = %21
  %24 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 0)
  %25 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %24, i8 noundef signext 10)
  br label %112

26:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #6
  store i64 4557430888798830399, ptr %2, align 8, !tbaa !11
  %.not29 = icmp ult i32 %.026.lcssa, %.025.lcssa
  br i1 %.not29, label %65, label %27

27:                                               ; preds = %26
  store i32 1, ptr getelementptr inbounds (i8, ptr @c, i64 4), align 4, !tbaa !5
  store i32 2, ptr @c, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  %.not3041 = icmp slt i32 %.lcssa, 1
  br i1 %.not3041, label %._crit_edge45, label %.lr.ph44.preheader

.lr.ph44.preheader:                               ; preds = %27
  %28 = zext nneg i32 %.lcssa to i64
  %xtraiter = and i64 %28, 1
  %unroll_iter = and i64 %28, 2147483646
  br label %.lr.ph44

._crit_edge45.loopexit.unr-lcssa:                 ; preds = %.lr.ph44
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge45, label %.lr.ph44.epil

.lr.ph44.epil:                                    ; preds = %._crit_edge45.loopexit.unr-lcssa
  %29 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %indvars.iv.next60.1
  %30 = load i32, ptr %29, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [100010 x i32], ptr @c, i64 0, i64 %31
  %33 = load i32, ptr %32, align 4, !tbaa !5
  %34 = trunc nuw nsw i64 %indvars.iv.next60.1 to i32
  %35 = sub nsw i32 %33, %34
  %36 = call i32 @llvm.abs.i32(i32 %35, i1 true)
  %37 = zext nneg i32 %36 to i64
  %38 = add nuw nsw i64 %63, %37
  %39 = add nsw i32 %33, 2
  store i32 %39, ptr %32, align 4, !tbaa !5
  br label %._crit_edge45

._crit_edge45:                                    ; preds = %.lr.ph44.epil, %._crit_edge45.loopexit.unr-lcssa, %27
  %.lcssa40 = phi i64 [ 0, %27 ], [ %63, %._crit_edge45.loopexit.unr-lcssa ], [ %38, %.lr.ph44.epil ]
  store i64 %.lcssa40, ptr %3, align 8, !tbaa !11
  %40 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %41 = load i64, ptr %40, align 8, !tbaa !11
  store i64 %41, ptr %2, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  br label %65

.lr.ph44:                                         ; preds = %.lr.ph44, %.lr.ph44.preheader
  %indvars.iv59 = phi i64 [ 1, %.lr.ph44.preheader ], [ %indvars.iv.next60.1, %.lr.ph44 ]
  %42 = phi i64 [ 0, %.lr.ph44.preheader ], [ %63, %.lr.ph44 ]
  %niter = phi i64 [ 0, %.lr.ph44.preheader ], [ %niter.next.1, %.lr.ph44 ]
  %43 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %indvars.iv59
  %44 = load i32, ptr %43, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [100010 x i32], ptr @c, i64 0, i64 %45
  %47 = load i32, ptr %46, align 4, !tbaa !5
  %48 = trunc nuw nsw i64 %indvars.iv59 to i32
  %49 = sub nsw i32 %47, %48
  %50 = call i32 @llvm.abs.i32(i32 %49, i1 true)
  %51 = zext nneg i32 %50 to i64
  %52 = add nuw nsw i64 %42, %51
  %53 = add nsw i32 %47, 2
  store i32 %53, ptr %46, align 4, !tbaa !5
  %indvars.iv.next60 = add nuw nsw i64 %indvars.iv59, 1
  %54 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %indvars.iv.next60
  %55 = load i32, ptr %54, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [100010 x i32], ptr @c, i64 0, i64 %56
  %58 = load i32, ptr %57, align 4, !tbaa !5
  %59 = trunc nuw nsw i64 %indvars.iv.next60 to i32
  %60 = sub nsw i32 %58, %59
  %61 = call i32 @llvm.abs.i32(i32 %60, i1 true)
  %62 = zext nneg i32 %61 to i64
  %63 = add nuw nsw i64 %52, %62
  %64 = add nsw i32 %58, 2
  store i32 %64, ptr %57, align 4, !tbaa !5
  %indvars.iv.next60.1 = add nuw nsw i64 %indvars.iv59, 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_edge45.loopexit.unr-lcssa, label %.lr.ph44, !llvm.loop !13

65:                                               ; preds = %._crit_edge45, %26
  %66 = phi i64 [ %41, %._crit_edge45 ], [ 4557430888798830399, %26 ]
  %.not31 = icmp ugt i32 %.026.lcssa, %.025.lcssa
  br i1 %.not31, label %107, label %67

67:                                               ; preds = %65
  store i32 2, ptr getelementptr inbounds (i8, ptr @c, i64 4), align 4, !tbaa !5
  store i32 1, ptr @c, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  %68 = load i32, ptr %1, align 4, !tbaa !5
  %.not3249 = icmp slt i32 %68, 1
  br i1 %.not3249, label %._crit_edge53, label %.lr.ph52.preheader

.lr.ph52.preheader:                               ; preds = %67
  %69 = zext nneg i32 %68 to i64
  %xtraiter77 = and i64 %69, 1
  %70 = icmp eq i32 %68, 1
  br i1 %70, label %._crit_edge53.loopexit.unr-lcssa, label %.lr.ph52.preheader.new

.lr.ph52.preheader.new:                           ; preds = %.lr.ph52.preheader
  %unroll_iter81 = and i64 %69, 2147483646
  br label %.lr.ph52

._crit_edge53.loopexit.unr-lcssa:                 ; preds = %.lr.ph52, %.lr.ph52.preheader
  %.lcssa73.ph = phi i64 [ poison, %.lr.ph52.preheader ], [ %105, %.lr.ph52 ]
  %indvars.iv62.unr = phi i64 [ 1, %.lr.ph52.preheader ], [ %indvars.iv.next63.1, %.lr.ph52 ]
  %.unr78 = phi i64 [ 0, %.lr.ph52.preheader ], [ %105, %.lr.ph52 ]
  %lcmp.mod79.not = icmp eq i64 %xtraiter77, 0
  br i1 %lcmp.mod79.not, label %._crit_edge53, label %.lr.ph52.epil

.lr.ph52.epil:                                    ; preds = %._crit_edge53.loopexit.unr-lcssa
  %71 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %indvars.iv62.unr
  %72 = load i32, ptr %71, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [100010 x i32], ptr @c, i64 0, i64 %73
  %75 = load i32, ptr %74, align 4, !tbaa !5
  %76 = trunc nuw nsw i64 %indvars.iv62.unr to i32
  %77 = sub nsw i32 %75, %76
  %78 = call i32 @llvm.abs.i32(i32 %77, i1 true)
  %79 = zext nneg i32 %78 to i64
  %80 = add nuw nsw i64 %.unr78, %79
  %81 = add nsw i32 %75, 2
  store i32 %81, ptr %74, align 4, !tbaa !5
  br label %._crit_edge53

._crit_edge53:                                    ; preds = %.lr.ph52.epil, %._crit_edge53.loopexit.unr-lcssa, %67
  %.lcssa48 = phi i64 [ 0, %67 ], [ %.lcssa73.ph, %._crit_edge53.loopexit.unr-lcssa ], [ %80, %.lr.ph52.epil ]
  store i64 %.lcssa48, ptr %4, align 8, !tbaa !11
  %82 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %83 = load i64, ptr %82, align 8, !tbaa !11
  store i64 %83, ptr %2, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  br label %107

.lr.ph52:                                         ; preds = %.lr.ph52, %.lr.ph52.preheader.new
  %indvars.iv62 = phi i64 [ 1, %.lr.ph52.preheader.new ], [ %indvars.iv.next63.1, %.lr.ph52 ]
  %84 = phi i64 [ 0, %.lr.ph52.preheader.new ], [ %105, %.lr.ph52 ]
  %niter82 = phi i64 [ 0, %.lr.ph52.preheader.new ], [ %niter82.next.1, %.lr.ph52 ]
  %85 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %indvars.iv62
  %86 = load i32, ptr %85, align 4, !tbaa !5
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [100010 x i32], ptr @c, i64 0, i64 %87
  %89 = load i32, ptr %88, align 4, !tbaa !5
  %90 = trunc nuw nsw i64 %indvars.iv62 to i32
  %91 = sub nsw i32 %89, %90
  %92 = call i32 @llvm.abs.i32(i32 %91, i1 true)
  %93 = zext nneg i32 %92 to i64
  %94 = add nuw nsw i64 %84, %93
  %95 = add nsw i32 %89, 2
  store i32 %95, ptr %88, align 4, !tbaa !5
  %indvars.iv.next63 = add nuw nsw i64 %indvars.iv62, 1
  %96 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %indvars.iv.next63
  %97 = load i32, ptr %96, align 4, !tbaa !5
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [100010 x i32], ptr @c, i64 0, i64 %98
  %100 = load i32, ptr %99, align 4, !tbaa !5
  %101 = trunc nuw nsw i64 %indvars.iv.next63 to i32
  %102 = sub nsw i32 %100, %101
  %103 = call i32 @llvm.abs.i32(i32 %102, i1 true)
  %104 = zext nneg i32 %103 to i64
  %105 = add nuw nsw i64 %94, %104
  %106 = add nsw i32 %100, 2
  store i32 %106, ptr %99, align 4, !tbaa !5
  %indvars.iv.next63.1 = add nuw nsw i64 %indvars.iv62, 2
  %niter82.next.1 = add i64 %niter82, 2
  %niter82.ncmp.1 = icmp eq i64 %niter82.next.1, %unroll_iter81
  br i1 %niter82.ncmp.1, label %._crit_edge53.loopexit.unr-lcssa, label %.lr.ph52, !llvm.loop !14

107:                                              ; preds = %._crit_edge53, %65
  %108 = phi i64 [ %83, %._crit_edge53 ], [ %66, %65 ]
  %109 = sdiv i64 %108, 2
  %110 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %109)
  %111 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %110, i8 noundef signext 10)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  br label %112

112:                                              ; preds = %107, %23, %18
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  ret void
}

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #5

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

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


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