; LLVM IR from VastoLorde95/Competitive-Programming :: CodeChef/WF/Easy Medium/COOKGAME/A.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 [100100 x i32], align 16
@p = external dso_local global [100100 x i32], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1

; 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
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #5
  %7 = 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) #5
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %8

8:                                                ; preds = %18, %0
  %9 = load i32, ptr %2, align 4, !tbaa !5
  %10 = load i32, ptr %1, align 4, !tbaa !5
  %11 = icmp sle i32 %9, %10
  br i1 %11, label %13, label %12

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

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

18:                                               ; preds = %13
  %19 = load i32, ptr %2, align 4, !tbaa !5
  %20 = add nsw i32 %19, 1
  store i32 %20, ptr %2, align 4, !tbaa !5
  br label %8, !llvm.loop !9

21:                                               ; preds = %12
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  %22 = load i32, ptr %1, align 4, !tbaa !5
  %23 = sub nsw i32 %22, 1
  store i32 %23, ptr %3, align 4, !tbaa !5
  br label %24

24:                                               ; preds = %76, %21
  %25 = load i32, ptr %3, align 4, !tbaa !5
  %26 = icmp sge i32 %25, 0
  br i1 %26, label %28, label %27

27:                                               ; preds = %24
  store i32 5, ptr %4, align 4
  br label %79

28:                                               ; preds = %24
  %29 = load i32, ptr %3, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %30
  %32 = load i32, ptr %31, align 4, !tbaa !5
  %33 = icmp eq i32 %32, -1
  br i1 %33, label %34, label %52

34:                                               ; preds = %28
  %35 = load i32, ptr %3, align 4, !tbaa !5
  %36 = add nsw i32 %35, 1
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %37
  %39 = load i32, ptr %38, align 4, !tbaa !5
  %40 = icmp sgt i32 %39, 1
  br i1 %40, label %41, label %51

41:                                               ; preds = %34
  %42 = load i32, ptr %3, align 4, !tbaa !5
  %43 = add nsw i32 %42, 1
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %44
  %46 = load i32, ptr %45, align 4, !tbaa !5
  %47 = sub nsw i32 %46, 1
  %48 = load i32, ptr %3, align 4, !tbaa !5
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %49
  store i32 %47, ptr %50, align 4, !tbaa !5
  br label %51

51:                                               ; preds = %41, %34
  br label %75

52:                                               ; preds = %28
  %53 = load i32, ptr %3, align 4, !tbaa !5
  %54 = add nsw i32 %53, 1
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %55
  %57 = load i32, ptr %56, align 4, !tbaa !5
  %58 = call i32 @llvm.abs.i32(i32 %57, i1 true)
  %59 = icmp ne i32 %58, 1
  br i1 %59, label %60, label %74

60:                                               ; preds = %52
  %61 = load i32, ptr %3, align 4, !tbaa !5
  %62 = add nsw i32 %61, 1
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %63
  %65 = load i32, ptr %64, align 4, !tbaa !5
  %66 = load i32, ptr %3, align 4, !tbaa !5
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %67
  %69 = load i32, ptr %68, align 4, !tbaa !5
  %70 = add nsw i32 %69, 1
  %71 = icmp ne i32 %65, %70
  br i1 %71, label %72, label %74

72:                                               ; preds = %60
  %73 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
  store i32 1, ptr %4, align 4
  br label %79

74:                                               ; preds = %60, %52
  br label %75

75:                                               ; preds = %74, %51
  br label %76

76:                                               ; preds = %75
  %77 = load i32, ptr %3, align 4, !tbaa !5
  %78 = add nsw i32 %77, -1
  store i32 %78, ptr %3, align 4, !tbaa !5
  br label %24, !llvm.loop !11

79:                                               ; preds = %72, %27
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  %80 = load i32, ptr %4, align 4
  switch i32 %80, label %115 [
    i32 5, label %81
  ]

81:                                               ; preds = %79
  %82 = load i32, ptr getelementptr inbounds ([100100 x i32], ptr @a, i64 0, i64 1), align 4, !tbaa !5
  %83 = icmp eq i32 %82, -1
  br i1 %83, label %84, label %85

84:                                               ; preds = %81
  store i32 1, ptr getelementptr inbounds ([100100 x i32], ptr @a, i64 0, i64 1), align 4, !tbaa !5
  br label %85

85:                                               ; preds = %84, %81
  %86 = load i32, ptr getelementptr inbounds ([100100 x i32], ptr @a, i64 0, i64 1), align 4, !tbaa !5
  %87 = icmp ne i32 %86, 1
  br i1 %87, label %88, label %90

88:                                               ; preds = %85
  %89 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
  store i32 1, ptr %4, align 4
  br label %115

90:                                               ; preds = %85
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  store i32 0, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 1, ptr %6, align 4, !tbaa !5
  br label %91

91:                                               ; preds = %105, %90
  %92 = load i32, ptr %6, align 4, !tbaa !5
  %93 = load i32, ptr %1, align 4, !tbaa !5
  %94 = icmp sle i32 %92, %93
  br i1 %94, label %96, label %95

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

96:                                               ; preds = %91
  %97 = load i32, ptr %6, align 4, !tbaa !5
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %98
  %100 = load i32, ptr %99, align 4, !tbaa !5
  %101 = icmp eq i32 %100, -1
  %102 = zext i1 %101 to i32
  %103 = load i32, ptr %5, align 4, !tbaa !5
  %104 = add nsw i32 %103, %102
  store i32 %104, ptr %5, align 4, !tbaa !5
  br label %105

105:                                              ; preds = %96
  %106 = load i32, ptr %6, align 4, !tbaa !5
  %107 = add nsw i32 %106, 1
  store i32 %107, ptr %6, align 4, !tbaa !5
  br label %91, !llvm.loop !12

108:                                              ; preds = %95
  %109 = load i32, ptr %5, align 4, !tbaa !5
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [100100 x i32], ptr @p, i64 0, i64 %110
  %112 = load i32, ptr %111, align 4, !tbaa !5
  %113 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %112)
  %114 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %113, i8 noundef signext 10)
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  store i32 0, ptr %4, align 4
  br label %115

115:                                              ; preds = %108, %88, %79
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #5
  %116 = load i32, ptr %4, align 4
  switch i32 %116, label %118 [
    i32 0, label %117
    i32 1, label %117
  ]

117:                                              ; preds = %115, %115
  ret void

118:                                              ; preds = %115
  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_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #4

; 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

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

@a = external dso_local global [100100 x i32], align 16
@p = external dso_local local_unnamed_addr global [100100 x i32], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solvev() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  %2 = 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)
  %3 = load i32, ptr %1, align 4, !tbaa !5
  %.not30 = icmp slt i32 %3, 1
  br i1 %.not30, label %.critedge, label %.lr.ph

.preheader29:                                     ; preds = %.lr.ph
  %4 = icmp slt i32 %8, 1
  br i1 %4, label %.critedge, label %.lr.ph35.preheader

.lr.ph35.preheader:                               ; preds = %.preheader29
  %5 = zext nneg i32 %8 to i64
  br label %.lr.ph35

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

.lr.ph35:                                         ; preds = %.lr.ph35.preheader, %24
  %indvars.iv44 = phi i64 [ %5, %.lr.ph35.preheader ], [ %indvars.iv.next45, %24 ]
  %indvars.iv.next45 = add nsw i64 %indvars.iv44, -1
  %10 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %indvars.iv.next45
  %11 = load i32, ptr %10, align 4, !tbaa !5
  %12 = icmp eq i32 %11, -1
  %13 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %indvars.iv44
  %14 = load i32, ptr %13, align 4, !tbaa !5
  br i1 %12, label %15, label %19

15:                                               ; preds = %.lr.ph35
  %16 = icmp sgt i32 %14, 1
  br i1 %16, label %17, label %24

17:                                               ; preds = %15
  %18 = add nsw i32 %14, -1
  store i32 %18, ptr %10, align 4, !tbaa !5
  br label %24

19:                                               ; preds = %.lr.ph35
  %20 = call i32 @llvm.abs.i32(i32 %14, i1 true)
  %.not25 = icmp eq i32 %20, 1
  %21 = add nuw nsw i32 %11, 1
  %.not26 = icmp eq i32 %14, %21
  %or.cond = select i1 %.not25, i1 true, i1 %.not26
  br i1 %or.cond, label %24, label %22

22:                                               ; preds = %19
  %23 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str)
  br label %53

24:                                               ; preds = %17, %15, %19
  %25 = icmp ult i64 %indvars.iv44, 2
  br i1 %25, label %.critedge, label %.lr.ph35, !llvm.loop !11

.critedge:                                        ; preds = %24, %0, %.preheader29
  %26 = phi i1 [ true, %.preheader29 ], [ true, %0 ], [ %4, %24 ]
  %27 = phi i32 [ %8, %.preheader29 ], [ %3, %0 ], [ %8, %24 ]
  %28 = load i32, ptr getelementptr inbounds (i8, ptr @a, i64 4), align 4, !tbaa !5
  switch i32 %28, label %41 [
    i32 -1, label %.thread
    i32 1, label %.preheader
  ]

.thread:                                          ; preds = %.critedge
  store i32 1, ptr getelementptr inbounds (i8, ptr @a, i64 4), align 4, !tbaa !5
  br label %.preheader

.preheader:                                       ; preds = %.critedge, %.thread
  br i1 %26, label %._crit_edge, label %.lr.ph39.preheader

.lr.ph39.preheader:                               ; preds = %.preheader
  %29 = add nuw i32 %27, 1
  %wide.trip.count = zext i32 %29 to i64
  %30 = zext i32 %27 to i64
  %min.iters.check = icmp ult i32 %27, 8
  br i1 %min.iters.check, label %.lr.ph39.preheader55, label %vector.ph

.lr.ph39.preheader55:                             ; preds = %middle.block, %.lr.ph39.preheader
  %indvars.iv47.ph = phi i64 [ 1, %.lr.ph39.preheader ], [ %ind.end, %middle.block ]
  %.01837.ph = phi i32 [ 0, %.lr.ph39.preheader ], [ %40, %middle.block ]
  br label %.lr.ph39

vector.ph:                                        ; preds = %.lr.ph39.preheader
  %n.vec = and i64 %30, 4294967288
  %ind.end = or disjoint i64 %n.vec, 1
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %37, %vector.body ]
  %vec.phi53 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %38, %vector.body ]
  %offset.idx = or disjoint i64 %index, 1
  %31 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %offset.idx
  %32 = getelementptr inbounds i8, ptr %31, i64 16
  %wide.load = load <4 x i32>, ptr %31, align 4, !tbaa !5
  %wide.load54 = load <4 x i32>, ptr %32, align 4, !tbaa !5
  %33 = icmp eq <4 x i32> %wide.load, <i32 -1, i32 -1, i32 -1, i32 -1>
  %34 = icmp eq <4 x i32> %wide.load54, <i32 -1, i32 -1, i32 -1, i32 -1>
  %35 = zext <4 x i1> %33 to <4 x i32>
  %36 = zext <4 x i1> %34 to <4 x i32>
  %37 = add <4 x i32> %vec.phi, %35
  %38 = add <4 x i32> %vec.phi53, %36
  %index.next = add nuw i64 %index, 8
  %39 = icmp eq i64 %index.next, %n.vec
  br i1 %39, label %middle.block, label %vector.body, !llvm.loop !12

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <4 x i32> %38, %37
  %40 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
  %cmp.n = icmp eq i64 %n.vec, %30
  br i1 %cmp.n, label %._crit_edge.loopexit, label %.lr.ph39.preheader55

41:                                               ; preds = %.critedge
  %42 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str)
  br label %53

._crit_edge.loopexit:                             ; preds = %.lr.ph39, %middle.block
  %.lcssa = phi i32 [ %40, %middle.block ], [ %52, %.lr.ph39 ]
  %43 = zext nneg i32 %.lcssa to i64
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader
  %.018.lcssa = phi i64 [ 0, %.preheader ], [ %43, %._crit_edge.loopexit ]
  %44 = getelementptr inbounds [100100 x i32], ptr @p, i64 0, i64 %.018.lcssa
  %45 = load i32, ptr %44, align 4, !tbaa !5
  %46 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %45)
  %47 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %46, i8 noundef signext 10)
  br label %53

.lr.ph39:                                         ; preds = %.lr.ph39.preheader55, %.lr.ph39
  %indvars.iv47 = phi i64 [ %indvars.iv.next48, %.lr.ph39 ], [ %indvars.iv47.ph, %.lr.ph39.preheader55 ]
  %.01837 = phi i32 [ %52, %.lr.ph39 ], [ %.01837.ph, %.lr.ph39.preheader55 ]
  %48 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %indvars.iv47
  %49 = load i32, ptr %48, align 4, !tbaa !5
  %50 = icmp eq i32 %49, -1
  %51 = zext i1 %50 to i32
  %52 = add nuw nsw i32 %.01837, %51
  %indvars.iv.next48 = add nuw nsw i64 %indvars.iv47, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next48, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge.loopexit, label %.lr.ph39, !llvm.loop !15

53:                                               ; preds = %22, %._crit_edge, %41
  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_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #4

; 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: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #5

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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = distinct !{!11, !10}
!12 = distinct !{!12, !10, !13, !14}
!13 = !{!"llvm.loop.isvectorized", i32 1}
!14 = !{!"llvm.loop.unroll.runtime.disable"}
!15 = distinct !{!15, !10, !14, !13}


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