; LLVM IR from kazunetakahashi/atcoder :: 2017/0422_arc072 (C)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@n = external dso_local global i32, align 4
@a = external dso_local global [100010 x 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 i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca i8, align 1
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %9 = 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 %10

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

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

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

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

23:                                               ; preds = %14
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #6
  store i64 1000000000000000, ptr %3, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  store i64 0, ptr %4, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  store i64 0, ptr %5, align 8, !tbaa !11
  %24 = load i64, ptr @a, align 16, !tbaa !11
  %25 = icmp sle i64 %24, 0
  br i1 %25, label %26, label %27

26:                                               ; preds = %23
  store i64 1, ptr %4, align 8, !tbaa !11
  br label %29

27:                                               ; preds = %23
  %28 = load i64, ptr @a, align 16, !tbaa !11
  store i64 %28, ptr %4, align 8, !tbaa !11
  br label %29

29:                                               ; preds = %27, %26
  %30 = load i64, ptr %4, align 8, !tbaa !11
  %31 = load i64, ptr @a, align 16, !tbaa !11
  %32 = sub nsw i64 %30, %31
  %33 = call noundef i64 @_ZSt3absx(i64 noundef %32)
  %34 = load i64, ptr %5, align 8, !tbaa !11
  %35 = add nsw i64 %34, %33
  store i64 %35, ptr %5, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 1, ptr %6) #6
  store i8 1, ptr %6, align 1, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 1, ptr %7, align 4, !tbaa !5
  br label %36

36:                                               ; preds = %77, %29
  %37 = load i32, ptr %7, align 4, !tbaa !5
  %38 = load i32, ptr @n, align 4, !tbaa !5
  %39 = icmp slt i32 %37, %38
  br i1 %39, label %41, label %40

40:                                               ; preds = %36
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %80

41:                                               ; preds = %36
  %42 = load i32, ptr %7, align 4, !tbaa !5
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds [100010 x i64], ptr @a, i64 0, i64 %43
  %45 = load i64, ptr %44, align 8, !tbaa !11
  %46 = load i64, ptr %4, align 8, !tbaa !11
  %47 = add nsw i64 %46, %45
  store i64 %47, ptr %4, align 8, !tbaa !11
  %48 = load i8, ptr %6, align 1, !tbaa !13, !range !15, !noundef !16
  %49 = trunc i8 %48 to i1
  br i1 %49, label %50, label %59

50:                                               ; preds = %41
  %51 = load i64, ptr %4, align 8, !tbaa !11
  %52 = icmp sge i64 %51, 0
  br i1 %52, label %53, label %59

53:                                               ; preds = %50
  %54 = load i64, ptr %4, align 8, !tbaa !11
  %55 = sub nsw i64 %54, -1
  %56 = call noundef i64 @_ZSt3absx(i64 noundef %55)
  %57 = load i64, ptr %5, align 8, !tbaa !11
  %58 = add nsw i64 %57, %56
  store i64 %58, ptr %5, align 8, !tbaa !11
  store i64 -1, ptr %4, align 8, !tbaa !11
  br label %72

59:                                               ; preds = %50, %41
  %60 = load i8, ptr %6, align 1, !tbaa !13, !range !15, !noundef !16
  %61 = trunc i8 %60 to i1
  br i1 %61, label %71, label %62

62:                                               ; preds = %59
  %63 = load i64, ptr %4, align 8, !tbaa !11
  %64 = icmp sle i64 %63, 0
  br i1 %64, label %65, label %71

65:                                               ; preds = %62
  %66 = load i64, ptr %4, align 8, !tbaa !11
  %67 = sub nsw i64 %66, 1
  %68 = call noundef i64 @_ZSt3absx(i64 noundef %67)
  %69 = load i64, ptr %5, align 8, !tbaa !11
  %70 = add nsw i64 %69, %68
  store i64 %70, ptr %5, align 8, !tbaa !11
  store i64 1, ptr %4, align 8, !tbaa !11
  br label %71

71:                                               ; preds = %65, %62, %59
  br label %72

72:                                               ; preds = %71, %53
  %73 = load i8, ptr %6, align 1, !tbaa !13, !range !15, !noundef !16
  %74 = trunc i8 %73 to i1
  %75 = xor i1 %74, true
  %76 = zext i1 %75 to i8
  store i8 %76, ptr %6, align 1, !tbaa !13
  br label %77

77:                                               ; preds = %72
  %78 = load i32, ptr %7, align 4, !tbaa !5
  %79 = add nsw i32 %78, 1
  store i32 %79, ptr %7, align 4, !tbaa !5
  br label %36, !llvm.loop !17

80:                                               ; preds = %40
  %81 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %82 = load i64, ptr %81, align 8, !tbaa !11
  store i64 %82, ptr %3, align 8, !tbaa !11
  store i64 0, ptr %4, align 8, !tbaa !11
  store i64 0, ptr %5, align 8, !tbaa !11
  %83 = load i64, ptr @a, align 16, !tbaa !11
  %84 = icmp sge i64 %83, 0
  br i1 %84, label %85, label %86

85:                                               ; preds = %80
  store i64 -1, ptr %4, align 8, !tbaa !11
  br label %88

86:                                               ; preds = %80
  %87 = load i64, ptr @a, align 16, !tbaa !11
  store i64 %87, ptr %4, align 8, !tbaa !11
  br label %88

88:                                               ; preds = %86, %85
  %89 = load i64, ptr %4, align 8, !tbaa !11
  %90 = load i64, ptr @a, align 16, !tbaa !11
  %91 = sub nsw i64 %89, %90
  %92 = call noundef i64 @_ZSt3absx(i64 noundef %91)
  %93 = load i64, ptr %5, align 8, !tbaa !11
  %94 = add nsw i64 %93, %92
  store i64 %94, ptr %5, align 8, !tbaa !11
  store i8 0, ptr %6, align 1, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 1, ptr %8, align 4, !tbaa !5
  br label %95

95:                                               ; preds = %136, %88
  %96 = load i32, ptr %8, align 4, !tbaa !5
  %97 = load i32, ptr @n, align 4, !tbaa !5
  %98 = icmp slt i32 %96, %97
  br i1 %98, label %100, label %99

99:                                               ; preds = %95
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %139

100:                                              ; preds = %95
  %101 = load i32, ptr %8, align 4, !tbaa !5
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [100010 x i64], ptr @a, i64 0, i64 %102
  %104 = load i64, ptr %103, align 8, !tbaa !11
  %105 = load i64, ptr %4, align 8, !tbaa !11
  %106 = add nsw i64 %105, %104
  store i64 %106, ptr %4, align 8, !tbaa !11
  %107 = load i8, ptr %6, align 1, !tbaa !13, !range !15, !noundef !16
  %108 = trunc i8 %107 to i1
  br i1 %108, label %109, label %118

109:                                              ; preds = %100
  %110 = load i64, ptr %4, align 8, !tbaa !11
  %111 = icmp sge i64 %110, 0
  br i1 %111, label %112, label %118

112:                                              ; preds = %109
  %113 = load i64, ptr %4, align 8, !tbaa !11
  %114 = sub nsw i64 %113, -1
  %115 = call noundef i64 @_ZSt3absx(i64 noundef %114)
  %116 = load i64, ptr %5, align 8, !tbaa !11
  %117 = add nsw i64 %116, %115
  store i64 %117, ptr %5, align 8, !tbaa !11
  store i64 -1, ptr %4, align 8, !tbaa !11
  br label %131

118:                                              ; preds = %109, %100
  %119 = load i8, ptr %6, align 1, !tbaa !13, !range !15, !noundef !16
  %120 = trunc i8 %119 to i1
  br i1 %120, label %130, label %121

121:                                              ; preds = %118
  %122 = load i64, ptr %4, align 8, !tbaa !11
  %123 = icmp sle i64 %122, 0
  br i1 %123, label %124, label %130

124:                                              ; preds = %121
  %125 = load i64, ptr %4, align 8, !tbaa !11
  %126 = sub nsw i64 %125, 1
  %127 = call noundef i64 @_ZSt3absx(i64 noundef %126)
  %128 = load i64, ptr %5, align 8, !tbaa !11
  %129 = add nsw i64 %128, %127
  store i64 %129, ptr %5, align 8, !tbaa !11
  store i64 1, ptr %4, align 8, !tbaa !11
  br label %130

130:                                              ; preds = %124, %121, %118
  br label %131

131:                                              ; preds = %130, %112
  %132 = load i8, ptr %6, align 1, !tbaa !13, !range !15, !noundef !16
  %133 = trunc i8 %132 to i1
  %134 = xor i1 %133, true
  %135 = zext i1 %134 to i8
  store i8 %135, ptr %6, align 1, !tbaa !13
  br label %136

136:                                              ; preds = %131
  %137 = load i32, ptr %8, align 4, !tbaa !5
  %138 = add nsw i32 %137, 1
  store i32 %138, ptr %8, align 4, !tbaa !5
  br label %95, !llvm.loop !18

139:                                              ; preds = %99
  %140 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %141 = load i64, ptr %140, align 8, !tbaa !11
  store i64 %141, ptr %3, align 8, !tbaa !11
  %142 = load i64, ptr %3, align 8, !tbaa !11
  %143 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %142)
  %144 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %143, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  %145 = load i32, ptr %1, align 4
  ret i32 %145
}

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 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) #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)) #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 = { 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 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 = { 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 #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 = !{!14, !14, i64 0}
!14 = !{!"bool", !7, i64 0}
!15 = !{i8 0, i8 2}
!16 = !{}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !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
@_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 = alloca i64, align 8
  %2 = alloca i64, align 8
  %3 = 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)
  %4 = load i32, ptr @n, align 4, !tbaa !5
  %5 = icmp sgt i32 %4, 0
  br i1 %5, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %0
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #7
  store i64 1000000000000000, ptr %1, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #7
  %6 = load i64, ptr @a, align 16, !tbaa !9
  %. = tail call i64 @llvm.smax.i64(i64 %6, i64 1)
  %7 = sub nsw i64 %., %6
  %8 = tail call noundef i64 @_ZSt3absx(i64 noundef %7)
  %9 = load i32, ptr @n, align 4, !tbaa !5
  %10 = icmp sgt i32 %9, 1
  br i1 %10, label %.lr.ph55, label %._crit_edge56

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

._crit_edge56:                                    ; preds = %35, %._crit_edge
  %.lcssa = phi i64 [ %8, %._crit_edge ], [ %36, %35 ]
  store i64 %.lcssa, ptr %2, align 8, !tbaa !9
  %16 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %17 = load i64, ptr %16, align 8, !tbaa !9
  store i64 %17, ptr %1, align 8, !tbaa !9
  store i64 0, ptr %2, align 8, !tbaa !9
  %18 = load i64, ptr @a, align 16, !tbaa !9
  %.49 = call i64 @llvm.smin.i64(i64 %18, i64 -1)
  %19 = sub nsw i64 %.49, %18
  %20 = call noundef i64 @_ZSt3absx(i64 noundef %19)
  %21 = load i64, ptr %2, align 8, !tbaa !9
  %22 = add nsw i64 %21, %20
  store i64 %22, ptr %2, align 8, !tbaa !9
  %23 = load i32, ptr @n, align 4, !tbaa !5
  %24 = icmp sgt i32 %23, 1
  br i1 %24, label %.lr.ph61, label %._crit_edge62

.lr.ph55:                                         ; preds = %._crit_edge, %35
  %indvars.iv65 = phi i64 [ %indvars.iv.next66, %35 ], [ 1, %._crit_edge ]
  %.03653 = phi i32 [ %37, %35 ], [ 1, %._crit_edge ]
  %.13951 = phi i64 [ %.2, %35 ], [ %., %._crit_edge ]
  %25 = phi i64 [ %36, %35 ], [ %8, %._crit_edge ]
  %indvars67 = trunc i32 %.03653 to i1
  %26 = getelementptr inbounds [100010 x i64], ptr @a, i64 0, i64 %indvars.iv65
  %27 = load i64, ptr %26, align 8, !tbaa !9
  %28 = add nsw i64 %27, %.13951
  %29 = icmp sgt i64 %28, -1
  %or.cond = select i1 %indvars67, i1 %29, i1 false
  br i1 %or.cond, label %.sink.split, label %30

30:                                               ; preds = %.lr.ph55
  %31 = icmp sgt i64 %28, 0
  %or.cond3.not = select i1 %indvars67, i1 true, i1 %31
  br i1 %or.cond3.not, label %35, label %.sink.split

.sink.split:                                      ; preds = %30, %.lr.ph55
  %.sink = phi i64 [ 1, %.lr.ph55 ], [ -1, %30 ]
  %.2.ph = phi i64 [ -1, %.lr.ph55 ], [ 1, %30 ]
  %32 = add nsw i64 %28, %.sink
  %33 = tail call noundef i64 @_ZSt3absx(i64 noundef %32)
  %34 = add nsw i64 %25, %33
  br label %35

35:                                               ; preds = %.sink.split, %30
  %36 = phi i64 [ %25, %30 ], [ %34, %.sink.split ]
  %.2 = phi i64 [ %28, %30 ], [ %.2.ph, %.sink.split ]
  %37 = add nuw nsw i32 %.03653, 1
  %indvars.iv.next66 = add nuw nsw i64 %indvars.iv65, 1
  %38 = load i32, ptr @n, align 4, !tbaa !5
  %39 = sext i32 %38 to i64
  %40 = icmp slt i64 %indvars.iv.next66, %39
  br i1 %40, label %.lr.ph55, label %._crit_edge56, !llvm.loop !13

._crit_edge62:                                    ; preds = %61, %._crit_edge56
  %41 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %42 = load i64, ptr %41, align 8, !tbaa !9
  store i64 %42, ptr %1, align 8, !tbaa !9
  %43 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %42)
  %44 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %43, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #7
  ret i32 0

.lr.ph61:                                         ; preds = %._crit_edge56, %61
  %indvars.iv68 = phi i64 [ %indvars.iv.next69, %61 ], [ 1, %._crit_edge56 ]
  %.158 = phi i1 [ %62, %61 ], [ false, %._crit_edge56 ]
  %.457 = phi i64 [ %.5, %61 ], [ %.49, %._crit_edge56 ]
  %45 = getelementptr inbounds [100010 x i64], ptr @a, i64 0, i64 %indvars.iv68
  %46 = load i64, ptr %45, align 8, !tbaa !9
  %47 = add nsw i64 %46, %.457
  %48 = icmp sgt i64 %47, -1
  %or.cond5 = select i1 %.158, i1 %48, i1 false
  br i1 %or.cond5, label %49, label %54

49:                                               ; preds = %.lr.ph61
  %50 = add nuw nsw i64 %47, 1
  %51 = call noundef i64 @_ZSt3absx(i64 noundef %50)
  %52 = load i64, ptr %2, align 8, !tbaa !9
  %53 = add nsw i64 %52, %51
  store i64 %53, ptr %2, align 8, !tbaa !9
  br label %61

54:                                               ; preds = %.lr.ph61
  %55 = icmp sgt i64 %47, 0
  %or.cond8.not = select i1 %.158, i1 true, i1 %55
  br i1 %or.cond8.not, label %61, label %56

56:                                               ; preds = %54
  %57 = add nsw i64 %47, -1
  %58 = call noundef i64 @_ZSt3absx(i64 noundef %57)
  %59 = load i64, ptr %2, align 8, !tbaa !9
  %60 = add nsw i64 %59, %58
  store i64 %60, ptr %2, align 8, !tbaa !9
  br label %61

61:                                               ; preds = %54, %56, %49
  %.5 = phi i64 [ -1, %49 ], [ 1, %56 ], [ %47, %54 ]
  %62 = xor i1 %.158, true
  %indvars.iv.next69 = add nuw nsw i64 %indvars.iv68, 1
  %63 = load i32, ptr @n, align 4, !tbaa !5
  %64 = sext i32 %63 to i64
  %65 = icmp slt i64 %indvars.iv.next69, %64
  br i1 %65, label %.lr.ph61, label %._crit_edge62, !llvm.loop !14
}

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 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)) local_unnamed_addr #3 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZSt3absx(i64 noundef) local_unnamed_addr #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)) 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 #3 align 2

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #6

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #6

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 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 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 = { 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 #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { 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}


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