; LLVM IR from Tunghohin/Competitive_Coding :: Codeforces/cf1606_C.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" }

@arr = external dso_local global [20 x i32], align 16
@dif = external dso_local global [20 x i32], align 16
@pos_10 = external dso_local global [20 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 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 i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i64, align 8
  %10 = alloca i32, align 4
  %11 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  %12 = 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)
  %13 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %12, ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %14

14:                                               ; preds = %24, %0
  %15 = load i32, ptr %3, align 4, !tbaa !5
  %16 = load i32, ptr %1, align 4, !tbaa !5
  %17 = icmp sle i32 %15, %16
  br i1 %17, label %19, label %18

18:                                               ; preds = %14
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  br label %27

19:                                               ; preds = %14
  %20 = load i32, ptr %3, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds [20 x i32], ptr @arr, i64 0, i64 %21
  %23 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %22)
  br label %24

24:                                               ; preds = %19
  %25 = load i32, ptr %3, align 4, !tbaa !5
  %26 = add nsw i32 %25, 1
  store i32 %26, ptr %3, align 4, !tbaa !5
  br label %14, !llvm.loop !9

27:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  store i32 1, ptr %4, align 4, !tbaa !5
  br label %28

28:                                               ; preds = %59, %27
  %29 = load i32, ptr %4, align 4, !tbaa !5
  %30 = load i32, ptr %1, align 4, !tbaa !5
  %31 = icmp slt i32 %29, %30
  br i1 %31, label %33, label %32

32:                                               ; preds = %28
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  br label %62

33:                                               ; preds = %28
  %34 = load i32, ptr %4, align 4, !tbaa !5
  %35 = add nsw i32 %34, 1
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [20 x i32], ptr @arr, i64 0, i64 %36
  %38 = load i32, ptr %37, align 4, !tbaa !5
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds [20 x i64], ptr @pos_10, i64 0, i64 %39
  %41 = load i64, ptr %40, align 8, !tbaa !11
  %42 = load i32, ptr %4, align 4, !tbaa !5
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds [20 x i32], ptr @arr, i64 0, i64 %43
  %45 = load i32, ptr %44, align 4, !tbaa !5
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [20 x i64], ptr @pos_10, i64 0, i64 %46
  %48 = load i64, ptr %47, align 8, !tbaa !11
  %49 = sdiv i64 %41, %48
  %50 = trunc i64 %49 to i32
  %51 = load i32, ptr %4, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [20 x i32], ptr @dif, i64 0, i64 %52
  store i32 %50, ptr %53, align 4, !tbaa !5
  %54 = load i32, ptr %4, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [20 x i32], ptr @dif, i64 0, i64 %55
  %57 = load i32, ptr %56, align 4, !tbaa !5
  %58 = add nsw i32 %57, -1
  store i32 %58, ptr %56, align 4, !tbaa !5
  br label %59

59:                                               ; preds = %33
  %60 = load i32, ptr %4, align 4, !tbaa !5
  %61 = add nsw i32 %60, 1
  store i32 %61, ptr %4, align 4, !tbaa !5
  br label %28, !llvm.loop !13

62:                                               ; preds = %32
  %63 = load i32, ptr %1, align 4, !tbaa !5
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [20 x i32], ptr @dif, i64 0, i64 %64
  store i32 1061109567, ptr %65, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  store i32 -1, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  store i32 0, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  store i32 1, ptr %7, align 4, !tbaa !5
  br label %66

66:                                               ; preds = %90, %62
  %67 = load i32, ptr %7, align 4, !tbaa !5
  %68 = load i32, ptr %1, align 4, !tbaa !5
  %69 = icmp sle i32 %67, %68
  br i1 %69, label %71, label %70

70:                                               ; preds = %66
  store i32 8, ptr %8, align 4
  br label %93

71:                                               ; preds = %66
  %72 = load i32, ptr %6, align 4, !tbaa !5
  %73 = load i32, ptr %7, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [20 x i32], ptr @dif, i64 0, i64 %74
  %76 = load i32, ptr %75, align 4, !tbaa !5
  %77 = add nsw i32 %72, %76
  %78 = load i32, ptr %2, align 4, !tbaa !5
  %79 = icmp sle i32 %77, %78
  br i1 %79, label %80, label %88

80:                                               ; preds = %71
  %81 = load i32, ptr %7, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [20 x i32], ptr @dif, i64 0, i64 %82
  %84 = load i32, ptr %83, align 4, !tbaa !5
  %85 = load i32, ptr %6, align 4, !tbaa !5
  %86 = add nsw i32 %85, %84
  store i32 %86, ptr %6, align 4, !tbaa !5
  %87 = load i32, ptr %7, align 4, !tbaa !5
  store i32 %87, ptr %5, align 4, !tbaa !5
  br label %89

88:                                               ; preds = %71
  store i32 8, ptr %8, align 4
  br label %93

89:                                               ; preds = %80
  br label %90

90:                                               ; preds = %89
  %91 = load i32, ptr %7, align 4, !tbaa !5
  %92 = add nsw i32 %91, 1
  store i32 %92, ptr %7, align 4, !tbaa !5
  br label %66, !llvm.loop !14

93:                                               ; preds = %88, %70
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %94

94:                                               ; preds = %93
  %95 = load i32, ptr %5, align 4, !tbaa !5
  %96 = icmp eq i32 %95, -1
  br i1 %96, label %97, label %108

97:                                               ; preds = %94
  %98 = load i32, ptr %2, align 4, !tbaa !5
  %99 = add nsw i32 %98, 1
  %100 = sext i32 %99 to i64
  %101 = load i32, ptr getelementptr inbounds ([20 x i32], ptr @arr, i64 0, i64 1), align 4, !tbaa !5
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [20 x i64], ptr @pos_10, i64 0, i64 %102
  %104 = load i64, ptr %103, align 8, !tbaa !11
  %105 = mul nsw i64 %100, %104
  %106 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %105)
  %107 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %106, i8 noundef signext 10)
  store i32 1, ptr %8, align 4
  br label %154

108:                                              ; preds = %94
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  store i64 0, ptr %9, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  store i32 1, ptr %10, align 4, !tbaa !5
  br label %109

109:                                              ; preds = %130, %108
  %110 = load i32, ptr %10, align 4, !tbaa !5
  %111 = load i32, ptr %5, align 4, !tbaa !5
  %112 = icmp sle i32 %110, %111
  br i1 %112, label %114, label %113

113:                                              ; preds = %109
  store i32 11, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  br label %133

114:                                              ; preds = %109
  %115 = load i32, ptr %10, align 4, !tbaa !5
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds [20 x i32], ptr @arr, i64 0, i64 %116
  %118 = load i32, ptr %117, align 4, !tbaa !5
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [20 x i64], ptr @pos_10, i64 0, i64 %119
  %121 = load i64, ptr %120, align 8, !tbaa !11
  %122 = load i32, ptr %10, align 4, !tbaa !5
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds [20 x i32], ptr @dif, i64 0, i64 %123
  %125 = load i32, ptr %124, align 4, !tbaa !5
  %126 = sext i32 %125 to i64
  %127 = mul nsw i64 %121, %126
  %128 = load i64, ptr %9, align 8, !tbaa !11
  %129 = add nsw i64 %128, %127
  store i64 %129, ptr %9, align 8, !tbaa !11
  br label %130

130:                                              ; preds = %114
  %131 = load i32, ptr %10, align 4, !tbaa !5
  %132 = add nsw i32 %131, 1
  store i32 %132, ptr %10, align 4, !tbaa !5
  br label %109, !llvm.loop !15

133:                                              ; preds = %113
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  %134 = load i32, ptr %2, align 4, !tbaa !5
  %135 = add nsw i32 %134, 1
  %136 = load i32, ptr %6, align 4, !tbaa !5
  %137 = sub nsw i32 %135, %136
  %138 = sext i32 %137 to i64
  store i64 %138, ptr %11, align 8, !tbaa !11
  %139 = load i64, ptr %11, align 8, !tbaa !11
  %140 = load i32, ptr %5, align 4, !tbaa !5
  %141 = add nsw i32 %140, 1
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds [20 x i32], ptr @arr, i64 0, i64 %142
  %144 = load i32, ptr %143, align 4, !tbaa !5
  %145 = sext i32 %144 to i64
  %146 = getelementptr inbounds [20 x i64], ptr @pos_10, i64 0, i64 %145
  %147 = load i64, ptr %146, align 8, !tbaa !11
  %148 = mul nsw i64 %139, %147
  %149 = load i64, ptr %9, align 8, !tbaa !11
  %150 = add nsw i64 %149, %148
  store i64 %150, ptr %9, align 8, !tbaa !11
  %151 = load i64, ptr %9, align 8, !tbaa !11
  %152 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %151)
  %153 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %152, i8 noundef signext 10)
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  store i32 0, ptr %8, align 4
  br label %154

154:                                              ; preds = %133, %97
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #4
  %155 = load i32, ptr %8, align 4
  switch i32 %155, label %157 [
    i32 0, label %156
    i32 1, label %156
  ]

156:                                              ; preds = %154, %154
  ret void

157:                                              ; preds = %154
  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: 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) #3

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

@arr = external dso_local global [20 x i32], align 16
@dif = external dso_local local_unnamed_addr global [20 x i32], align 16
@pos_10 = external dso_local local_unnamed_addr global [20 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 uwtable
define dso_local void @_Z5solvev() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #4
  %3 = 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)
  %4 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %5 = load i32, ptr %1, align 4, !tbaa !5
  %.not40 = icmp slt i32 %5, 1
  br i1 %.not40, label %._crit_edge.thread, label %.lr.ph

._crit_edge.thread:                               ; preds = %0
  %6 = sext i32 %5 to i64
  %7 = getelementptr inbounds [20 x i32], ptr @dif, i64 0, i64 %6
  store i32 1061109567, ptr %7, align 4, !tbaa !5
  br label %._crit_edge50.thread

.preheader39:                                     ; preds = %.lr.ph
  %8 = icmp sgt i32 %13, 1
  br i1 %8, label %.lr.ph43.preheader, label %._crit_edge

.lr.ph43.preheader:                               ; preds = %.preheader39
  %wide.trip.count = zext nneg i32 %13 to i64
  %.pre = load i32, ptr getelementptr inbounds (i8, ptr @arr, i64 4), align 4, !tbaa !5
  %.phi.trans.insert = sext i32 %.pre to i64
  %.phi.trans.insert78 = getelementptr inbounds [20 x i64], ptr @pos_10, i64 0, i64 %.phi.trans.insert
  %.pre79 = load i64, ptr %.phi.trans.insert78, align 8, !tbaa !9
  %9 = add nsw i64 %wide.trip.count, -1
  %xtraiter = and i64 %9, 1
  %10 = icmp eq i32 %13, 2
  br i1 %10, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph43.preheader.new

.lr.ph43.preheader.new:                           ; preds = %.lr.ph43.preheader
  %unroll_iter = and i64 %9, -2
  br label %.lr.ph43

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %0 ]
  %11 = getelementptr inbounds [20 x i32], ptr @arr, i64 0, i64 %indvars.iv
  %12 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %11)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %13 = load i32, ptr %1, align 4, !tbaa !5
  %14 = sext i32 %13 to i64
  %.not.not = icmp slt i64 %indvars.iv, %14
  br i1 %.not.not, label %.lr.ph, label %.preheader39, !llvm.loop !11

._crit_edge.loopexit.unr-lcssa:                   ; preds = %.lr.ph43, %.lr.ph43.preheader
  %.unr = phi i64 [ %.pre79, %.lr.ph43.preheader ], [ %43, %.lr.ph43 ]
  %indvars.iv65.unr = phi i64 [ 1, %.lr.ph43.preheader ], [ %indvars.iv.next66.1, %.lr.ph43 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge, label %.lr.ph43.epil

.lr.ph43.epil:                                    ; preds = %._crit_edge.loopexit.unr-lcssa
  %indvars.iv.next66.epil = add nuw nsw i64 %indvars.iv65.unr, 1
  %15 = getelementptr inbounds [20 x i32], ptr @arr, i64 0, i64 %indvars.iv.next66.epil
  %16 = load i32, ptr %15, align 4, !tbaa !5
  %17 = sext i32 %16 to i64
  %18 = getelementptr inbounds [20 x i64], ptr @pos_10, i64 0, i64 %17
  %19 = load i64, ptr %18, align 8, !tbaa !9
  %20 = sdiv i64 %19, %.unr
  %21 = trunc i64 %20 to i32
  %22 = getelementptr inbounds [20 x i32], ptr @dif, i64 0, i64 %indvars.iv65.unr
  %23 = add nsw i32 %21, -1
  store i32 %23, ptr %22, align 4, !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph43.epil, %._crit_edge.loopexit.unr-lcssa, %.preheader39
  %24 = sext i32 %13 to i64
  %25 = getelementptr inbounds [20 x i32], ptr @dif, i64 0, i64 %24
  store i32 1061109567, ptr %25, align 4, !tbaa !5
  %.not3644 = icmp slt i32 %13, 1
  br i1 %.not3644, label %._crit_edge50.thread, label %.lr.ph49

.lr.ph49:                                         ; preds = %._crit_edge
  %26 = load i32, ptr %2, align 4, !tbaa !5
  %27 = add nuw i32 %13, 1
  %wide.trip.count71 = zext i32 %27 to i64
  %28 = load i32, ptr getelementptr inbounds (i8, ptr @dif, i64 4), align 4, !tbaa !5
  %.not3790 = icmp sgt i32 %28, %26
  br i1 %.not3790, label %._crit_edge50, label %.lr.ph92

.lr.ph43:                                         ; preds = %.lr.ph43, %.lr.ph43.preheader.new
  %29 = phi i64 [ %.pre79, %.lr.ph43.preheader.new ], [ %43, %.lr.ph43 ]
  %indvars.iv65 = phi i64 [ 1, %.lr.ph43.preheader.new ], [ %indvars.iv.next66.1, %.lr.ph43 ]
  %niter = phi i64 [ 0, %.lr.ph43.preheader.new ], [ %niter.next.1, %.lr.ph43 ]
  %indvars.iv.next66 = add nuw nsw i64 %indvars.iv65, 1
  %30 = getelementptr inbounds [20 x i32], ptr @arr, i64 0, i64 %indvars.iv.next66
  %31 = load i32, ptr %30, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [20 x i64], ptr @pos_10, i64 0, i64 %32
  %34 = load i64, ptr %33, align 8, !tbaa !9
  %35 = sdiv i64 %34, %29
  %36 = trunc i64 %35 to i32
  %37 = getelementptr inbounds [20 x i32], ptr @dif, i64 0, i64 %indvars.iv65
  %38 = add nsw i32 %36, -1
  store i32 %38, ptr %37, align 4, !tbaa !5
  %indvars.iv.next66.1 = add nuw nsw i64 %indvars.iv65, 2
  %39 = getelementptr inbounds [20 x i32], ptr @arr, i64 0, i64 %indvars.iv.next66.1
  %40 = load i32, ptr %39, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [20 x i64], ptr @pos_10, i64 0, i64 %41
  %43 = load i64, ptr %42, align 8, !tbaa !9
  %44 = sdiv i64 %43, %34
  %45 = trunc i64 %44 to i32
  %46 = getelementptr inbounds [20 x i32], ptr @dif, i64 0, i64 %indvars.iv.next66
  %47 = add nsw i32 %45, -1
  store i32 %47, ptr %46, align 4, !tbaa !5
  %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_edge.loopexit.unr-lcssa, label %.lr.ph43, !llvm.loop !13

.lr.ph92:                                         ; preds = %.lr.ph49, %49
  %48 = phi i32 [ %52, %49 ], [ %28, %.lr.ph49 ]
  %indvars.iv6891 = phi i64 [ %indvars.iv.next69, %49 ], [ 1, %.lr.ph49 ]
  %indvars.iv.next69 = add nuw nsw i64 %indvars.iv6891, 1
  %exitcond72.not = icmp eq i64 %indvars.iv.next69, %wide.trip.count71
  br i1 %exitcond72.not, label %._crit_edge50, label %49, !llvm.loop !14

49:                                               ; preds = %.lr.ph92
  %50 = getelementptr inbounds [20 x i32], ptr @dif, i64 0, i64 %indvars.iv.next69
  %51 = load i32, ptr %50, align 4, !tbaa !5
  %52 = add nsw i32 %51, %48
  %.not37 = icmp sgt i32 %52, %26
  br i1 %.not37, label %.._crit_edge50_crit_edge94, label %.lr.ph92, !llvm.loop !14

.._crit_edge50_crit_edge94:                       ; preds = %49
  %53 = trunc nuw nsw i64 %indvars.iv6891 to i32
  br label %._crit_edge50

._crit_edge50:                                    ; preds = %.lr.ph92, %.._crit_edge50_crit_edge94, %.lr.ph49
  %.032.lcssa = phi i32 [ %53, %.._crit_edge50_crit_edge94 ], [ -1, %.lr.ph49 ], [ %13, %.lr.ph92 ]
  %.031.lcssa = phi i32 [ %48, %.._crit_edge50_crit_edge94 ], [ 0, %.lr.ph49 ], [ %48, %.lr.ph92 ]
  %54 = icmp eq i32 %.032.lcssa, -1
  br i1 %54, label %._crit_edge50.thread, label %.preheader

.preheader:                                       ; preds = %._crit_edge50
  %.not3856 = icmp slt i32 %.032.lcssa, 1
  %.pre80 = add nuw i32 %.032.lcssa, 1
  br i1 %.not3856, label %._crit_edge60, label %.lr.ph59.preheader

.lr.ph59.preheader:                               ; preds = %.preheader
  %55 = zext nneg i32 %.032.lcssa to i64
  %xtraiter101 = and i64 %55, 3
  %56 = icmp ult i32 %.032.lcssa, 4
  br i1 %56, label %._crit_edge60.loopexit.unr-lcssa, label %.lr.ph59.preheader.new

.lr.ph59.preheader.new:                           ; preds = %.lr.ph59.preheader
  %unroll_iter104 = and i64 %55, 2147483644
  br label %.lr.ph59

._crit_edge50.thread:                             ; preds = %._crit_edge.thread, %._crit_edge, %._crit_edge50
  %57 = load i32, ptr %2, align 4, !tbaa !5
  %58 = add nsw i32 %57, 1
  %59 = sext i32 %58 to i64
  %60 = load i32, ptr getelementptr inbounds (i8, ptr @arr, i64 4), align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [20 x i64], ptr @pos_10, i64 0, i64 %61
  %63 = load i64, ptr %62, align 8, !tbaa !9
  %64 = mul nsw i64 %63, %59
  br label %126

._crit_edge60.loopexit.unr-lcssa:                 ; preds = %.lr.ph59, %.lr.ph59.preheader
  %.lcssa.ph = phi i64 [ poison, %.lr.ph59.preheader ], [ %125, %.lr.ph59 ]
  %indvars.iv73.unr = phi i64 [ 1, %.lr.ph59.preheader ], [ %indvars.iv.next74.3, %.lr.ph59 ]
  %.02957.unr = phi i64 [ 0, %.lr.ph59.preheader ], [ %125, %.lr.ph59 ]
  %lcmp.mod102.not = icmp eq i64 %xtraiter101, 0
  br i1 %lcmp.mod102.not, label %._crit_edge60, label %.lr.ph59.epil

.lr.ph59.epil:                                    ; preds = %._crit_edge60.loopexit.unr-lcssa, %.lr.ph59.epil
  %indvars.iv73.epil = phi i64 [ %indvars.iv.next74.epil, %.lr.ph59.epil ], [ %indvars.iv73.unr, %._crit_edge60.loopexit.unr-lcssa ]
  %.02957.epil = phi i64 [ %74, %.lr.ph59.epil ], [ %.02957.unr, %._crit_edge60.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph59.epil ], [ 0, %._crit_edge60.loopexit.unr-lcssa ]
  %65 = getelementptr inbounds [20 x i32], ptr @arr, i64 0, i64 %indvars.iv73.epil
  %66 = load i32, ptr %65, align 4, !tbaa !5
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [20 x i64], ptr @pos_10, i64 0, i64 %67
  %69 = load i64, ptr %68, align 8, !tbaa !9
  %70 = getelementptr inbounds [20 x i32], ptr @dif, i64 0, i64 %indvars.iv73.epil
  %71 = load i32, ptr %70, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = mul nsw i64 %69, %72
  %74 = add nsw i64 %73, %.02957.epil
  %indvars.iv.next74.epil = add nuw nsw i64 %indvars.iv73.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter101
  br i1 %epil.iter.cmp.not, label %._crit_edge60, label %.lr.ph59.epil, !llvm.loop !15

._crit_edge60:                                    ; preds = %._crit_edge60.loopexit.unr-lcssa, %.lr.ph59.epil, %.preheader
  %.029.lcssa = phi i64 [ 0, %.preheader ], [ %.lcssa.ph, %._crit_edge60.loopexit.unr-lcssa ], [ %74, %.lr.ph59.epil ]
  %75 = load i32, ptr %2, align 4, !tbaa !5
  %reass.sub = sub i32 %75, %.031.lcssa
  %76 = add i32 %reass.sub, 1
  %77 = sext i32 %76 to i64
  %78 = sext i32 %.pre80 to i64
  %79 = getelementptr inbounds [20 x i32], ptr @arr, i64 0, i64 %78
  %80 = load i32, ptr %79, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [20 x i64], ptr @pos_10, i64 0, i64 %81
  %83 = load i64, ptr %82, align 8, !tbaa !9
  %84 = mul nsw i64 %83, %77
  %85 = add nsw i64 %84, %.029.lcssa
  br label %126

.lr.ph59:                                         ; preds = %.lr.ph59, %.lr.ph59.preheader.new
  %indvars.iv73 = phi i64 [ 1, %.lr.ph59.preheader.new ], [ %indvars.iv.next74.3, %.lr.ph59 ]
  %.02957 = phi i64 [ 0, %.lr.ph59.preheader.new ], [ %125, %.lr.ph59 ]
  %niter105 = phi i64 [ 0, %.lr.ph59.preheader.new ], [ %niter105.next.3, %.lr.ph59 ]
  %86 = getelementptr inbounds [20 x i32], ptr @arr, i64 0, i64 %indvars.iv73
  %87 = load i32, ptr %86, align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [20 x i64], ptr @pos_10, i64 0, i64 %88
  %90 = load i64, ptr %89, align 8, !tbaa !9
  %91 = getelementptr inbounds [20 x i32], ptr @dif, i64 0, i64 %indvars.iv73
  %92 = load i32, ptr %91, align 4, !tbaa !5
  %93 = sext i32 %92 to i64
  %94 = mul nsw i64 %90, %93
  %95 = add nsw i64 %94, %.02957
  %indvars.iv.next74 = add nuw nsw i64 %indvars.iv73, 1
  %96 = getelementptr inbounds [20 x i32], ptr @arr, i64 0, i64 %indvars.iv.next74
  %97 = load i32, ptr %96, align 4, !tbaa !5
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [20 x i64], ptr @pos_10, i64 0, i64 %98
  %100 = load i64, ptr %99, align 8, !tbaa !9
  %101 = getelementptr inbounds [20 x i32], ptr @dif, i64 0, i64 %indvars.iv.next74
  %102 = load i32, ptr %101, align 4, !tbaa !5
  %103 = sext i32 %102 to i64
  %104 = mul nsw i64 %100, %103
  %105 = add nsw i64 %104, %95
  %indvars.iv.next74.1 = add nuw nsw i64 %indvars.iv73, 2
  %106 = getelementptr inbounds [20 x i32], ptr @arr, i64 0, i64 %indvars.iv.next74.1
  %107 = load i32, ptr %106, align 4, !tbaa !5
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [20 x i64], ptr @pos_10, i64 0, i64 %108
  %110 = load i64, ptr %109, align 8, !tbaa !9
  %111 = getelementptr inbounds [20 x i32], ptr @dif, i64 0, i64 %indvars.iv.next74.1
  %112 = load i32, ptr %111, align 4, !tbaa !5
  %113 = sext i32 %112 to i64
  %114 = mul nsw i64 %110, %113
  %115 = add nsw i64 %114, %105
  %indvars.iv.next74.2 = add nuw nsw i64 %indvars.iv73, 3
  %116 = getelementptr inbounds [20 x i32], ptr @arr, i64 0, i64 %indvars.iv.next74.2
  %117 = load i32, ptr %116, align 4, !tbaa !5
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [20 x i64], ptr @pos_10, i64 0, i64 %118
  %120 = load i64, ptr %119, align 8, !tbaa !9
  %121 = getelementptr inbounds [20 x i32], ptr @dif, i64 0, i64 %indvars.iv.next74.2
  %122 = load i32, ptr %121, align 4, !tbaa !5
  %123 = sext i32 %122 to i64
  %124 = mul nsw i64 %120, %123
  %125 = add nsw i64 %124, %115
  %indvars.iv.next74.3 = add nuw nsw i64 %indvars.iv73, 4
  %niter105.next.3 = add i64 %niter105, 4
  %niter105.ncmp.3 = icmp eq i64 %niter105.next.3, %unroll_iter104
  br i1 %niter105.ncmp.3, label %._crit_edge60.loopexit.unr-lcssa, label %.lr.ph59, !llvm.loop !17

126:                                              ; preds = %._crit_edge60, %._crit_edge50.thread
  %.sink88 = phi i64 [ %85, %._crit_edge60 ], [ %64, %._crit_edge50.thread ]
  %127 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %.sink88)
  %128 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %127, i8 noundef signext 10)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #4
  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: 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 #3

; 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 = { 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 = { 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 = !{!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 = distinct !{!15, !16}
!16 = !{!"llvm.loop.unroll.disable"}
!17 = distinct !{!17, !12}


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