; LLVM IR from codemistic/Data-Structures-and-Algorithms :: CPP/Dynamic Programming/Circular Palindromes.ll (Z8manacherv)

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

@n = external dso_local global i32, align 4
@s = external dso_local global [2000005 x i8], align 16
@go_odd = external dso_local global [2000005 x i32], align 16
@go_even = external dso_local global [2000005 x i32], align 16
@tmp = external dso_local global [4000010 x i32], align 16
@rad = external dso_local global [4000010 x i32], align 16

; Function Attrs: mustprogress uwtable
define dso_local void @_Z8manacherv() #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
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  call void @llvm.memset.p0.i64(ptr align 16 @tmp, i8 0, i64 16000040, i1 false)
  call void @llvm.memset.p0.i64(ptr align 16 @rad, i8 0, i64 16000040, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #4
  %11 = load i32, ptr @n, align 4, !tbaa !5
  %12 = mul nsw i32 %11, 2
  %13 = add nsw i32 %12, 1
  store i32 %13, ptr %1, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %14

14:                                               ; preds = %23, %0
  %15 = load i32, ptr %2, align 4, !tbaa !5
  %16 = load i32, ptr %1, align 4, !tbaa !5
  %17 = icmp slt i32 %15, %16
  br i1 %17, label %19, label %18

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

19:                                               ; preds = %14
  %20 = load i32, ptr %2, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds [4000010 x i32], ptr @tmp, i64 0, i64 %21
  store i32 35, ptr %22, align 4, !tbaa !5
  br label %23

23:                                               ; preds = %19
  %24 = load i32, ptr %2, align 4, !tbaa !5
  %25 = add nsw i32 %24, 1
  store i32 %25, ptr %2, align 4, !tbaa !5
  br label %14, !llvm.loop !9

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

27:                                               ; preds = %44, %26
  %28 = load i32, ptr %3, align 4, !tbaa !5
  %29 = load i32, ptr @n, align 4, !tbaa !5
  %30 = icmp slt i32 %28, %29
  br i1 %30, label %32, label %31

31:                                               ; preds = %27
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  br label %47

32:                                               ; preds = %27
  %33 = load i32, ptr %3, align 4, !tbaa !5
  %34 = add nsw i32 %33, 1
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [2000005 x i8], ptr @s, i64 0, i64 %35
  %37 = load i8, ptr %36, align 1, !tbaa !11
  %38 = sext i8 %37 to i32
  %39 = load i32, ptr %3, align 4, !tbaa !5
  %40 = mul nsw i32 %39, 2
  %41 = add nsw i32 %40, 1
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [4000010 x i32], ptr @tmp, i64 0, i64 %42
  store i32 %38, ptr %43, align 4, !tbaa !5
  br label %44

44:                                               ; preds = %32
  %45 = load i32, ptr %3, align 4, !tbaa !5
  %46 = add nsw i32 %45, 1
  store i32 %46, ptr %3, align 4, !tbaa !5
  br label %27, !llvm.loop !12

47:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  store i32 0, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %48

48:                                               ; preds = %116, %47
  %49 = load i32, ptr %4, align 4, !tbaa !5
  %50 = load i32, ptr %1, align 4, !tbaa !5
  %51 = icmp slt i32 %49, %50
  br i1 %51, label %52, label %125

52:                                               ; preds = %48
  br label %53

53:                                               ; preds = %80, %52
  %54 = load i32, ptr %4, align 4, !tbaa !5
  %55 = load i32, ptr %5, align 4, !tbaa !5
  %56 = sub nsw i32 %54, %55
  %57 = icmp sge i32 %56, 0
  br i1 %57, label %58, label %78

58:                                               ; preds = %53
  %59 = load i32, ptr %4, align 4, !tbaa !5
  %60 = load i32, ptr %5, align 4, !tbaa !5
  %61 = add nsw i32 %59, %60
  %62 = load i32, ptr %1, align 4, !tbaa !5
  %63 = icmp slt i32 %61, %62
  br i1 %63, label %64, label %78

64:                                               ; preds = %58
  %65 = load i32, ptr %4, align 4, !tbaa !5
  %66 = load i32, ptr %5, align 4, !tbaa !5
  %67 = sub nsw i32 %65, %66
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [4000010 x i32], ptr @tmp, i64 0, i64 %68
  %70 = load i32, ptr %69, align 4, !tbaa !5
  %71 = load i32, ptr %4, align 4, !tbaa !5
  %72 = load i32, ptr %5, align 4, !tbaa !5
  %73 = add nsw i32 %71, %72
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [4000010 x i32], ptr @tmp, i64 0, i64 %74
  %76 = load i32, ptr %75, align 4, !tbaa !5
  %77 = icmp eq i32 %70, %76
  br label %78

78:                                               ; preds = %64, %58, %53
  %79 = phi i1 [ false, %58 ], [ false, %53 ], [ %77, %64 ]
  br i1 %79, label %80, label %83

80:                                               ; preds = %78
  %81 = load i32, ptr %5, align 4, !tbaa !5
  %82 = add nsw i32 %81, 1
  store i32 %82, ptr %5, align 4, !tbaa !5
  br label %53, !llvm.loop !13

83:                                               ; preds = %78
  %84 = load i32, ptr %5, align 4, !tbaa !5
  %85 = load i32, ptr %4, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [4000010 x i32], ptr @rad, i64 0, i64 %86
  store i32 %84, ptr %87, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  store i32 1, ptr %6, align 4, !tbaa !5
  br label %88

88:                                               ; preds = %102, %83
  %89 = load i32, ptr %4, align 4, !tbaa !5
  %90 = load i32, ptr %6, align 4, !tbaa !5
  %91 = sub nsw i32 %89, %90
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [4000010 x i32], ptr @rad, i64 0, i64 %92
  %94 = load i32, ptr %93, align 4, !tbaa !5
  %95 = load i32, ptr %4, align 4, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [4000010 x i32], ptr @rad, i64 0, i64 %96
  %98 = load i32, ptr %97, align 4, !tbaa !5
  %99 = load i32, ptr %6, align 4, !tbaa !5
  %100 = sub nsw i32 %98, %99
  %101 = icmp slt i32 %94, %100
  br i1 %101, label %102, label %116

102:                                              ; preds = %88
  %103 = load i32, ptr %4, align 4, !tbaa !5
  %104 = load i32, ptr %6, align 4, !tbaa !5
  %105 = sub nsw i32 %103, %104
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [4000010 x i32], ptr @rad, i64 0, i64 %106
  %108 = load i32, ptr %107, align 4, !tbaa !5
  %109 = load i32, ptr %4, align 4, !tbaa !5
  %110 = load i32, ptr %6, align 4, !tbaa !5
  %111 = add nsw i32 %109, %110
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [4000010 x i32], ptr @rad, i64 0, i64 %112
  store i32 %108, ptr %113, align 4, !tbaa !5
  %114 = load i32, ptr %6, align 4, !tbaa !5
  %115 = add nsw i32 %114, 1
  store i32 %115, ptr %6, align 4, !tbaa !5
  br label %88, !llvm.loop !14

116:                                              ; preds = %88
  %117 = load i32, ptr %6, align 4, !tbaa !5
  %118 = load i32, ptr %4, align 4, !tbaa !5
  %119 = add nsw i32 %118, %117
  store i32 %119, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  store i32 0, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  %120 = load i32, ptr %5, align 4, !tbaa !5
  %121 = load i32, ptr %6, align 4, !tbaa !5
  %122 = sub nsw i32 %120, %121
  store i32 %122, ptr %8, align 4, !tbaa !5
  %123 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %8)
  %124 = load i32, ptr %123, align 4, !tbaa !5
  store i32 %124, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  br label %48, !llvm.loop !15

125:                                              ; preds = %48
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  store i32 1, ptr %9, align 4, !tbaa !5
  br label %126

126:                                              ; preds = %143, %125
  %127 = load i32, ptr %9, align 4, !tbaa !5
  %128 = load i32, ptr @n, align 4, !tbaa !5
  %129 = icmp sle i32 %127, %128
  br i1 %129, label %131, label %130

130:                                              ; preds = %126
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  br label %146

131:                                              ; preds = %126
  %132 = load i32, ptr %9, align 4, !tbaa !5
  %133 = sub nsw i32 %132, 1
  %134 = mul nsw i32 %133, 2
  %135 = add nsw i32 %134, 1
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds [4000010 x i32], ptr @rad, i64 0, i64 %136
  %138 = load i32, ptr %137, align 4, !tbaa !5
  %139 = sdiv i32 %138, 2
  %140 = load i32, ptr %9, align 4, !tbaa !5
  %141 = sext i32 %140 to i64
  %142 = getelementptr inbounds [2000005 x i32], ptr @go_odd, i64 0, i64 %141
  store i32 %139, ptr %142, align 4, !tbaa !5
  br label %143

143:                                              ; preds = %131
  %144 = load i32, ptr %9, align 4, !tbaa !5
  %145 = add nsw i32 %144, 1
  store i32 %145, ptr %9, align 4, !tbaa !5
  br label %126, !llvm.loop !16

146:                                              ; preds = %130
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  store i32 1, ptr %10, align 4, !tbaa !5
  br label %147

147:                                              ; preds = %164, %146
  %148 = load i32, ptr %10, align 4, !tbaa !5
  %149 = load i32, ptr @n, align 4, !tbaa !5
  %150 = icmp sle i32 %148, %149
  br i1 %150, label %152, label %151

151:                                              ; preds = %147
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  br label %167

152:                                              ; preds = %147
  %153 = load i32, ptr %10, align 4, !tbaa !5
  %154 = sub nsw i32 %153, 1
  %155 = mul nsw i32 %154, 2
  %156 = sext i32 %155 to i64
  %157 = getelementptr inbounds [4000010 x i32], ptr @rad, i64 0, i64 %156
  %158 = load i32, ptr %157, align 4, !tbaa !5
  %159 = sdiv i32 %158, 2
  %160 = load i32, ptr %10, align 4, !tbaa !5
  %161 = sub nsw i32 %160, 1
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds [2000005 x i32], ptr @go_even, i64 0, i64 %162
  store i32 %159, ptr %163, align 4, !tbaa !5
  br label %164

164:                                              ; preds = %152
  %165 = load i32, ptr %10, align 4, !tbaa !5
  %166 = add nsw i32 %165, 1
  store i32 %166, ptr %10, align 4, !tbaa !5
  br label %147, !llvm.loop !17

167:                                              ; preds = %151
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #4
  ret void
}

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1

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

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

; Function Attrs: inlinehint mustprogress 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)) #3

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 nounwind willreturn memory(argmem: write) }
attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 = !{!7, !7, i64 0}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !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"

@n = external dso_local local_unnamed_addr global i32, align 4
@s = external dso_local local_unnamed_addr global [2000005 x i8], align 16
@go_odd = external dso_local local_unnamed_addr global [2000005 x i32], align 16
@go_even = external dso_local local_unnamed_addr global [2000005 x i32], align 16
@tmp = external dso_local local_unnamed_addr global [4000010 x i32], align 16
@rad = external dso_local local_unnamed_addr global [4000010 x i32], align 16

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_Z8manacherv() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(16000040) @tmp, i8 0, i64 16000040, i1 false)
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(16000040) @rad, i8 0, i64 16000040, i1 false)
  %3 = load i32, ptr @n, align 4, !tbaa !5
  %4 = shl i32 %3, 1
  %.not61 = icmp slt i32 %3, 0
  br i1 %.not61, label %._crit_edge84, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %0
  %smax = tail call i32 @llvm.smax.i32(i32 %4, i32 0)
  %5 = or disjoint i32 %smax, 1
  %wide.trip.count = zext nneg i32 %5 to i64
  %min.iters.check = icmp slt i32 %4, 8
  br i1 %min.iters.check, label %.lr.ph.preheader134, label %vector.ph

.lr.ph.preheader134:                              ; preds = %vector.body, %.lr.ph.preheader
  %indvars.iv.ph = phi i64 [ 0, %.lr.ph.preheader ], [ %n.vec, %vector.body ]
  br label %.lr.ph

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

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %6 = getelementptr inbounds [4000010 x i32], ptr @tmp, i64 0, i64 %index
  %7 = getelementptr inbounds i8, ptr %6, i64 16
  store <4 x i32> <i32 35, i32 35, i32 35, i32 35>, ptr %6, align 16, !tbaa !5
  store <4 x i32> <i32 35, i32 35, i32 35, i32 35>, ptr %7, align 16, !tbaa !5
  %index.next = add nuw i64 %index, 8
  %8 = icmp eq i64 %index.next, %n.vec
  br i1 %8, label %.lr.ph.preheader134, label %vector.body, !llvm.loop !9

.preheader60:                                     ; preds = %.lr.ph
  %.not = icmp eq i32 %3, 0
  br i1 %.not, label %.preheader59, label %.lr.ph64.preheader

.lr.ph64.preheader:                               ; preds = %.preheader60
  %wide.trip.count89 = zext nneg i32 %3 to i64
  %xtraiter = and i64 %wide.trip.count89, 3
  %9 = icmp ult i32 %3, 4
  br i1 %9, label %.preheader59.loopexit.unr-lcssa, label %.lr.ph64.preheader.new

.lr.ph64.preheader.new:                           ; preds = %.lr.ph64.preheader
  %unroll_iter = and i64 %wide.trip.count89, 2147483644
  br label %.lr.ph64

.lr.ph:                                           ; preds = %.lr.ph.preheader134, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ %indvars.iv.ph, %.lr.ph.preheader134 ]
  %10 = getelementptr inbounds [4000010 x i32], ptr @tmp, i64 0, i64 %indvars.iv
  store i32 35, ptr %10, align 4, !tbaa !5
  %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 %.preheader60, label %.lr.ph, !llvm.loop !13

.preheader59.loopexit.unr-lcssa:                  ; preds = %.lr.ph64, %.lr.ph64.preheader
  %indvars.iv86.unr = phi i64 [ 0, %.lr.ph64.preheader ], [ %indvars.iv.next87.3, %.lr.ph64 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader59, label %.lr.ph64.epil

.lr.ph64.epil:                                    ; preds = %.preheader59.loopexit.unr-lcssa, %.lr.ph64.epil
  %indvars.iv86.epil = phi i64 [ %indvars.iv.next87.epil, %.lr.ph64.epil ], [ %indvars.iv86.unr, %.preheader59.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph64.epil ], [ 0, %.preheader59.loopexit.unr-lcssa ]
  %indvars.iv.next87.epil = add nuw nsw i64 %indvars.iv86.epil, 1
  %11 = getelementptr inbounds [2000005 x i8], ptr @s, i64 0, i64 %indvars.iv.next87.epil
  %12 = load i8, ptr %11, align 1, !tbaa !14
  %13 = sext i8 %12 to i32
  %14 = shl nuw nsw i64 %indvars.iv86.epil, 1
  %15 = or disjoint i64 %14, 1
  %16 = getelementptr inbounds [4000010 x i32], ptr @tmp, i64 0, i64 %15
  store i32 %13, ptr %16, align 4, !tbaa !5
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %.preheader59, label %.lr.ph64.epil, !llvm.loop !15

.preheader59:                                     ; preds = %.preheader59.loopexit.unr-lcssa, %.lr.ph64.epil, %.preheader60
  br i1 %.not61, label %._crit_edge84, label %.preheader58.preheader

.preheader58.preheader:                           ; preds = %.preheader59
  %17 = sext i32 %4 to i64
  br label %.preheader58

.lr.ph64:                                         ; preds = %.lr.ph64, %.lr.ph64.preheader.new
  %indvars.iv86 = phi i64 [ 0, %.lr.ph64.preheader.new ], [ %indvars.iv.next87.3, %.lr.ph64 ]
  %niter = phi i64 [ 0, %.lr.ph64.preheader.new ], [ %niter.next.3, %.lr.ph64 ]
  %indvars.iv.next87 = or disjoint i64 %indvars.iv86, 1
  %18 = getelementptr inbounds [2000005 x i8], ptr @s, i64 0, i64 %indvars.iv.next87
  %19 = load i8, ptr %18, align 1, !tbaa !14
  %20 = sext i8 %19 to i32
  %21 = shl nuw nsw i64 %indvars.iv86, 1
  %22 = or disjoint i64 %21, 1
  %23 = getelementptr inbounds [4000010 x i32], ptr @tmp, i64 0, i64 %22
  store i32 %20, ptr %23, align 4, !tbaa !5
  %indvars.iv.next87.1 = or disjoint i64 %indvars.iv86, 2
  %24 = getelementptr inbounds [2000005 x i8], ptr @s, i64 0, i64 %indvars.iv.next87.1
  %25 = load i8, ptr %24, align 2, !tbaa !14
  %26 = sext i8 %25 to i32
  %27 = shl nuw nsw i64 %indvars.iv.next87, 1
  %28 = or disjoint i64 %27, 1
  %29 = getelementptr inbounds [4000010 x i32], ptr @tmp, i64 0, i64 %28
  store i32 %26, ptr %29, align 4, !tbaa !5
  %indvars.iv.next87.2 = or disjoint i64 %indvars.iv86, 3
  %30 = getelementptr inbounds [2000005 x i8], ptr @s, i64 0, i64 %indvars.iv.next87.2
  %31 = load i8, ptr %30, align 1, !tbaa !14
  %32 = sext i8 %31 to i32
  %33 = shl nuw nsw i64 %indvars.iv.next87.1, 1
  %34 = or disjoint i64 %33, 1
  %35 = getelementptr inbounds [4000010 x i32], ptr @tmp, i64 0, i64 %34
  store i32 %32, ptr %35, align 4, !tbaa !5
  %indvars.iv.next87.3 = add nuw nsw i64 %indvars.iv86, 4
  %36 = getelementptr inbounds [2000005 x i8], ptr @s, i64 0, i64 %indvars.iv.next87.3
  %37 = load i8, ptr %36, align 4, !tbaa !14
  %38 = sext i8 %37 to i32
  %39 = shl nuw nsw i64 %indvars.iv.next87.2, 1
  %40 = or disjoint i64 %39, 1
  %41 = getelementptr inbounds [4000010 x i32], ptr @tmp, i64 0, i64 %40
  store i32 %38, ptr %41, align 4, !tbaa !5
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %.preheader59.loopexit.unr-lcssa, label %.lr.ph64, !llvm.loop !17

.preheader58:                                     ; preds = %.preheader58.preheader, %._crit_edge
  %.04576 = phi i32 [ %85, %._crit_edge ], [ 0, %.preheader58.preheader ]
  %.04675 = phi i32 [ %82, %._crit_edge ], [ 0, %.preheader58.preheader ]
  %42 = sub nsw i32 %.04675, %.04576
  %43 = icmp sgt i32 %42, -1
  br i1 %43, label %.lr.ph66.preheader, label %.critedge

.lr.ph66.preheader:                               ; preds = %.preheader58
  %44 = sext i32 %.04576 to i64
  %45 = sext i32 %.04675 to i64
  %46 = add i32 %.04675, 1
  br label %.lr.ph66

.preheader57:                                     ; preds = %._crit_edge
  %.pre = load i32, ptr @n, align 4, !tbaa !5
  %.not5477 = icmp slt i32 %.pre, 1
  br i1 %.not5477, label %._crit_edge84, label %.lr.ph79.preheader

.lr.ph79.preheader:                               ; preds = %.preheader57
  %47 = zext nneg i32 %.pre to i64
  %xtraiter135 = and i64 %47, 1
  %48 = icmp eq i32 %.pre, 1
  br i1 %48, label %.preheader.unr-lcssa, label %.lr.ph79.preheader.new

.lr.ph79.preheader.new:                           ; preds = %.lr.ph79.preheader
  %unroll_iter138 = and i64 %47, 2147483646
  br label %.lr.ph79

.lr.ph66:                                         ; preds = %.lr.ph66.preheader, %58
  %indvars.iv91 = phi i64 [ %44, %.lr.ph66.preheader ], [ %indvars.iv.next92, %58 ]
  %49 = phi i32 [ %42, %.lr.ph66.preheader ], [ %61, %58 ]
  %50 = add nsw i64 %indvars.iv91, %45
  %.not56 = icmp sgt i64 %50, %17
  br i1 %.not56, label %.critedge.loopexit.split.loop.exit, label %51

51:                                               ; preds = %.lr.ph66
  %52 = zext nneg i32 %49 to i64
  %53 = getelementptr inbounds [4000010 x i32], ptr @tmp, i64 0, i64 %52
  %54 = load i32, ptr %53, align 4, !tbaa !5
  %55 = getelementptr inbounds [4000010 x i32], ptr @tmp, i64 0, i64 %50
  %56 = load i32, ptr %55, align 4, !tbaa !5
  %57 = icmp eq i32 %54, %56
  br i1 %57, label %58, label %.critedge.loopexit.split.loop.exit114

58:                                               ; preds = %51
  %indvars.iv.next92 = add nsw i64 %indvars.iv91, 1
  %59 = sub nsw i64 %45, %indvars.iv.next92
  %60 = icmp sgt i64 %59, -1
  %61 = trunc nsw i64 %59 to i32
  br i1 %60, label %.lr.ph66, label %.critedge, !llvm.loop !18

.critedge.loopexit.split.loop.exit:               ; preds = %.lr.ph66
  %62 = trunc nsw i64 %indvars.iv91 to i32
  br label %.critedge

.critedge.loopexit.split.loop.exit114:            ; preds = %51
  %63 = trunc nsw i64 %indvars.iv91 to i32
  br label %.critedge

.critedge:                                        ; preds = %58, %.critedge.loopexit.split.loop.exit, %.critedge.loopexit.split.loop.exit114, %.preheader58
  %.1.lcssa = phi i32 [ %.04576, %.preheader58 ], [ %62, %.critedge.loopexit.split.loop.exit ], [ %63, %.critedge.loopexit.split.loop.exit114 ], [ %46, %58 ]
  %64 = zext nneg i32 %.04675 to i64
  %65 = getelementptr inbounds [4000010 x i32], ptr @rad, i64 0, i64 %64
  store i32 %.1.lcssa, ptr %65, align 4, !tbaa !5
  %66 = add nsw i32 %.04675, -1
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [4000010 x i32], ptr @rad, i64 0, i64 %67
  %69 = load i32, ptr %68, align 4, !tbaa !5
  %70 = add nsw i32 %.1.lcssa, -1
  %71 = icmp slt i32 %69, %70
  br i1 %71, label %.lr.ph72.preheader, label %._crit_edge

.lr.ph72.preheader:                               ; preds = %.critedge
  %72 = sext i32 %.04675 to i64
  br label %.lr.ph72

.lr.ph72:                                         ; preds = %.lr.ph72.preheader, %.lr.ph72
  %indvars.iv94 = phi i64 [ 1, %.lr.ph72.preheader ], [ %indvars.iv.next95, %.lr.ph72 ]
  %73 = phi i32 [ %69, %.lr.ph72.preheader ], [ %78, %.lr.ph72 ]
  %74 = add nuw nsw i64 %indvars.iv94, %72
  %75 = getelementptr inbounds [4000010 x i32], ptr @rad, i64 0, i64 %74
  store i32 %73, ptr %75, align 4, !tbaa !5
  %indvars.iv.next95 = add nuw nsw i64 %indvars.iv94, 1
  %indvars = trunc i64 %indvars.iv.next95 to i32
  %76 = sub nsw i64 %72, %indvars.iv.next95
  %77 = getelementptr inbounds [4000010 x i32], ptr @rad, i64 0, i64 %76
  %78 = load i32, ptr %77, align 4, !tbaa !5
  %79 = load i32, ptr %65, align 4, !tbaa !5
  %80 = sub nsw i32 %79, %indvars
  %81 = icmp slt i32 %78, %80
  br i1 %81, label %.lr.ph72, label %._crit_edge, !llvm.loop !19

._crit_edge:                                      ; preds = %.lr.ph72, %.critedge
  %.044.lcssa = phi i32 [ 1, %.critedge ], [ %indvars, %.lr.ph72 ]
  %82 = add nuw nsw i32 %.044.lcssa, %.04675
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  store i32 0, ptr %1, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #5
  %83 = sub nsw i32 %.1.lcssa, %.044.lcssa
  store i32 %83, ptr %2, align 4, !tbaa !5
  %84 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %85 = load i32, ptr %84, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  %.not53 = icmp sgt i32 %82, %4
  br i1 %.not53, label %.preheader57, label %.preheader58, !llvm.loop !20

.preheader.unr-lcssa:                             ; preds = %.lr.ph79, %.lr.ph79.preheader
  %indvars.iv97.unr = phi i64 [ 1, %.lr.ph79.preheader ], [ %indvars.iv.next98.1, %.lr.ph79 ]
  %lcmp.mod137.not = icmp eq i64 %xtraiter135, 0
  br i1 %lcmp.mod137.not, label %.preheader, label %.lr.ph79.epil

.lr.ph79.epil:                                    ; preds = %.preheader.unr-lcssa
  %indvars.iv97.tr.epil = trunc i64 %indvars.iv97.unr to i32
  %86 = shl i32 %indvars.iv97.tr.epil, 1
  %87 = add i32 %86, -1
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [4000010 x i32], ptr @rad, i64 0, i64 %88
  %90 = load i32, ptr %89, align 4, !tbaa !5
  %91 = sdiv i32 %90, 2
  %92 = getelementptr inbounds [2000005 x i32], ptr @go_odd, i64 0, i64 %indvars.iv97.unr
  store i32 %91, ptr %92, align 4, !tbaa !5
  br label %.preheader

.preheader:                                       ; preds = %.preheader.unr-lcssa, %.lr.ph79.epil
  br i1 %.not5477, label %._crit_edge84, label %.lr.ph83.preheader

.lr.ph83.preheader:                               ; preds = %.preheader
  %93 = add nuw i32 %.pre, 1
  %wide.trip.count107 = zext i32 %93 to i64
  %min.iters.check121 = icmp ult i32 %.pre, 9
  br i1 %min.iters.check121, label %.lr.ph83.preheader131, label %vector.ph122

.lr.ph83.preheader131:                            ; preds = %vector.body126, %.lr.ph83.preheader
  %indvars.iv103.ph = phi i64 [ 1, %.lr.ph83.preheader ], [ %ind.end, %vector.body126 ]
  br label %.lr.ph83

vector.ph122:                                     ; preds = %.lr.ph83.preheader
  %94 = zext nneg i32 %.pre to i64
  %n.mod.vf123 = and i64 %94, 7
  %95 = icmp eq i64 %n.mod.vf123, 0
  %96 = select i1 %95, i64 8, i64 %n.mod.vf123
  %n.vec124 = sub nsw i64 %94, %96
  %ind.end = add nsw i64 %n.vec124, 1
  br label %vector.body126

vector.body126:                                   ; preds = %vector.body126, %vector.ph122
  %index127 = phi i64 [ 0, %vector.ph122 ], [ %index.next130, %vector.body126 ]
  %97 = shl nsw i64 %index127, 1
  %98 = shl i64 %index127, 1
  %99 = or disjoint i64 %98, 8
  %100 = getelementptr inbounds [4000010 x i32], ptr @rad, i64 0, i64 %97
  %101 = getelementptr inbounds [4000010 x i32], ptr @rad, i64 0, i64 %99
  %wide.vec = load <8 x i32>, ptr %100, align 16, !tbaa !5
  %wide.vec128 = load <8 x i32>, ptr %101, align 16, !tbaa !5
  %strided.vec = shufflevector <8 x i32> %wide.vec, <8 x i32> poison, <4 x i32> <i32 0, i32 2, i32 4, i32 6>
  %strided.vec129 = shufflevector <8 x i32> %wide.vec128, <8 x i32> poison, <4 x i32> <i32 0, i32 2, i32 4, i32 6>
  %102 = sdiv <4 x i32> %strided.vec, <i32 2, i32 2, i32 2, i32 2>
  %103 = sdiv <4 x i32> %strided.vec129, <i32 2, i32 2, i32 2, i32 2>
  %104 = getelementptr inbounds [2000005 x i32], ptr @go_even, i64 0, i64 %index127
  %105 = getelementptr inbounds i8, ptr %104, i64 16
  store <4 x i32> %102, ptr %104, align 16, !tbaa !5
  store <4 x i32> %103, ptr %105, align 16, !tbaa !5
  %index.next130 = add nuw i64 %index127, 8
  %106 = icmp eq i64 %index.next130, %n.vec124
  br i1 %106, label %.lr.ph83.preheader131, label %vector.body126, !llvm.loop !21

.lr.ph79:                                         ; preds = %.lr.ph79, %.lr.ph79.preheader.new
  %indvars.iv97 = phi i64 [ 1, %.lr.ph79.preheader.new ], [ %indvars.iv.next98.1, %.lr.ph79 ]
  %niter139 = phi i64 [ 0, %.lr.ph79.preheader.new ], [ %niter139.next.1, %.lr.ph79 ]
  %indvars.iv97.tr = trunc i64 %indvars.iv97 to i32
  %107 = shl i32 %indvars.iv97.tr, 1
  %108 = add nsw i32 %107, -1
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds [4000010 x i32], ptr @rad, i64 0, i64 %109
  %111 = load i32, ptr %110, align 4, !tbaa !5
  %112 = sdiv i32 %111, 2
  %113 = getelementptr inbounds [2000005 x i32], ptr @go_odd, i64 0, i64 %indvars.iv97
  store i32 %112, ptr %113, align 4, !tbaa !5
  %indvars.iv.next98 = add nuw nsw i64 %indvars.iv97, 1
  %indvars.iv97.tr.1 = trunc i64 %indvars.iv.next98 to i32
  %114 = shl i32 %indvars.iv97.tr.1, 1
  %115 = add i32 %114, -1
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds [4000010 x i32], ptr @rad, i64 0, i64 %116
  %118 = load i32, ptr %117, align 4, !tbaa !5
  %119 = sdiv i32 %118, 2
  %120 = getelementptr inbounds [2000005 x i32], ptr @go_odd, i64 0, i64 %indvars.iv.next98
  store i32 %119, ptr %120, align 4, !tbaa !5
  %indvars.iv.next98.1 = add nuw nsw i64 %indvars.iv97, 2
  %niter139.next.1 = add i64 %niter139, 2
  %niter139.ncmp.1 = icmp eq i64 %niter139.next.1, %unroll_iter138
  br i1 %niter139.ncmp.1, label %.preheader.unr-lcssa, label %.lr.ph79, !llvm.loop !22

._crit_edge84:                                    ; preds = %.lr.ph83, %.preheader57, %0, %.preheader59, %.preheader
  ret void

.lr.ph83:                                         ; preds = %.lr.ph83.preheader131, %.lr.ph83
  %indvars.iv103 = phi i64 [ %indvars.iv.next104, %.lr.ph83 ], [ %indvars.iv103.ph, %.lr.ph83.preheader131 ]
  %121 = add nsw i64 %indvars.iv103, -1
  %122 = shl nsw i64 %121, 1
  %123 = getelementptr inbounds [4000010 x i32], ptr @rad, i64 0, i64 %122
  %124 = load i32, ptr %123, align 8, !tbaa !5
  %125 = sdiv i32 %124, 2
  %126 = getelementptr inbounds [2000005 x i32], ptr @go_even, i64 0, i64 %121
  store i32 %125, ptr %126, align 4, !tbaa !5
  %indvars.iv.next104 = add nuw nsw i64 %indvars.iv103, 1
  %exitcond108.not = icmp eq i64 %indvars.iv.next104, %wide.trip.count107
  br i1 %exitcond108.not, label %._crit_edge84, label %.lr.ph83, !llvm.loop !23
}

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef 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 #3

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

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10, !12, !11}
!14 = !{!7, !7, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.unroll.disable"}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10}
!21 = distinct !{!21, !10, !11, !12}
!22 = distinct !{!22, !10}
!23 = distinct !{!23, !10, !12, !11}


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