; LLVM IR from VastoLorde95/Competitive-Programming :: Hackerrank/Random/Sherlock and MiniMax (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 i64, align 8
@a = external dso_local global [101 x i64], align 16
@p = external dso_local global i64, align 8
@q = external dso_local global i64, align 8
@mn = external dso_local global i64, align 8
@ans = external dso_local global i64, align 8
@_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 i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  %9 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @n)
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #5
  store i64 0, ptr %2, align 8, !tbaa !5
  br label %10

10:                                               ; preds = %19, %0
  %11 = load i64, ptr %2, align 8, !tbaa !5
  %12 = load i64, ptr @n, align 8, !tbaa !5
  %13 = icmp slt i64 %11, %12
  br i1 %13, label %15, label %14

14:                                               ; preds = %10
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #5
  br label %22

15:                                               ; preds = %10
  %16 = load i64, ptr %2, align 8, !tbaa !5
  %17 = getelementptr inbounds [101 x i64], ptr @a, i64 0, i64 %16
  %18 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %17)
  br label %19

19:                                               ; preds = %15
  %20 = load i64, ptr %2, align 8, !tbaa !5
  %21 = add nsw i64 %20, 1
  store i64 %21, ptr %2, align 8, !tbaa !5
  br label %10, !llvm.loop !9

22:                                               ; preds = %14
  %23 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @p)
  %24 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %23, ptr noundef nonnull align 8 dereferenceable(8) @q)
  %25 = load i64, ptr @n, align 8, !tbaa !5
  %26 = getelementptr inbounds i64, ptr @a, i64 %25
  call void @_ZSt4sortIPxEvT_S1_(ptr noundef @a, ptr noundef %26)
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #5
  store i64 1000000000, ptr @mn, align 8, !tbaa !5
  store i64 -1, ptr %3, align 8, !tbaa !5
  %27 = load i64, ptr @p, align 8, !tbaa !5
  store i64 %27, ptr @ans, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #5
  store i64 0, ptr %4, align 8, !tbaa !5
  br label %28

28:                                               ; preds = %57, %22
  %29 = load i64, ptr %4, align 8, !tbaa !5
  %30 = load i64, ptr @n, align 8, !tbaa !5
  %31 = icmp slt i64 %29, %30
  br i1 %31, label %33, label %32

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

33:                                               ; preds = %28
  %34 = load i64, ptr %4, align 8, !tbaa !5
  %35 = getelementptr inbounds [101 x i64], ptr @a, i64 0, i64 %34
  %36 = load i64, ptr %35, align 8, !tbaa !5
  %37 = load i64, ptr @p, align 8, !tbaa !5
  %38 = icmp sge i64 %36, %37
  br i1 %38, label %39, label %44

39:                                               ; preds = %33
  %40 = load i64, ptr %3, align 8, !tbaa !5
  %41 = icmp eq i64 %40, -1
  br i1 %41, label %42, label %44

42:                                               ; preds = %39
  %43 = load i64, ptr %4, align 8, !tbaa !5
  store i64 %43, ptr %3, align 8, !tbaa !5
  br label %44

44:                                               ; preds = %42, %39, %33
  %45 = load i64, ptr %4, align 8, !tbaa !5
  %46 = getelementptr inbounds [101 x i64], ptr @a, i64 0, i64 %45
  %47 = load i64, ptr %46, align 8, !tbaa !5
  %48 = load i64, ptr @p, align 8, !tbaa !5
  %49 = sub nsw i64 %47, %48
  %50 = call noundef i64 @_ZSt3absx(i64 noundef %49)
  %51 = load i64, ptr %4, align 8, !tbaa !5
  %52 = getelementptr inbounds [101 x i64], ptr @a, i64 0, i64 %51
  store i64 %50, ptr %52, align 8, !tbaa !5
  %53 = load i64, ptr %4, align 8, !tbaa !5
  %54 = getelementptr inbounds [101 x i64], ptr @a, i64 0, i64 %53
  %55 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) @mn, ptr noundef nonnull align 8 dereferenceable(8) %54)
  %56 = load i64, ptr %55, align 8, !tbaa !5
  store i64 %56, ptr @mn, align 8, !tbaa !5
  br label %57

57:                                               ; preds = %44
  %58 = load i64, ptr %4, align 8, !tbaa !5
  %59 = add nsw i64 %58, 1
  store i64 %59, ptr %4, align 8, !tbaa !5
  br label %28, !llvm.loop !11

60:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  %61 = load i64, ptr @p, align 8, !tbaa !5
  store i64 %61, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  store i64 -1, ptr %6, align 8, !tbaa !5
  %62 = load i64, ptr %3, align 8, !tbaa !5
  %63 = icmp eq i64 %62, 0
  br i1 %63, label %64, label %65

64:                                               ; preds = %60
  store i64 0, ptr %6, align 8, !tbaa !5
  br label %70

65:                                               ; preds = %60
  %66 = load i64, ptr %3, align 8, !tbaa !5
  %67 = sub nsw i64 %66, 1
  %68 = getelementptr inbounds [101 x i64], ptr @a, i64 0, i64 %67
  %69 = load i64, ptr %68, align 8, !tbaa !5
  store i64 %69, ptr %6, align 8, !tbaa !5
  br label %70

70:                                               ; preds = %65, %64
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %71 = load i64, ptr %3, align 8, !tbaa !5
  store i64 %71, ptr %7, align 8, !tbaa !5
  br label %72

72:                                               ; preds = %117, %70
  %73 = load i64, ptr %7, align 8, !tbaa !5
  %74 = load i64, ptr @n, align 8, !tbaa !5
  %75 = icmp slt i64 %73, %74
  br i1 %75, label %77, label %76

76:                                               ; preds = %72
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  br label %120

77:                                               ; preds = %72
  %78 = load i64, ptr %5, align 8, !tbaa !5
  %79 = load i64, ptr @p, align 8, !tbaa !5
  %80 = sub nsw i64 %78, %79
  %81 = load i64, ptr %7, align 8, !tbaa !5
  %82 = getelementptr inbounds [101 x i64], ptr @a, i64 0, i64 %81
  %83 = load i64, ptr %82, align 8, !tbaa !5
  %84 = sub nsw i64 %83, %80
  store i64 %84, ptr %82, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %85 = load i64, ptr %6, align 8, !tbaa !5
  %86 = load i64, ptr %7, align 8, !tbaa !5
  %87 = getelementptr inbounds [101 x i64], ptr @a, i64 0, i64 %86
  %88 = load i64, ptr %87, align 8, !tbaa !5
  %89 = add nsw i64 %85, %88
  %90 = sdiv i64 %89, 2
  store i64 %90, ptr %8, align 8, !tbaa !5
  %91 = load i64, ptr %8, align 8, !tbaa !5
  %92 = load i64, ptr @mn, align 8, !tbaa !5
  %93 = icmp sgt i64 %91, %92
  br i1 %93, label %94, label %109

94:                                               ; preds = %77
  %95 = load i64, ptr %8, align 8, !tbaa !5
  store i64 %95, ptr @mn, align 8, !tbaa !5
  %96 = load i64, ptr %7, align 8, !tbaa !5
  %97 = getelementptr inbounds [101 x i64], ptr @a, i64 0, i64 %96
  %98 = load i64, ptr %97, align 8, !tbaa !5
  %99 = load i64, ptr %8, align 8, !tbaa !5
  %100 = sub nsw i64 %98, %99
  %101 = load i64, ptr %5, align 8, !tbaa !5
  %102 = add nsw i64 %101, %100
  store i64 %102, ptr %5, align 8, !tbaa !5
  %103 = load i64, ptr %5, align 8, !tbaa !5
  %104 = load i64, ptr @q, align 8, !tbaa !5
  %105 = icmp sle i64 %103, %104
  br i1 %105, label %106, label %108

106:                                              ; preds = %94
  %107 = load i64, ptr %5, align 8, !tbaa !5
  store i64 %107, ptr @ans, align 8, !tbaa !5
  br label %108

108:                                              ; preds = %106, %94
  br label %109

109:                                              ; preds = %108, %77
  %110 = load i64, ptr %7, align 8, !tbaa !5
  %111 = getelementptr inbounds [101 x i64], ptr @a, i64 0, i64 %110
  %112 = load i64, ptr %111, align 8, !tbaa !5
  %113 = load i64, ptr %5, align 8, !tbaa !5
  %114 = add nsw i64 %113, %112
  store i64 %114, ptr %5, align 8, !tbaa !5
  %115 = load i64, ptr %7, align 8, !tbaa !5
  %116 = getelementptr inbounds [101 x i64], ptr @a, i64 0, i64 %115
  store i64 0, ptr %116, align 8, !tbaa !5
  store i64 0, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  br label %117

117:                                              ; preds = %109
  %118 = load i64, ptr %7, align 8, !tbaa !5
  %119 = add nsw i64 %118, 1
  store i64 %119, ptr %7, align 8, !tbaa !5
  br label %72, !llvm.loop !12

120:                                              ; preds = %76
  %121 = load i64, ptr @ans, align 8, !tbaa !5
  %122 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %121)
  %123 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %122, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  ret i32 0
}

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

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #3

attributes #0 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { 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 #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 = { 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 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}


; 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 i64, align 8
@a = external dso_local global [101 x i64], align 16
@p = external dso_local global i64, align 8
@q = external dso_local global i64, align 8
@mn = external dso_local global i64, align 8
@ans = external dso_local local_unnamed_addr global i64, align 8
@_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 @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @n)
  %2 = load i64, ptr @n, align 8, !tbaa !5
  %3 = icmp sgt i64 %2, 0
  br i1 %3, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %0
  %4 = 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) @p)
  %5 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %4, ptr noundef nonnull align 8 dereferenceable(8) @q)
  %6 = load i64, ptr @n, align 8, !tbaa !5
  %7 = getelementptr inbounds i64, ptr @a, i64 %6
  tail call void @_ZSt4sortIPxEvT_S1_(ptr noundef nonnull @a, ptr noundef nonnull %7)
  store i64 1000000000, ptr @mn, align 8, !tbaa !5
  %8 = load i64, ptr @p, align 8, !tbaa !5
  store i64 %8, ptr @ans, align 8, !tbaa !5
  %9 = load i64, ptr @n, align 8, !tbaa !5
  %10 = icmp sgt i64 %9, 0
  br i1 %10, label %.lr.ph45, label %._crit_edge46.thread

.lr.ph:                                           ; preds = %0, %.lr.ph
  %.041 = phi i64 [ %13, %.lr.ph ], [ 0, %0 ]
  %11 = getelementptr inbounds [101 x i64], ptr @a, i64 0, i64 %.041
  %12 = 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) %11)
  %13 = add nuw nsw i64 %.041, 1
  %14 = load i64, ptr @n, align 8, !tbaa !5
  %15 = icmp slt i64 %13, %14
  br i1 %15, label %.lr.ph, label %._crit_edge, !llvm.loop !9

._crit_edge46:                                    ; preds = %.lr.ph45
  %.pre = load i64, ptr @p, align 8, !tbaa !5
  %16 = icmp eq i64 %spec.select, 0
  br i1 %16, label %33, label %._crit_edge46.thread

.lr.ph45:                                         ; preds = %._crit_edge, %.lr.ph45
  %.03543 = phi i64 [ %26, %.lr.ph45 ], [ 0, %._crit_edge ]
  %.03642 = phi i64 [ %spec.select, %.lr.ph45 ], [ -1, %._crit_edge ]
  %17 = getelementptr inbounds [101 x i64], ptr @a, i64 0, i64 %.03543
  %18 = load i64, ptr %17, align 8, !tbaa !5
  %19 = load i64, ptr @p, align 8, !tbaa !5
  %20 = icmp sge i64 %18, %19
  %21 = icmp eq i64 %.03642, -1
  %or.cond = select i1 %20, i1 %21, i1 false
  %spec.select = select i1 %or.cond, i64 %.03543, i64 %.03642
  %22 = sub nsw i64 %18, %19
  %23 = tail call noundef i64 @_ZSt3absx(i64 noundef %22)
  store i64 %23, ptr %17, align 8, !tbaa !5
  %24 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) @mn, ptr noundef nonnull align 8 dereferenceable(8) %17)
  %25 = load i64, ptr %24, align 8, !tbaa !5
  store i64 %25, ptr @mn, align 8, !tbaa !5
  %26 = add nuw nsw i64 %.03543, 1
  %27 = load i64, ptr @n, align 8, !tbaa !5
  %28 = icmp slt i64 %26, %27
  br i1 %28, label %.lr.ph45, label %._crit_edge46, !llvm.loop !11

._crit_edge46.thread:                             ; preds = %._crit_edge, %._crit_edge46
  %.lcssa64 = phi i64 [ %27, %._crit_edge46 ], [ %9, %._crit_edge ]
  %.036.lcssa62 = phi i64 [ %spec.select, %._crit_edge46 ], [ -1, %._crit_edge ]
  %29 = phi i64 [ %.pre, %._crit_edge46 ], [ %8, %._crit_edge ]
  %mn.promoted60 = phi i64 [ %25, %._crit_edge46 ], [ 1000000000, %._crit_edge ]
  %30 = add nsw i64 %.036.lcssa62, -1
  %31 = getelementptr inbounds [101 x i64], ptr @a, i64 0, i64 %30
  %32 = load i64, ptr %31, align 8, !tbaa !5
  br label %33

33:                                               ; preds = %._crit_edge46, %._crit_edge46.thread
  %.lcssa65 = phi i64 [ %.lcssa64, %._crit_edge46.thread ], [ %27, %._crit_edge46 ]
  %.036.lcssa63 = phi i64 [ %.036.lcssa62, %._crit_edge46.thread ], [ 0, %._crit_edge46 ]
  %34 = phi i64 [ %29, %._crit_edge46.thread ], [ %.pre, %._crit_edge46 ]
  %mn.promoted61 = phi i64 [ %mn.promoted60, %._crit_edge46.thread ], [ %25, %._crit_edge46 ]
  %.032 = phi i64 [ %32, %._crit_edge46.thread ], [ 0, %._crit_edge46 ]
  %35 = icmp slt i64 %.036.lcssa63, %.lcssa65
  br i1 %35, label %.lr.ph52, label %._crit_edge53

.lr.ph52:                                         ; preds = %33
  %36 = load i64, ptr @q, align 8
  %37 = getelementptr inbounds [101 x i64], ptr @a, i64 0, i64 %.036.lcssa63
  %38 = load i64, ptr %37, align 8, !tbaa !5
  %39 = add nsw i64 %38, %.032
  %40 = sdiv i64 %39, 2
  %41 = icmp sgt i64 %40, %mn.promoted61
  br i1 %41, label %42, label %46

42:                                               ; preds = %.lr.ph52
  store i64 %40, ptr @mn, align 8, !tbaa !5
  %43 = sub nsw i64 %38, %40
  %44 = add nsw i64 %43, %34
  %.not.peel = icmp sgt i64 %44, %36
  br i1 %.not.peel, label %46, label %45

45:                                               ; preds = %42
  store i64 %44, ptr @ans, align 8, !tbaa !5
  br label %46

46:                                               ; preds = %45, %42, %.lr.ph52
  %47 = phi i64 [ %40, %45 ], [ %40, %42 ], [ %mn.promoted61, %.lr.ph52 ]
  %.134.peel = phi i64 [ %44, %45 ], [ %44, %42 ], [ %34, %.lr.ph52 ]
  store i64 0, ptr %37, align 8, !tbaa !5
  %48 = add nsw i64 %.036.lcssa63, 1
  %exitcond.peel.not = icmp eq i64 %48, %.lcssa65
  br i1 %exitcond.peel.not, label %._crit_edge53, label %.peel.next

.peel.next:                                       ; preds = %46
  %49 = add nsw i64 %.134.peel, %38
  br label %53

._crit_edge53:                                    ; preds = %64, %46, %33
  %50 = load i64, ptr @ans, align 8, !tbaa !5
  %51 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %50)
  %52 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %51, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  ret i32 0

53:                                               ; preds = %.peel.next, %64
  %.03150 = phi i64 [ %48, %.peel.next ], [ %67, %64 ]
  %.03348 = phi i64 [ %49, %.peel.next ], [ %66, %64 ]
  %54 = phi i64 [ %47, %.peel.next ], [ %65, %64 ]
  %.neg = sub i64 %34, %.03348
  %55 = getelementptr inbounds [101 x i64], ptr @a, i64 0, i64 %.03150
  %56 = load i64, ptr %55, align 8, !tbaa !5
  %57 = add i64 %56, %.neg
  %58 = sdiv i64 %57, 2
  %59 = icmp sgt i64 %58, %54
  br i1 %59, label %60, label %64

60:                                               ; preds = %53
  store i64 %58, ptr @mn, align 8, !tbaa !5
  %61 = sub nsw i64 %57, %58
  %62 = add nsw i64 %61, %.03348
  %.not = icmp sgt i64 %62, %36
  br i1 %.not, label %64, label %63

63:                                               ; preds = %60
  store i64 %62, ptr @ans, align 8, !tbaa !5
  br label %64

64:                                               ; preds = %60, %63, %53
  %65 = phi i64 [ %58, %63 ], [ %58, %60 ], [ %54, %53 ]
  %.134 = phi i64 [ %62, %63 ], [ %62, %60 ], [ %.03348, %53 ]
  %66 = add nsw i64 %.134, %57
  store i64 0, ptr %55, align 8, !tbaa !5
  %67 = add nsw i64 %.03150, 1
  %exitcond.not = icmp eq i64 %67, %.lcssa65
  br i1 %exitcond.not, label %._crit_edge53, label %53, !llvm.loop !12
}

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #2

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 = { 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 #2 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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" }

!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 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10, !13}
!13 = !{!"llvm.loop.peeled.count", i32 1}


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