; LLVM IR from yanglr/leetcode-ac :: algo-basic (acwing167-sticks)

; 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" }
%"struct.std::greater" = type { i8 }

@n = external dso_local global i32, align 4
@sum = external dso_local global i32, align 4
@length = external dso_local global i32, align 4
@sticks = external dso_local global [70 x i32], align 16
@st = external dso_local global [70 x i8], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z3dfsiii(i32 noundef, i32 noundef, i32 noundef) #0

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #2 {
  %1 = alloca i32, align 4
  %2 = alloca i8, align 1
  %3 = alloca i32, align 4
  %4 = alloca %"struct.std::greater", align 1
  %5 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  br label %6

6:                                                ; preds = %80, %0
  %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) @n)
  %8 = load i32, ptr @n, align 4, !tbaa !5
  %9 = icmp ne i32 %8, 0
  br i1 %9, label %10, label %81

10:                                               ; preds = %6
  store i32 0, ptr @sum, align 4, !tbaa !5
  store i32 0, ptr @length, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %2) #6
  store i8 0, ptr %2, align 1, !tbaa !9
  call void @_ZSt4fillIPbbEvT_S1_RKT0_(ptr noundef @st, ptr noundef getelementptr inbounds (i8, ptr @st, i64 70), ptr noundef nonnull align 1 dereferenceable(1) %2)
  call void @llvm.lifetime.end.p0(i64 1, ptr %2) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %11

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

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

16:                                               ; preds = %11
  %17 = load i32, ptr %3, align 4, !tbaa !5
  %18 = sext i32 %17 to i64
  %19 = getelementptr inbounds [70 x i32], ptr @sticks, i64 0, i64 %18
  %20 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %19)
  %21 = load i32, ptr %3, align 4, !tbaa !5
  %22 = sext i32 %21 to i64
  %23 = getelementptr inbounds [70 x i32], ptr @sticks, i64 0, i64 %22
  %24 = load i32, ptr %23, align 4, !tbaa !5
  %25 = icmp sgt i32 %24, 50
  br i1 %25, label %26, label %27

26:                                               ; preds = %16
  br label %39

27:                                               ; preds = %16
  %28 = load i32, ptr %3, align 4, !tbaa !5
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds [70 x i32], ptr @sticks, i64 0, i64 %29
  %31 = load i32, ptr %30, align 4, !tbaa !5
  %32 = load i32, ptr @sum, align 4, !tbaa !5
  %33 = add nsw i32 %32, %31
  store i32 %33, ptr @sum, align 4, !tbaa !5
  %34 = load i32, ptr %3, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [70 x i32], ptr @sticks, i64 0, i64 %35
  %37 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @length, ptr noundef nonnull align 4 dereferenceable(4) %36)
  %38 = load i32, ptr %37, align 4, !tbaa !5
  store i32 %38, ptr @length, align 4, !tbaa !5
  br label %39

39:                                               ; preds = %27, %26
  %40 = load i32, ptr %3, align 4, !tbaa !5
  %41 = add nsw i32 %40, 1
  store i32 %41, ptr %3, align 4, !tbaa !5
  br label %11, !llvm.loop !11

42:                                               ; preds = %15
  %43 = load i32, ptr @n, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds i32, ptr @sticks, i64 %44
  call void @_ZSt4sortIPiSt7greaterIiEEvT_S3_T0_(ptr noundef @sticks, ptr noundef %45)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %46

46:                                               ; preds = %62, %42
  %47 = load i32, ptr %5, align 4, !tbaa !5
  %48 = load i32, ptr @n, align 4, !tbaa !5
  %49 = icmp slt i32 %47, %48
  br i1 %49, label %51, label %50

50:                                               ; preds = %46
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  br label %65

51:                                               ; preds = %46
  %52 = load i32, ptr %5, align 4, !tbaa !5
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [70 x i32], ptr @sticks, i64 0, i64 %53
  %55 = load i32, ptr %54, align 4, !tbaa !5
  %56 = icmp sgt i32 %55, 50
  br i1 %56, label %57, label %61

57:                                               ; preds = %51
  %58 = load i32, ptr %5, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [70 x i8], ptr @st, i64 0, i64 %59
  store i8 1, ptr %60, align 1, !tbaa !9
  br label %61

61:                                               ; preds = %57, %51
  br label %62

62:                                               ; preds = %61
  %63 = load i32, ptr %5, align 4, !tbaa !5
  %64 = add nsw i32 %63, 1
  store i32 %64, ptr %5, align 4, !tbaa !5
  br label %46, !llvm.loop !13

65:                                               ; preds = %50
  br label %66

66:                                               ; preds = %77, %65
  %67 = load i32, ptr @sum, align 4, !tbaa !5
  %68 = load i32, ptr @length, align 4, !tbaa !5
  %69 = srem i32 %67, %68
  %70 = icmp eq i32 %69, 0
  br i1 %70, label %71, label %77

71:                                               ; preds = %66
  %72 = call noundef zeroext i1 @_Z3dfsiii(i32 noundef 0, i32 noundef 0, i32 noundef 0)
  br i1 %72, label %73, label %77

73:                                               ; preds = %71
  %74 = load i32, ptr @length, align 4, !tbaa !5
  %75 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %74)
  %76 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %75, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %80

77:                                               ; preds = %71, %66
  %78 = load i32, ptr @length, align 4, !tbaa !5
  %79 = add nsw i32 %78, 1
  store i32 %79, ptr @length, align 4, !tbaa !5
  br label %66, !llvm.loop !14

80:                                               ; preds = %73
  br label %6, !llvm.loop !15

81:                                               ; preds = %6
  ret i32 0
}

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4fillIPbbEvT_S1_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) #4

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

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

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #0 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)) #4

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

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"bool", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}


; 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
@sum = external dso_local local_unnamed_addr global i32, align 4
@length = external dso_local global i32, align 4
@sticks = external dso_local global [70 x i32], align 16
@st = external dso_local global [70 x i8], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z3dfsiii(i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

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

; 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 norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 {
  %1 = alloca i8, align 1
  %2 = 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)
  %3 = load i32, ptr @n, align 4, !tbaa !5
  %.not17 = icmp eq i32 %3, 0
  br i1 %.not17, label %._crit_edge20, label %.lr.ph19

.lr.ph19:                                         ; preds = %0, %63
  store i32 0, ptr @sum, align 4, !tbaa !5
  store i32 0, ptr @length, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %1) #6
  store i8 0, ptr %1, align 1, !tbaa !9
  call void @_ZSt4fillIPbbEvT_S1_RKT0_(ptr noundef nonnull @st, ptr noundef nonnull getelementptr inbounds (i8, ptr @st, i64 70), ptr noundef nonnull align 1 dereferenceable(1) %1)
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %1) #6
  %4 = load i32, ptr @n, align 4, !tbaa !5
  %5 = icmp sgt i32 %4, 0
  br i1 %5, label %.lr.ph, label %.lr.ph19.._crit_edge_crit_edge

.lr.ph19.._crit_edge_crit_edge:                   ; preds = %.lr.ph19
  %.pre29 = sext i32 %4 to i64
  br label %._crit_edge

._crit_edge:                                      ; preds = %46, %.lr.ph19.._crit_edge_crit_edge
  %.pre-phi = phi i64 [ %.pre29, %.lr.ph19.._crit_edge_crit_edge ], [ %48, %46 ]
  %6 = getelementptr inbounds i32, ptr @sticks, i64 %.pre-phi
  call void @_ZSt4sortIPiSt7greaterIiEEvT_S3_T0_(ptr noundef nonnull @sticks, ptr noundef nonnull %6)
  %7 = load i32, ptr @n, align 4, !tbaa !5
  %8 = icmp sgt i32 %7, 0
  br i1 %8, label %.lr.ph16.preheader, label %.preheader

.lr.ph16.preheader:                               ; preds = %._crit_edge
  %wide.trip.count = zext nneg i32 %7 to i64
  %min.iters.check = icmp ult i32 %7, 8
  br i1 %min.iters.check, label %.lr.ph16.preheader45, label %vector.ph

.lr.ph16.preheader45:                             ; preds = %middle.block, %.lr.ph16.preheader
  %indvars.iv23.ph = phi i64 [ 0, %.lr.ph16.preheader ], [ %n.vec, %middle.block ]
  br label %.lr.ph16

vector.ph:                                        ; preds = %.lr.ph16.preheader
  %n.vec = and i64 %wide.trip.count, 2147483640
  br label %vector.body

vector.body:                                      ; preds = %pred.store.continue44, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %pred.store.continue44 ]
  %9 = or disjoint i64 %index, 4
  %10 = getelementptr inbounds [70 x i32], ptr @sticks, i64 0, i64 %index
  %11 = getelementptr inbounds i8, ptr %10, i64 16
  %wide.load = load <4 x i32>, ptr %10, align 16, !tbaa !5
  %wide.load30 = load <4 x i32>, ptr %11, align 16, !tbaa !5
  %12 = icmp sgt <4 x i32> %wide.load, <i32 50, i32 50, i32 50, i32 50>
  %13 = icmp sgt <4 x i32> %wide.load30, <i32 50, i32 50, i32 50, i32 50>
  %14 = extractelement <4 x i1> %12, i64 0
  br i1 %14, label %pred.store.if, label %pred.store.continue

pred.store.if:                                    ; preds = %vector.body
  %15 = getelementptr inbounds [70 x i8], ptr @st, i64 0, i64 %index
  store i8 1, ptr %15, align 8, !tbaa !9
  br label %pred.store.continue

pred.store.continue:                              ; preds = %pred.store.if, %vector.body
  %16 = extractelement <4 x i1> %12, i64 1
  br i1 %16, label %pred.store.if31, label %pred.store.continue32

pred.store.if31:                                  ; preds = %pred.store.continue
  %17 = or disjoint i64 %index, 1
  %18 = getelementptr inbounds [70 x i8], ptr @st, i64 0, i64 %17
  store i8 1, ptr %18, align 1, !tbaa !9
  br label %pred.store.continue32

pred.store.continue32:                            ; preds = %pred.store.if31, %pred.store.continue
  %19 = extractelement <4 x i1> %12, i64 2
  br i1 %19, label %pred.store.if33, label %pred.store.continue34

pred.store.if33:                                  ; preds = %pred.store.continue32
  %20 = or disjoint i64 %index, 2
  %21 = getelementptr inbounds [70 x i8], ptr @st, i64 0, i64 %20
  store i8 1, ptr %21, align 2, !tbaa !9
  br label %pred.store.continue34

pred.store.continue34:                            ; preds = %pred.store.if33, %pred.store.continue32
  %22 = extractelement <4 x i1> %12, i64 3
  br i1 %22, label %pred.store.if35, label %pred.store.continue36

pred.store.if35:                                  ; preds = %pred.store.continue34
  %23 = or disjoint i64 %index, 3
  %24 = getelementptr inbounds [70 x i8], ptr @st, i64 0, i64 %23
  store i8 1, ptr %24, align 1, !tbaa !9
  br label %pred.store.continue36

pred.store.continue36:                            ; preds = %pred.store.if35, %pred.store.continue34
  %25 = extractelement <4 x i1> %13, i64 0
  br i1 %25, label %pred.store.if37, label %pred.store.continue38

pred.store.if37:                                  ; preds = %pred.store.continue36
  %26 = getelementptr inbounds [70 x i8], ptr @st, i64 0, i64 %9
  store i8 1, ptr %26, align 4, !tbaa !9
  br label %pred.store.continue38

pred.store.continue38:                            ; preds = %pred.store.if37, %pred.store.continue36
  %27 = extractelement <4 x i1> %13, i64 1
  br i1 %27, label %pred.store.if39, label %pred.store.continue40

pred.store.if39:                                  ; preds = %pred.store.continue38
  %28 = or disjoint i64 %index, 5
  %29 = getelementptr inbounds [70 x i8], ptr @st, i64 0, i64 %28
  store i8 1, ptr %29, align 1, !tbaa !9
  br label %pred.store.continue40

pred.store.continue40:                            ; preds = %pred.store.if39, %pred.store.continue38
  %30 = extractelement <4 x i1> %13, i64 2
  br i1 %30, label %pred.store.if41, label %pred.store.continue42

pred.store.if41:                                  ; preds = %pred.store.continue40
  %31 = or disjoint i64 %index, 6
  %32 = getelementptr inbounds [70 x i8], ptr @st, i64 0, i64 %31
  store i8 1, ptr %32, align 2, !tbaa !9
  br label %pred.store.continue42

pred.store.continue42:                            ; preds = %pred.store.if41, %pred.store.continue40
  %33 = extractelement <4 x i1> %13, i64 3
  br i1 %33, label %pred.store.if43, label %pred.store.continue44

pred.store.if43:                                  ; preds = %pred.store.continue42
  %34 = or disjoint i64 %index, 7
  %35 = getelementptr inbounds [70 x i8], ptr @st, i64 0, i64 %34
  store i8 1, ptr %35, align 1, !tbaa !9
  br label %pred.store.continue44

pred.store.continue44:                            ; preds = %pred.store.if43, %pred.store.continue42
  %index.next = add nuw i64 %index, 8
  %36 = icmp eq i64 %index.next, %n.vec
  br i1 %36, label %middle.block, label %vector.body, !llvm.loop !11

middle.block:                                     ; preds = %pred.store.continue44
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  br i1 %cmp.n, label %.preheader, label %.lr.ph16.preheader45

.lr.ph:                                           ; preds = %.lr.ph19, %46
  %indvars.iv = phi i64 [ %indvars.iv.next, %46 ], [ 0, %.lr.ph19 ]
  %37 = getelementptr inbounds [70 x i32], ptr @sticks, i64 0, i64 %indvars.iv
  %38 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %37)
  %39 = load i32, ptr %37, align 4, !tbaa !5
  %40 = icmp sgt i32 %39, 50
  br i1 %40, label %46, label %41

41:                                               ; preds = %.lr.ph
  %42 = load i32, ptr @sum, align 4, !tbaa !5
  %43 = add nsw i32 %42, %39
  store i32 %43, ptr @sum, align 4, !tbaa !5
  %44 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @length, ptr noundef nonnull align 4 dereferenceable(4) %37)
  %45 = load i32, ptr %44, align 4, !tbaa !5
  store i32 %45, ptr @length, align 4, !tbaa !5
  br label %46

46:                                               ; preds = %.lr.ph, %41
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %47 = load i32, ptr @n, align 4, !tbaa !5
  %48 = sext i32 %47 to i64
  %49 = icmp slt i64 %indvars.iv.next, %48
  br i1 %49, label %.lr.ph, label %._crit_edge, !llvm.loop !15

.preheader:                                       ; preds = %55, %middle.block, %._crit_edge
  %.pre26 = load i32, ptr @sum, align 4, !tbaa !5
  %.pre27 = load i32, ptr @length, align 4, !tbaa !5
  br label %56

.lr.ph16:                                         ; preds = %.lr.ph16.preheader45, %55
  %indvars.iv23 = phi i64 [ %indvars.iv.next24, %55 ], [ %indvars.iv23.ph, %.lr.ph16.preheader45 ]
  %50 = getelementptr inbounds [70 x i32], ptr @sticks, i64 0, i64 %indvars.iv23
  %51 = load i32, ptr %50, align 4, !tbaa !5
  %52 = icmp sgt i32 %51, 50
  br i1 %52, label %53, label %55

53:                                               ; preds = %.lr.ph16
  %54 = getelementptr inbounds [70 x i8], ptr @st, i64 0, i64 %indvars.iv23
  store i8 1, ptr %54, align 1, !tbaa !9
  br label %55

55:                                               ; preds = %.lr.ph16, %53
  %indvars.iv.next24 = add nuw nsw i64 %indvars.iv23, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next24, %wide.trip.count
  br i1 %exitcond.not, label %.preheader, label %.lr.ph16, !llvm.loop !16

56:                                               ; preds = %.preheader, %68
  %57 = phi i32 [ %.pre27, %.preheader ], [ %71, %68 ]
  %58 = phi i32 [ %.pre26, %.preheader ], [ %70, %68 ]
  %59 = srem i32 %58, %57
  %60 = icmp eq i32 %59, 0
  br i1 %60, label %61, label %68

61:                                               ; preds = %56
  %62 = call noundef zeroext i1 @_Z3dfsiii(i32 noundef 0, i32 noundef 0, i32 noundef 0)
  %.pre = load i32, ptr @sum, align 4, !tbaa !5
  %.pre28 = load i32, ptr @length, align 4, !tbaa !5
  br i1 %62, label %63, label %68

63:                                               ; preds = %61
  %64 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %.pre28)
  %65 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %64, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %66 = 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)
  %67 = load i32, ptr @n, align 4, !tbaa !5
  %.not = icmp eq i32 %67, 0
  br i1 %.not, label %._crit_edge20, label %.lr.ph19, !llvm.loop !17

68:                                               ; preds = %61, %56
  %69 = phi i32 [ %.pre28, %61 ], [ %57, %56 ]
  %70 = phi i32 [ %.pre, %61 ], [ %58, %56 ]
  %71 = add nsw i32 %69, 1
  store i32 %71, ptr @length, align 4, !tbaa !5
  br label %56, !llvm.loop !18

._crit_edge20:                                    ; preds = %63, %0
  ret i32 0
}

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4fillIPbbEvT_S1_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #4

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPiSt7greaterIiEEvT_S3_T0_(ptr noundef, ptr noundef) 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 #3

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

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

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"bool", !7, i64 0}
!11 = distinct !{!11, !12, !13, !14}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!"llvm.loop.isvectorized", i32 1}
!14 = !{!"llvm.loop.unroll.runtime.disable"}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12, !14, !13}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}


; Effective O3 passes: BDCEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,SROAPass,SimplifyCFGPass,TailCallElimPass