; LLVM IR from bqi343/cp-notebook :: Contests/USACO Training/Ch 5/5.3 schlnet.ll (Z2f2i)

; 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"

@posi = external dso_local global [101 x [101 x i8]], align 16
@d2 = external dso_local global [101 x i8], align 16
@N = external dso_local global i32, align 4
@co = external dso_local global [101 x i32], align 16
@B = external dso_local global [101 x i32], align 16

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

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_Z2f2i(i32 noundef %0) #1 {
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  store i32 %0, ptr %2, align 4, !tbaa !5
  %8 = load i32, ptr %2, align 4, !tbaa !5
  %9 = sext i32 %8 to i64
  %10 = getelementptr inbounds [101 x i8], ptr @d2, i64 0, i64 %9
  %11 = load i8, ptr %10, align 1, !tbaa !9, !range !11, !noundef !12
  %12 = trunc i8 %11 to i1
  br i1 %12, label %13, label %14

13:                                               ; preds = %1
  br label %119

14:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #2
  store i32 0, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #2
  store i32 1, ptr %4, align 4, !tbaa !5
  br label %15

15:                                               ; preds = %34, %14
  %16 = load i32, ptr %4, align 4, !tbaa !5
  %17 = load i32, ptr @N, align 4, !tbaa !5
  %18 = add nsw i32 %17, 1
  %19 = icmp slt i32 %16, %18
  br i1 %19, label %21, label %20

20:                                               ; preds = %15
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #2
  br label %37

21:                                               ; preds = %15
  %22 = load i32, ptr %2, align 4, !tbaa !5
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds [101 x [101 x i8]], ptr @posi, i64 0, i64 %23
  %25 = load i32, ptr %4, align 4, !tbaa !5
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds [101 x i8], ptr %24, i64 0, i64 %26
  %28 = load i8, ptr %27, align 1, !tbaa !9, !range !11, !noundef !12
  %29 = trunc i8 %28 to i1
  br i1 %29, label %30, label %33

30:                                               ; preds = %21
  %31 = load i32, ptr %3, align 4, !tbaa !5
  %32 = add nsw i32 %31, 1
  store i32 %32, ptr %3, align 4, !tbaa !5
  br label %33

33:                                               ; preds = %30, %21
  br label %34

34:                                               ; preds = %33
  %35 = load i32, ptr %4, align 4, !tbaa !5
  %36 = add nsw i32 %35, 1
  store i32 %36, ptr %4, align 4, !tbaa !5
  br label %15, !llvm.loop !13

37:                                               ; preds = %20
  %38 = load i32, ptr %3, align 4, !tbaa !5
  %39 = load i32, ptr @N, align 4, !tbaa !5
  %40 = icmp eq i32 %38, %39
  br i1 %40, label %41, label %45

41:                                               ; preds = %37
  %42 = load i32, ptr %2, align 4, !tbaa !5
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds [101 x i8], ptr @d2, i64 0, i64 %43
  store i8 1, ptr %44, align 1, !tbaa !9
  store i32 1, ptr %5, align 4
  br label %117

45:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #2
  store i32 1, ptr %6, align 4, !tbaa !5
  br label %46

46:                                               ; preds = %79, %45
  %47 = load i32, ptr %6, align 4, !tbaa !5
  %48 = load i32, ptr @N, align 4, !tbaa !5
  %49 = add nsw i32 %48, 1
  %50 = icmp slt i32 %47, %49
  br i1 %50, label %52, label %51

51:                                               ; preds = %46
  store i32 5, ptr %5, align 4
  br label %82

52:                                               ; preds = %46
  %53 = load i32, ptr %6, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [101 x [101 x i8]], ptr @posi, i64 0, i64 %54
  %56 = load i32, ptr %2, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds [101 x i8], ptr %55, i64 0, i64 %57
  %59 = load i8, ptr %58, align 1, !tbaa !9, !range !11, !noundef !12
  %60 = trunc i8 %59 to i1
  %61 = zext i1 %60 to i32
  %62 = icmp eq i32 %61, 0
  br i1 %62, label %63, label %78

63:                                               ; preds = %52
  %64 = load i32, ptr %2, align 4, !tbaa !5
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [101 x [101 x i8]], ptr @posi, i64 0, i64 %65
  %67 = load i32, ptr %6, align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [101 x i8], ptr %66, i64 0, i64 %68
  %70 = load i8, ptr %69, align 1, !tbaa !9, !range !11, !noundef !12
  %71 = trunc i8 %70 to i1
  %72 = zext i1 %71 to i32
  %73 = icmp eq i32 %72, 1
  br i1 %73, label %74, label %78

74:                                               ; preds = %63
  %75 = load i32, ptr %2, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [101 x i8], ptr @d2, i64 0, i64 %76
  store i8 1, ptr %77, align 1, !tbaa !9
  store i32 1, ptr %5, align 4
  br label %82

78:                                               ; preds = %63, %52
  br label %79

79:                                               ; preds = %78
  %80 = load i32, ptr %6, align 4, !tbaa !5
  %81 = add nsw i32 %80, 1
  store i32 %81, ptr %6, align 4, !tbaa !5
  br label %46, !llvm.loop !15

82:                                               ; preds = %74, %51
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #2
  %83 = load i32, ptr %5, align 4
  switch i32 %83, label %117 [
    i32 5, label %84
  ]

84:                                               ; preds = %82
  %85 = load i32, ptr %2, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [101 x i32], ptr @co, i64 0, i64 %86
  %88 = load i32, ptr %87, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [101 x i32], ptr @B, i64 0, i64 %89
  %91 = load i32, ptr %90, align 4, !tbaa !5
  %92 = add nsw i32 %91, 1
  store i32 %92, ptr %90, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #2
  store i32 1, ptr %7, align 4, !tbaa !5
  br label %93

93:                                               ; preds = %113, %84
  %94 = load i32, ptr %7, align 4, !tbaa !5
  %95 = load i32, ptr @N, align 4, !tbaa !5
  %96 = add nsw i32 %95, 1
  %97 = icmp slt i32 %94, %96
  br i1 %97, label %99, label %98

98:                                               ; preds = %93
  store i32 8, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #2
  br label %116

99:                                               ; preds = %93
  %100 = load i32, ptr %2, align 4, !tbaa !5
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [101 x [101 x i8]], ptr @posi, i64 0, i64 %101
  %103 = load i32, ptr %7, align 4, !tbaa !5
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [101 x i8], ptr %102, i64 0, i64 %104
  %106 = load i8, ptr %105, align 1, !tbaa !9, !range !11, !noundef !12
  %107 = trunc i8 %106 to i1
  br i1 %107, label %108, label %112

108:                                              ; preds = %99
  %109 = load i32, ptr %7, align 4, !tbaa !5
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [101 x i8], ptr @d2, i64 0, i64 %110
  store i8 1, ptr %111, align 1, !tbaa !9
  br label %112

112:                                              ; preds = %108, %99
  br label %113

113:                                              ; preds = %112
  %114 = load i32, ptr %7, align 4, !tbaa !5
  %115 = add nsw i32 %114, 1
  store i32 %115, ptr %7, align 4, !tbaa !5
  br label %93, !llvm.loop !16

116:                                              ; preds = %98
  store i32 0, ptr %5, align 4
  br label %117

117:                                              ; preds = %116, %82, %41
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #2
  %118 = load i32, ptr %5, align 4
  switch i32 %118, label %120 [
    i32 0, label %119
    i32 1, label %119
  ]

119:                                              ; preds = %117, %117, %13
  ret void

120:                                              ; preds = %117
  unreachable
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 = !{i8 0, i8 2}
!12 = !{}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}


; 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"

@posi = external dso_local local_unnamed_addr global [101 x [101 x i8]], align 16
@d2 = external dso_local local_unnamed_addr global [101 x i8], align 16
@N = external dso_local local_unnamed_addr global i32, align 4
@co = external dso_local local_unnamed_addr global [101 x i32], align 16
@B = external dso_local local_unnamed_addr global [101 x i32], align 16

; Function Attrs: mustprogress nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @_Z2f2i(i32 noundef %0) local_unnamed_addr #0 {
  %2 = sext i32 %0 to i64
  %3 = getelementptr inbounds [101 x i8], ptr @d2, i64 0, i64 %2
  %4 = load i8, ptr %3, align 1, !tbaa !5, !range !9, !noundef !10
  %5 = trunc nuw i8 %4 to i1
  br i1 %5, label %.loopexit, label %.preheader28

.preheader28:                                     ; preds = %1
  %6 = load i32, ptr @N, align 4, !tbaa !11
  %.not29 = icmp slt i32 %6, 1
  br i1 %.not29, label %._crit_edge.thread, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %.preheader28
  %7 = add nuw i32 %6, 1
  %wide.trip.count = zext i32 %7 to i64
  %8 = zext nneg i32 %6 to i64
  %min.iters.check = icmp ult i32 %6, 8
  br i1 %min.iters.check, label %.lr.ph.preheader156, label %vector.ph

.lr.ph.preheader156:                              ; preds = %middle.block, %.lr.ph.preheader
  %indvars.iv.ph = phi i64 [ 1, %.lr.ph.preheader ], [ %ind.end, %middle.block ]
  %.02530.ph = phi i32 [ 0, %.lr.ph.preheader ], [ %16, %middle.block ]
  br label %.lr.ph

vector.ph:                                        ; preds = %.lr.ph.preheader
  %n.vec = and i64 %8, 2147483640
  %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 ], [ %13, %vector.body ]
  %vec.phi51 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %14, %vector.body ]
  %offset.idx = or disjoint i64 %index, 1
  %9 = getelementptr inbounds [101 x [101 x i8]], ptr @posi, i64 0, i64 %2, i64 %offset.idx
  %10 = getelementptr inbounds i8, ptr %9, i64 4
  %wide.load = load <4 x i8>, ptr %9, align 1, !tbaa !5
  %wide.load52 = load <4 x i8>, ptr %10, align 1, !tbaa !5
  %11 = zext <4 x i8> %wide.load to <4 x i32>
  %12 = zext <4 x i8> %wide.load52 to <4 x i32>
  %13 = add <4 x i32> %vec.phi, %11
  %14 = add <4 x i32> %vec.phi51, %12
  %index.next = add nuw i64 %index, 8
  %15 = icmp eq i64 %index.next, %n.vec
  br i1 %15, label %middle.block, label %vector.body, !llvm.loop !13

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <4 x i32> %14, %13
  %16 = tail call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
  %cmp.n = icmp eq i64 %n.vec, %8
  br i1 %cmp.n, label %._crit_edge, label %.lr.ph.preheader156

._crit_edge:                                      ; preds = %.lr.ph, %middle.block
  %spec.select.lcssa = phi i32 [ %16, %middle.block ], [ %spec.select, %.lr.ph ]
  %17 = icmp eq i32 %spec.select.lcssa, %6
  br i1 %17, label %23, label %.preheader

._crit_edge.thread:                               ; preds = %.preheader28
  %18 = icmp eq i32 %6, 0
  br i1 %18, label %23, label %.critedge.thread

.preheader:                                       ; preds = %._crit_edge
  br i1 %.not29, label %.critedge.thread, label %.lr.ph35.preheader

.lr.ph35.preheader:                               ; preds = %.preheader
  %19 = add nuw i32 %6, 1
  %wide.trip.count43 = zext i32 %19 to i64
  br label %.lr.ph35

.lr.ph:                                           ; preds = %.lr.ph.preheader156, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ %indvars.iv.ph, %.lr.ph.preheader156 ]
  %.02530 = phi i32 [ %spec.select, %.lr.ph ], [ %.02530.ph, %.lr.ph.preheader156 ]
  %20 = getelementptr inbounds [101 x [101 x i8]], ptr @posi, i64 0, i64 %2, i64 %indvars.iv
  %21 = load i8, ptr %20, align 1, !tbaa !5, !range !9, !noundef !10
  %22 = zext nneg i8 %21 to i32
  %spec.select = add nuw nsw i32 %.02530, %22
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !17

23:                                               ; preds = %._crit_edge.thread, %._crit_edge
  store i8 1, ptr %3, align 1, !tbaa !5
  br label %.loopexit

.lr.ph35:                                         ; preds = %.lr.ph35.preheader, %32
  %indvars.iv40 = phi i64 [ 1, %.lr.ph35.preheader ], [ %indvars.iv.next41, %32 ]
  %24 = getelementptr inbounds [101 x [101 x i8]], ptr @posi, i64 0, i64 %indvars.iv40, i64 %2
  %25 = load i8, ptr %24, align 1, !tbaa !5, !range !9, !noundef !10
  %26 = icmp eq i8 %25, 0
  br i1 %26, label %27, label %32

27:                                               ; preds = %.lr.ph35
  %28 = getelementptr inbounds [101 x [101 x i8]], ptr @posi, i64 0, i64 %2, i64 %indvars.iv40
  %29 = load i8, ptr %28, align 1, !tbaa !5, !range !9, !noundef !10
  %30 = trunc nuw i8 %29 to i1
  br i1 %30, label %31, label %32

31:                                               ; preds = %27
  store i8 1, ptr %3, align 1, !tbaa !5
  br label %.loopexit

32:                                               ; preds = %.lr.ph35, %27
  %indvars.iv.next41 = add nuw nsw i64 %indvars.iv40, 1
  %exitcond44.not = icmp eq i64 %indvars.iv.next41, %wide.trip.count43
  br i1 %exitcond44.not, label %.critedge, label %.lr.ph35, !llvm.loop !18

.critedge.thread:                                 ; preds = %.preheader, %._crit_edge.thread
  %33 = getelementptr inbounds [101 x i32], ptr @co, i64 0, i64 %2
  %34 = load i32, ptr %33, align 4, !tbaa !11
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [101 x i32], ptr @B, i64 0, i64 %35
  %37 = load i32, ptr %36, align 4, !tbaa !11
  %38 = add nsw i32 %37, 1
  store i32 %38, ptr %36, align 4, !tbaa !11
  br label %.loopexit

.critedge:                                        ; preds = %32
  %39 = getelementptr inbounds [101 x i32], ptr @co, i64 0, i64 %2
  %40 = load i32, ptr %39, align 4, !tbaa !11
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [101 x i32], ptr @B, i64 0, i64 %41
  %43 = load i32, ptr %42, align 4, !tbaa !11
  %44 = add nsw i32 %43, 1
  store i32 %44, ptr %42, align 4, !tbaa !11
  br i1 %.not29, label %.loopexit, label %iter.check

iter.check:                                       ; preds = %.critedge
  %45 = add nuw i32 %6, 1
  %wide.trip.count48 = zext i32 %45 to i64
  %46 = zext nneg i32 %6 to i64
  %min.iters.check55 = icmp ult i32 %6, 8
  br i1 %min.iters.check55, label %.lr.ph38.preheader, label %vector.main.loop.iter.check

vector.main.loop.iter.check:                      ; preds = %iter.check
  %min.iters.check57 = icmp ult i32 %6, 32
  br i1 %min.iters.check57, label %vec.epilog.ph, label %vector.ph58

vector.ph58:                                      ; preds = %vector.main.loop.iter.check
  %n.vec60 = and i64 %46, 2147483616
  br label %vector.body61

vector.body61:                                    ; preds = %pred.store.continue127, %vector.ph58
  %index62 = phi i64 [ 0, %vector.ph58 ], [ %index.next128, %pred.store.continue127 ]
  %offset.idx63 = or disjoint i64 %index62, 1
  %47 = or disjoint i64 %index62, 17
  %48 = getelementptr inbounds [101 x [101 x i8]], ptr @posi, i64 0, i64 %2, i64 %offset.idx63
  %49 = getelementptr inbounds i8, ptr %48, i64 16
  %wide.load64 = load <16 x i8>, ptr %48, align 1, !tbaa !5
  %wide.load65 = load <16 x i8>, ptr %49, align 1, !tbaa !5
  %50 = trunc <16 x i8> %wide.load64 to <16 x i1>
  %51 = trunc <16 x i8> %wide.load65 to <16 x i1>
  %52 = extractelement <16 x i1> %50, i64 0
  br i1 %52, label %pred.store.if, label %pred.store.continue

pred.store.if:                                    ; preds = %vector.body61
  %53 = getelementptr inbounds [101 x i8], ptr @d2, i64 0, i64 %offset.idx63
  store i8 1, ptr %53, align 1, !tbaa !5
  br label %pred.store.continue

pred.store.continue:                              ; preds = %pred.store.if, %vector.body61
  %54 = extractelement <16 x i1> %50, i64 1
  br i1 %54, label %pred.store.if66, label %pred.store.continue67

pred.store.if66:                                  ; preds = %pred.store.continue
  %55 = or disjoint i64 %index62, 2
  %56 = getelementptr inbounds [101 x i8], ptr @d2, i64 0, i64 %55
  store i8 1, ptr %56, align 2, !tbaa !5
  br label %pred.store.continue67

pred.store.continue67:                            ; preds = %pred.store.if66, %pred.store.continue
  %57 = extractelement <16 x i1> %50, i64 2
  br i1 %57, label %pred.store.if68, label %pred.store.continue69

pred.store.if68:                                  ; preds = %pred.store.continue67
  %58 = or disjoint i64 %index62, 3
  %59 = getelementptr inbounds [101 x i8], ptr @d2, i64 0, i64 %58
  store i8 1, ptr %59, align 1, !tbaa !5
  br label %pred.store.continue69

pred.store.continue69:                            ; preds = %pred.store.if68, %pred.store.continue67
  %60 = extractelement <16 x i1> %50, i64 3
  br i1 %60, label %pred.store.if70, label %pred.store.continue71

pred.store.if70:                                  ; preds = %pred.store.continue69
  %61 = or disjoint i64 %index62, 4
  %62 = getelementptr inbounds [101 x i8], ptr @d2, i64 0, i64 %61
  store i8 1, ptr %62, align 4, !tbaa !5
  br label %pred.store.continue71

pred.store.continue71:                            ; preds = %pred.store.if70, %pred.store.continue69
  %63 = extractelement <16 x i1> %50, i64 4
  br i1 %63, label %pred.store.if72, label %pred.store.continue73

pred.store.if72:                                  ; preds = %pred.store.continue71
  %64 = or disjoint i64 %index62, 5
  %65 = getelementptr inbounds [101 x i8], ptr @d2, i64 0, i64 %64
  store i8 1, ptr %65, align 1, !tbaa !5
  br label %pred.store.continue73

pred.store.continue73:                            ; preds = %pred.store.if72, %pred.store.continue71
  %66 = extractelement <16 x i1> %50, i64 5
  br i1 %66, label %pred.store.if74, label %pred.store.continue75

pred.store.if74:                                  ; preds = %pred.store.continue73
  %67 = or disjoint i64 %index62, 6
  %68 = getelementptr inbounds [101 x i8], ptr @d2, i64 0, i64 %67
  store i8 1, ptr %68, align 2, !tbaa !5
  br label %pred.store.continue75

pred.store.continue75:                            ; preds = %pred.store.if74, %pred.store.continue73
  %69 = extractelement <16 x i1> %50, i64 6
  br i1 %69, label %pred.store.if76, label %pred.store.continue77

pred.store.if76:                                  ; preds = %pred.store.continue75
  %70 = or disjoint i64 %index62, 7
  %71 = getelementptr inbounds [101 x i8], ptr @d2, i64 0, i64 %70
  store i8 1, ptr %71, align 1, !tbaa !5
  br label %pred.store.continue77

pred.store.continue77:                            ; preds = %pred.store.if76, %pred.store.continue75
  %72 = extractelement <16 x i1> %50, i64 7
  br i1 %72, label %pred.store.if78, label %pred.store.continue79

pred.store.if78:                                  ; preds = %pred.store.continue77
  %73 = or disjoint i64 %index62, 8
  %74 = getelementptr inbounds [101 x i8], ptr @d2, i64 0, i64 %73
  store i8 1, ptr %74, align 8, !tbaa !5
  br label %pred.store.continue79

pred.store.continue79:                            ; preds = %pred.store.if78, %pred.store.continue77
  %75 = extractelement <16 x i1> %50, i64 8
  br i1 %75, label %pred.store.if80, label %pred.store.continue81

pred.store.if80:                                  ; preds = %pred.store.continue79
  %76 = or disjoint i64 %index62, 9
  %77 = getelementptr inbounds [101 x i8], ptr @d2, i64 0, i64 %76
  store i8 1, ptr %77, align 1, !tbaa !5
  br label %pred.store.continue81

pred.store.continue81:                            ; preds = %pred.store.if80, %pred.store.continue79
  %78 = extractelement <16 x i1> %50, i64 9
  br i1 %78, label %pred.store.if82, label %pred.store.continue83

pred.store.if82:                                  ; preds = %pred.store.continue81
  %79 = or disjoint i64 %index62, 10
  %80 = getelementptr inbounds [101 x i8], ptr @d2, i64 0, i64 %79
  store i8 1, ptr %80, align 2, !tbaa !5
  br label %pred.store.continue83

pred.store.continue83:                            ; preds = %pred.store.if82, %pred.store.continue81
  %81 = extractelement <16 x i1> %50, i64 10
  br i1 %81, label %pred.store.if84, label %pred.store.continue85

pred.store.if84:                                  ; preds = %pred.store.continue83
  %82 = or disjoint i64 %index62, 11
  %83 = getelementptr inbounds [101 x i8], ptr @d2, i64 0, i64 %82
  store i8 1, ptr %83, align 1, !tbaa !5
  br label %pred.store.continue85

pred.store.continue85:                            ; preds = %pred.store.if84, %pred.store.continue83
  %84 = extractelement <16 x i1> %50, i64 11
  br i1 %84, label %pred.store.if86, label %pred.store.continue87

pred.store.if86:                                  ; preds = %pred.store.continue85
  %85 = or disjoint i64 %index62, 12
  %86 = getelementptr inbounds [101 x i8], ptr @d2, i64 0, i64 %85
  store i8 1, ptr %86, align 4, !tbaa !5
  br label %pred.store.continue87

pred.store.continue87:                            ; preds = %pred.store.if86, %pred.store.continue85
  %87 = extractelement <16 x i1> %50, i64 12
  br i1 %87, label %pred.store.if88, label %pred.store.continue89

pred.store.if88:                                  ; preds = %pred.store.continue87
  %88 = or disjoint i64 %index62, 13
  %89 = getelementptr inbounds [101 x i8], ptr @d2, i64 0, i64 %88
  store i8 1, ptr %89, align 1, !tbaa !5
  br label %pred.store.continue89

pred.store.continue89:                            ; preds = %pred.store.if88, %pred.store.continue87
  %90 = extractelement <16 x i1> %50, i64 13
  br i1 %90, label %pred.store.if90, label %pred.store.continue91

pred.store.if90:                                  ; preds = %pred.store.continue89
  %91 = or disjoint i64 %index62, 14
  %92 = getelementptr inbounds [101 x i8], ptr @d2, i64 0, i64 %91
  store i8 1, ptr %92, align 2, !tbaa !5
  br label %pred.store.continue91

pred.store.continue91:                            ; preds = %pred.store.if90, %pred.store.continue89
  %93 = extractelement <16 x i1> %50, i64 14
  br i1 %93, label %pred.store.if92, label %pred.store.continue93

pred.store.if92:                                  ; preds = %pred.store.continue91
  %94 = or disjoint i64 %index62, 15
  %95 = getelementptr inbounds [101 x i8], ptr @d2, i64 0, i64 %94
  store i8 1, ptr %95, align 1, !tbaa !5
  br label %pred.store.continue93

pred.store.continue93:                            ; preds = %pred.store.if92, %pred.store.continue91
  %96 = extractelement <16 x i1> %50, i64 15
  br i1 %96, label %pred.store.if94, label %pred.store.continue95

pred.store.if94:                                  ; preds = %pred.store.continue93
  %97 = or disjoint i64 %index62, 16
  %98 = getelementptr inbounds [101 x i8], ptr @d2, i64 0, i64 %97
  store i8 1, ptr %98, align 16, !tbaa !5
  br label %pred.store.continue95

pred.store.continue95:                            ; preds = %pred.store.if94, %pred.store.continue93
  %99 = extractelement <16 x i1> %51, i64 0
  br i1 %99, label %pred.store.if96, label %pred.store.continue97

pred.store.if96:                                  ; preds = %pred.store.continue95
  %100 = getelementptr inbounds [101 x i8], ptr @d2, i64 0, i64 %47
  store i8 1, ptr %100, align 1, !tbaa !5
  br label %pred.store.continue97

pred.store.continue97:                            ; preds = %pred.store.if96, %pred.store.continue95
  %101 = extractelement <16 x i1> %51, i64 1
  br i1 %101, label %pred.store.if98, label %pred.store.continue99

pred.store.if98:                                  ; preds = %pred.store.continue97
  %102 = or disjoint i64 %index62, 18
  %103 = getelementptr inbounds [101 x i8], ptr @d2, i64 0, i64 %102
  store i8 1, ptr %103, align 2, !tbaa !5
  br label %pred.store.continue99

pred.store.continue99:                            ; preds = %pred.store.if98, %pred.store.continue97
  %104 = extractelement <16 x i1> %51, i64 2
  br i1 %104, label %pred.store.if100, label %pred.store.continue101

pred.store.if100:                                 ; preds = %pred.store.continue99
  %105 = or disjoint i64 %index62, 19
  %106 = getelementptr inbounds [101 x i8], ptr @d2, i64 0, i64 %105
  store i8 1, ptr %106, align 1, !tbaa !5
  br label %pred.store.continue101

pred.store.continue101:                           ; preds = %pred.store.if100, %pred.store.continue99
  %107 = extractelement <16 x i1> %51, i64 3
  br i1 %107, label %pred.store.if102, label %pred.store.continue103

pred.store.if102:                                 ; preds = %pred.store.continue101
  %108 = or disjoint i64 %index62, 20
  %109 = getelementptr inbounds [101 x i8], ptr @d2, i64 0, i64 %108
  store i8 1, ptr %109, align 4, !tbaa !5
  br label %pred.store.continue103

pred.store.continue103:                           ; preds = %pred.store.if102, %pred.store.continue101
  %110 = extractelement <16 x i1> %51, i64 4
  br i1 %110, label %pred.store.if104, label %pred.store.continue105

pred.store.if104:                                 ; preds = %pred.store.continue103
  %111 = or disjoint i64 %index62, 21
  %112 = getelementptr inbounds [101 x i8], ptr @d2, i64 0, i64 %111
  store i8 1, ptr %112, align 1, !tbaa !5
  br label %pred.store.continue105

pred.store.continue105:                           ; preds = %pred.store.if104, %pred.store.continue103
  %113 = extractelement <16 x i1> %51, i64 5
  br i1 %113, label %pred.store.if106, label %pred.store.continue107

pred.store.if106:                                 ; preds = %pred.store.continue105
  %114 = or disjoint i64 %index62, 22
  %115 = getelementptr inbounds [101 x i8], ptr @d2, i64 0, i64 %114
  store i8 1, ptr %115, align 2, !tbaa !5
  br label %pred.store.continue107

pred.store.continue107:                           ; preds = %pred.store.if106, %pred.store.continue105
  %116 = extractelement <16 x i1> %51, i64 6
  br i1 %116, label %pred.store.if108, label %pred.store.continue109

pred.store.if108:                                 ; preds = %pred.store.continue107
  %117 = or disjoint i64 %index62, 23
  %118 = getelementptr inbounds [101 x i8], ptr @d2, i64 0, i64 %117
  store i8 1, ptr %118, align 1, !tbaa !5
  br label %pred.store.continue109

pred.store.continue109:                           ; preds = %pred.store.if108, %pred.store.continue107
  %119 = extractelement <16 x i1> %51, i64 7
  br i1 %119, label %pred.store.if110, label %pred.store.continue111

pred.store.if110:                                 ; preds = %pred.store.continue109
  %120 = or disjoint i64 %index62, 24
  %121 = getelementptr inbounds [101 x i8], ptr @d2, i64 0, i64 %120
  store i8 1, ptr %121, align 8, !tbaa !5
  br label %pred.store.continue111

pred.store.continue111:                           ; preds = %pred.store.if110, %pred.store.continue109
  %122 = extractelement <16 x i1> %51, i64 8
  br i1 %122, label %pred.store.if112, label %pred.store.continue113

pred.store.if112:                                 ; preds = %pred.store.continue111
  %123 = or disjoint i64 %index62, 25
  %124 = getelementptr inbounds [101 x i8], ptr @d2, i64 0, i64 %123
  store i8 1, ptr %124, align 1, !tbaa !5
  br label %pred.store.continue113

pred.store.continue113:                           ; preds = %pred.store.if112, %pred.store.continue111
  %125 = extractelement <16 x i1> %51, i64 9
  br i1 %125, label %pred.store.if114, label %pred.store.continue115

pred.store.if114:                                 ; preds = %pred.store.continue113
  %126 = or disjoint i64 %index62, 26
  %127 = getelementptr inbounds [101 x i8], ptr @d2, i64 0, i64 %126
  store i8 1, ptr %127, align 2, !tbaa !5
  br label %pred.store.continue115

pred.store.continue115:                           ; preds = %pred.store.if114, %pred.store.continue113
  %128 = extractelement <16 x i1> %51, i64 10
  br i1 %128, label %pred.store.if116, label %pred.store.continue117

pred.store.if116:                                 ; preds = %pred.store.continue115
  %129 = or disjoint i64 %index62, 27
  %130 = getelementptr inbounds [101 x i8], ptr @d2, i64 0, i64 %129
  store i8 1, ptr %130, align 1, !tbaa !5
  br label %pred.store.continue117

pred.store.continue117:                           ; preds = %pred.store.if116, %pred.store.continue115
  %131 = extractelement <16 x i1> %51, i64 11
  br i1 %131, label %pred.store.if118, label %pred.store.continue119

pred.store.if118:                                 ; preds = %pred.store.continue117
  %132 = or disjoint i64 %index62, 28
  %133 = getelementptr inbounds [101 x i8], ptr @d2, i64 0, i64 %132
  store i8 1, ptr %133, align 4, !tbaa !5
  br label %pred.store.continue119

pred.store.continue119:                           ; preds = %pred.store.if118, %pred.store.continue117
  %134 = extractelement <16 x i1> %51, i64 12
  br i1 %134, label %pred.store.if120, label %pred.store.continue121

pred.store.if120:                                 ; preds = %pred.store.continue119
  %135 = or disjoint i64 %index62, 29
  %136 = getelementptr inbounds [101 x i8], ptr @d2, i64 0, i64 %135
  store i8 1, ptr %136, align 1, !tbaa !5
  br label %pred.store.continue121

pred.store.continue121:                           ; preds = %pred.store.if120, %pred.store.continue119
  %137 = extractelement <16 x i1> %51, i64 13
  br i1 %137, label %pred.store.if122, label %pred.store.continue123

pred.store.if122:                                 ; preds = %pred.store.continue121
  %138 = or disjoint i64 %index62, 30
  %139 = getelementptr inbounds [101 x i8], ptr @d2, i64 0, i64 %138
  store i8 1, ptr %139, align 2, !tbaa !5
  br label %pred.store.continue123

pred.store.continue123:                           ; preds = %pred.store.if122, %pred.store.continue121
  %140 = extractelement <16 x i1> %51, i64 14
  br i1 %140, label %pred.store.if124, label %pred.store.continue125

pred.store.if124:                                 ; preds = %pred.store.continue123
  %141 = or disjoint i64 %index62, 31
  %142 = getelementptr inbounds [101 x i8], ptr @d2, i64 0, i64 %141
  store i8 1, ptr %142, align 1, !tbaa !5
  br label %pred.store.continue125

pred.store.continue125:                           ; preds = %pred.store.if124, %pred.store.continue123
  %143 = extractelement <16 x i1> %51, i64 15
  br i1 %143, label %pred.store.if126, label %pred.store.continue127

pred.store.if126:                                 ; preds = %pred.store.continue125
  %144 = add i64 %index62, 32
  %145 = getelementptr inbounds [101 x i8], ptr @d2, i64 0, i64 %144
  store i8 1, ptr %145, align 16, !tbaa !5
  br label %pred.store.continue127

pred.store.continue127:                           ; preds = %pred.store.if126, %pred.store.continue125
  %index.next128 = add nuw i64 %index62, 32
  %146 = icmp eq i64 %index.next128, %n.vec60
  br i1 %146, label %middle.block53, label %vector.body61, !llvm.loop !19

middle.block53:                                   ; preds = %pred.store.continue127
  %cmp.n129 = icmp eq i64 %n.vec60, %46
  br i1 %cmp.n129, label %.loopexit, label %vec.epilog.iter.check

vec.epilog.iter.check:                            ; preds = %middle.block53
  %ind.end133 = or disjoint i64 %n.vec60, 1
  %n.vec.remaining = and i64 %46, 24
  %min.epilog.iters.check = icmp eq i64 %n.vec.remaining, 0
  br i1 %min.epilog.iters.check, label %.lr.ph38.preheader, label %vec.epilog.ph

vec.epilog.ph:                                    ; preds = %vector.main.loop.iter.check, %vec.epilog.iter.check
  %vec.epilog.resume.val = phi i64 [ %n.vec60, %vec.epilog.iter.check ], [ 0, %vector.main.loop.iter.check ]
  %n.vec131 = and i64 %46, 2147483640
  %ind.end132 = or disjoint i64 %n.vec131, 1
  br label %vec.epilog.vector.body

vec.epilog.vector.body:                           ; preds = %pred.store.continue153, %vec.epilog.ph
  %index135 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next154, %pred.store.continue153 ]
  %offset.idx136 = or disjoint i64 %index135, 1
  %147 = getelementptr inbounds [101 x [101 x i8]], ptr @posi, i64 0, i64 %2, i64 %offset.idx136
  %wide.load137 = load <8 x i8>, ptr %147, align 1, !tbaa !5
  %148 = trunc <8 x i8> %wide.load137 to <8 x i1>
  %149 = extractelement <8 x i1> %148, i64 0
  br i1 %149, label %pred.store.if138, label %pred.store.continue139

pred.store.if138:                                 ; preds = %vec.epilog.vector.body
  %150 = getelementptr inbounds [101 x i8], ptr @d2, i64 0, i64 %offset.idx136
  store i8 1, ptr %150, align 1, !tbaa !5
  br label %pred.store.continue139

pred.store.continue139:                           ; preds = %pred.store.if138, %vec.epilog.vector.body
  %151 = extractelement <8 x i1> %148, i64 1
  br i1 %151, label %pred.store.if140, label %pred.store.continue141

pred.store.if140:                                 ; preds = %pred.store.continue139
  %152 = or disjoint i64 %index135, 2
  %153 = getelementptr inbounds [101 x i8], ptr @d2, i64 0, i64 %152
  store i8 1, ptr %153, align 2, !tbaa !5
  br label %pred.store.continue141

pred.store.continue141:                           ; preds = %pred.store.if140, %pred.store.continue139
  %154 = extractelement <8 x i1> %148, i64 2
  br i1 %154, label %pred.store.if142, label %pred.store.continue143

pred.store.if142:                                 ; preds = %pred.store.continue141
  %155 = or disjoint i64 %index135, 3
  %156 = getelementptr inbounds [101 x i8], ptr @d2, i64 0, i64 %155
  store i8 1, ptr %156, align 1, !tbaa !5
  br label %pred.store.continue143

pred.store.continue143:                           ; preds = %pred.store.if142, %pred.store.continue141
  %157 = extractelement <8 x i1> %148, i64 3
  br i1 %157, label %pred.store.if144, label %pred.store.continue145

pred.store.if144:                                 ; preds = %pred.store.continue143
  %158 = or disjoint i64 %index135, 4
  %159 = getelementptr inbounds [101 x i8], ptr @d2, i64 0, i64 %158
  store i8 1, ptr %159, align 4, !tbaa !5
  br label %pred.store.continue145

pred.store.continue145:                           ; preds = %pred.store.if144, %pred.store.continue143
  %160 = extractelement <8 x i1> %148, i64 4
  br i1 %160, label %pred.store.if146, label %pred.store.continue147

pred.store.if146:                                 ; preds = %pred.store.continue145
  %161 = or disjoint i64 %index135, 5
  %162 = getelementptr inbounds [101 x i8], ptr @d2, i64 0, i64 %161
  store i8 1, ptr %162, align 1, !tbaa !5
  br label %pred.store.continue147

pred.store.continue147:                           ; preds = %pred.store.if146, %pred.store.continue145
  %163 = extractelement <8 x i1> %148, i64 5
  br i1 %163, label %pred.store.if148, label %pred.store.continue149

pred.store.if148:                                 ; preds = %pred.store.continue147
  %164 = or disjoint i64 %index135, 6
  %165 = getelementptr inbounds [101 x i8], ptr @d2, i64 0, i64 %164
  store i8 1, ptr %165, align 2, !tbaa !5
  br label %pred.store.continue149

pred.store.continue149:                           ; preds = %pred.store.if148, %pred.store.continue147
  %166 = extractelement <8 x i1> %148, i64 6
  br i1 %166, label %pred.store.if150, label %pred.store.continue151

pred.store.if150:                                 ; preds = %pred.store.continue149
  %167 = or disjoint i64 %index135, 7
  %168 = getelementptr inbounds [101 x i8], ptr @d2, i64 0, i64 %167
  store i8 1, ptr %168, align 1, !tbaa !5
  br label %pred.store.continue151

pred.store.continue151:                           ; preds = %pred.store.if150, %pred.store.continue149
  %169 = extractelement <8 x i1> %148, i64 7
  br i1 %169, label %pred.store.if152, label %pred.store.continue153

pred.store.if152:                                 ; preds = %pred.store.continue151
  %170 = add i64 %index135, 8
  %171 = getelementptr inbounds [101 x i8], ptr @d2, i64 0, i64 %170
  store i8 1, ptr %171, align 8, !tbaa !5
  br label %pred.store.continue153

pred.store.continue153:                           ; preds = %pred.store.if152, %pred.store.continue151
  %index.next154 = add nuw i64 %index135, 8
  %172 = icmp eq i64 %index.next154, %n.vec131
  br i1 %172, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !20

vec.epilog.middle.block:                          ; preds = %pred.store.continue153
  %cmp.n155 = icmp eq i64 %n.vec131, %46
  br i1 %cmp.n155, label %.loopexit, label %.lr.ph38.preheader

.lr.ph38.preheader:                               ; preds = %vec.epilog.middle.block, %iter.check, %vec.epilog.iter.check
  %indvars.iv45.ph = phi i64 [ 1, %iter.check ], [ %ind.end133, %vec.epilog.iter.check ], [ %ind.end132, %vec.epilog.middle.block ]
  br label %.lr.ph38

.lr.ph38:                                         ; preds = %.lr.ph38.preheader, %178
  %indvars.iv45 = phi i64 [ %indvars.iv.next46, %178 ], [ %indvars.iv45.ph, %.lr.ph38.preheader ]
  %173 = getelementptr inbounds [101 x [101 x i8]], ptr @posi, i64 0, i64 %2, i64 %indvars.iv45
  %174 = load i8, ptr %173, align 1, !tbaa !5, !range !9, !noundef !10
  %175 = trunc nuw i8 %174 to i1
  br i1 %175, label %176, label %178

176:                                              ; preds = %.lr.ph38
  %177 = getelementptr inbounds [101 x i8], ptr @d2, i64 0, i64 %indvars.iv45
  store i8 1, ptr %177, align 1, !tbaa !5
  br label %178

178:                                              ; preds = %.lr.ph38, %176
  %indvars.iv.next46 = add nuw nsw i64 %indvars.iv45, 1
  %exitcond49.not = icmp eq i64 %indvars.iv.next46, %wide.trip.count48
  br i1 %exitcond49.not, label %.loopexit, label %.lr.ph38, !llvm.loop !21

.loopexit:                                        ; preds = %178, %middle.block53, %vec.epilog.middle.block, %.critedge.thread, %.critedge, %31, %23, %1
  ret void
}

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #1

attributes #0 = { mustprogress nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) 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 speculatable willreturn memory(none) }

!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 = !{!"bool", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{i8 0, i8 2}
!10 = !{}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = distinct !{!13, !14, !15, !16}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!"llvm.loop.isvectorized", i32 1}
!16 = !{!"llvm.loop.unroll.runtime.disable"}
!17 = distinct !{!17, !14, !16, !15}
!18 = distinct !{!18, !14}
!19 = distinct !{!19, !14, !15, !16}
!20 = distinct !{!20, !14, !15, !16}
!21 = distinct !{!21, !14, !16, !15}


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