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

; 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
@ans = external dso_local global [2 x [2000005 x i32]], align 16
@.str = external hidden unnamed_addr constant [6 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z8manacherv() #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: 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)) #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z8solveOddb(i1 noundef zeroext) #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z9solveEvenb(i1 noundef zeroext) #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #3 {
  %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
  store i32 0, ptr %1, align 4
  %6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef getelementptr inbounds (i8, ptr @s, i64 1))
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %7

7:                                                ; preds = %22, %0
  %8 = load i32, ptr %2, align 4, !tbaa !5
  %9 = load i32, ptr @n, align 4, !tbaa !5
  %10 = icmp sle i32 %8, %9
  br i1 %10, label %12, label %11

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

12:                                               ; preds = %7
  %13 = load i32, ptr %2, align 4, !tbaa !5
  %14 = sext i32 %13 to i64
  %15 = getelementptr inbounds [2000005 x i8], ptr @s, i64 0, i64 %14
  %16 = load i8, ptr %15, align 1, !tbaa !9
  %17 = load i32, ptr %2, align 4, !tbaa !5
  %18 = load i32, ptr @n, align 4, !tbaa !5
  %19 = add nsw i32 %17, %18
  %20 = sext i32 %19 to i64
  %21 = getelementptr inbounds [2000005 x i8], ptr @s, i64 0, i64 %20
  store i8 %16, ptr %21, align 1, !tbaa !9
  br label %22

22:                                               ; preds = %12
  %23 = load i32, ptr %2, align 4, !tbaa !5
  %24 = add nsw i32 %23, 1
  store i32 %24, ptr %2, align 4, !tbaa !5
  br label %7, !llvm.loop !10

25:                                               ; preds = %11
  %26 = load i32, ptr @n, align 4, !tbaa !5
  %27 = mul nsw i32 %26, 2
  store i32 %27, ptr @n, align 4, !tbaa !5
  call void @_Z8manacherv()
  %28 = load i32, ptr @n, align 4, !tbaa !5
  %29 = sdiv i32 %28, 2
  store i32 %29, ptr @n, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %30

30:                                               ; preds = %53, %25
  %31 = load i32, ptr %3, align 4, !tbaa !5
  %32 = load i32, ptr @n, align 4, !tbaa !5
  %33 = load i32, ptr @n, align 4, !tbaa !5
  %34 = add nsw i32 %32, %33
  %35 = icmp sle i32 %31, %34
  br i1 %35, label %37, label %36

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

37:                                               ; preds = %30
  %38 = load i32, ptr %3, align 4, !tbaa !5
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds [2000005 x i32], ptr @go_odd, i64 0, i64 %39
  %41 = load i32, ptr %40, align 4, !tbaa !5
  %42 = mul nsw i32 %41, 2
  store i32 %42, ptr %40, align 4, !tbaa !5
  %43 = load i32, ptr %3, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [2000005 x i32], ptr @go_odd, i64 0, i64 %44
  %46 = load i32, ptr %45, align 4, !tbaa !5
  %47 = sub nsw i32 %46, 1
  store i32 %47, ptr %45, align 4, !tbaa !5
  %48 = load i32, ptr %3, align 4, !tbaa !5
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [2000005 x i32], ptr @go_even, i64 0, i64 %49
  %51 = load i32, ptr %50, align 4, !tbaa !5
  %52 = mul nsw i32 %51, 2
  store i32 %52, ptr %50, align 4, !tbaa !5
  br label %53

53:                                               ; preds = %37
  %54 = load i32, ptr %3, align 4, !tbaa !5
  %55 = add nsw i32 %54, 1
  store i32 %55, ptr %3, align 4, !tbaa !5
  br label %30, !llvm.loop !12

56:                                               ; preds = %36
  call void @_Z8solveOddb(i1 noundef zeroext false)
  call void @_Z9solveEvenb(i1 noundef zeroext false)
  %57 = load i32, ptr @n, align 4, !tbaa !5
  %58 = mul nsw i32 %57, 2
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds i8, ptr @s, i64 %59
  %61 = getelementptr inbounds i8, ptr %60, i64 1
  call void @_ZSt7reverseIPcEvT_S1_(ptr noundef getelementptr inbounds (i8, ptr @s, i64 1), ptr noundef %61)
  %62 = load i32, ptr @n, align 4, !tbaa !5
  %63 = mul nsw i32 %62, 2
  store i32 %63, ptr @n, align 4, !tbaa !5
  call void @_Z8manacherv()
  %64 = load i32, ptr @n, align 4, !tbaa !5
  %65 = sdiv i32 %64, 2
  store i32 %65, ptr @n, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store i32 1, ptr %4, align 4, !tbaa !5
  br label %66

66:                                               ; preds = %89, %56
  %67 = load i32, ptr %4, align 4, !tbaa !5
  %68 = load i32, ptr @n, align 4, !tbaa !5
  %69 = load i32, ptr @n, align 4, !tbaa !5
  %70 = add nsw i32 %68, %69
  %71 = icmp sle i32 %67, %70
  br i1 %71, label %73, label %72

72:                                               ; preds = %66
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  br label %92

73:                                               ; preds = %66
  %74 = load i32, ptr %4, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [2000005 x i32], ptr @go_odd, i64 0, i64 %75
  %77 = load i32, ptr %76, align 4, !tbaa !5
  %78 = mul nsw i32 %77, 2
  store i32 %78, ptr %76, align 4, !tbaa !5
  %79 = load i32, ptr %4, align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [2000005 x i32], ptr @go_odd, i64 0, i64 %80
  %82 = load i32, ptr %81, align 4, !tbaa !5
  %83 = sub nsw i32 %82, 1
  store i32 %83, ptr %81, align 4, !tbaa !5
  %84 = load i32, ptr %4, align 4, !tbaa !5
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [2000005 x i32], ptr @go_even, i64 0, i64 %85
  %87 = load i32, ptr %86, align 4, !tbaa !5
  %88 = mul nsw i32 %87, 2
  store i32 %88, ptr %86, align 4, !tbaa !5
  br label %89

89:                                               ; preds = %73
  %90 = load i32, ptr %4, align 4, !tbaa !5
  %91 = add nsw i32 %90, 1
  store i32 %91, ptr %4, align 4, !tbaa !5
  br label %66, !llvm.loop !13

92:                                               ; preds = %72
  call void @_Z8solveOddb(i1 noundef zeroext true)
  call void @_Z9solveEvenb(i1 noundef zeroext true)
  %93 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds ([2000005 x i32], ptr @ans, i64 0, i64 1), ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds ([2000005 x i32], ptr getelementptr inbounds ([2 x [2000005 x i32]], ptr @ans, i64 0, i64 1), i64 0, i64 1))
  %94 = load i32, ptr %93, align 4, !tbaa !5
  %95 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %94)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  store i32 2, ptr %5, align 4, !tbaa !5
  br label %96

96:                                               ; preds = %114, %92
  %97 = load i32, ptr %5, align 4, !tbaa !5
  %98 = load i32, ptr @n, align 4, !tbaa !5
  %99 = icmp sle i32 %97, %98
  br i1 %99, label %101, label %100

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

101:                                              ; preds = %96
  %102 = load i32, ptr %5, align 4, !tbaa !5
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds [2000005 x i32], ptr @ans, i64 0, i64 %103
  %105 = load i32, ptr @n, align 4, !tbaa !5
  %106 = add nsw i32 %105, 2
  %107 = load i32, ptr %5, align 4, !tbaa !5
  %108 = sub nsw i32 %106, %107
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds [2000005 x i32], ptr getelementptr inbounds ([2 x [2000005 x i32]], ptr @ans, i64 0, i64 1), i64 0, i64 %109
  %111 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %104, ptr noundef nonnull align 4 dereferenceable(4) %110)
  %112 = load i32, ptr %111, align 4, !tbaa !5
  %113 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %112)
  br label %114

114:                                              ; preds = %101
  %115 = load i32, ptr %5, align 4, !tbaa !5
  %116 = add nsw i32 %115, 1
  store i32 %116, ptr %5, align 4, !tbaa !5
  br label %96, !llvm.loop !14

117:                                              ; preds = %100
  ret i32 0
}

declare i32 @__isoc99_scanf(ptr noundef, ...) #4

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

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

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

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


; 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 global i32, align 4
@s = external dso_local 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
@ans = external dso_local global [2 x [2000005 x i32]], align 16
@.str = external hidden unnamed_addr constant [6 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z8manacherv() local_unnamed_addr #0

; 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 #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z8solveOddb(i1 noundef zeroext) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z9solveEvenb(i1 noundef zeroext) local_unnamed_addr #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 {
  %1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull getelementptr inbounds (i8, ptr @s, i64 1))
  %2 = load i32, ptr @n, align 4, !tbaa !5
  %.not26 = icmp slt i32 %2, 1
  br i1 %.not26, label %._crit_edge, label %iter.check

iter.check:                                       ; preds = %0
  %3 = zext nneg i32 %2 to i64
  %4 = add nuw i32 %2, 1
  %wide.trip.count = zext i32 %4 to i64
  %5 = zext nneg i32 %2 to i64
  %diff.check = icmp ult i32 %2, 32
  br i1 %diff.check, label %.lr.ph.preheader, label %vector.ph

vector.ph:                                        ; preds = %iter.check
  %n.vec = and i64 %5, 2147483616
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %offset.idx = or disjoint i64 %index, 1
  %6 = getelementptr inbounds [2000005 x i8], ptr @s, i64 0, i64 %offset.idx
  %7 = getelementptr inbounds i8, ptr %6, i64 16
  %wide.load = load <16 x i8>, ptr %6, align 1, !tbaa !9
  %wide.load59 = load <16 x i8>, ptr %7, align 1, !tbaa !9
  %8 = add nuw nsw i64 %offset.idx, %3
  %9 = getelementptr inbounds [2000005 x i8], ptr @s, i64 0, i64 %8
  %10 = getelementptr inbounds i8, ptr %9, i64 16
  store <16 x i8> %wide.load, ptr %9, align 1, !tbaa !9
  store <16 x i8> %wide.load59, ptr %10, align 1, !tbaa !9
  %index.next = add nuw i64 %index, 32
  %11 = icmp eq i64 %index.next, %n.vec
  br i1 %11, label %middle.block, label %vector.body, !llvm.loop !10

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %5
  br i1 %cmp.n, label %._crit_edge, label %vec.epilog.iter.check

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

.lr.ph.preheader:                                 ; preds = %vec.epilog.middle.block, %iter.check, %vec.epilog.iter.check
  %indvars.iv.ph = phi i64 [ 1, %iter.check ], [ %ind.end62, %vec.epilog.iter.check ], [ %ind.end, %vec.epilog.middle.block ]
  %12 = sub nsw i64 %wide.trip.count, %indvars.iv.ph
  %13 = zext nneg i32 %2 to i64
  %14 = sub nsw i64 %13, %indvars.iv.ph
  %xtraiter = and i64 %12, 3
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.lr.ph.prol.loopexit, label %.lr.ph.prol

.lr.ph.prol:                                      ; preds = %.lr.ph.preheader, %.lr.ph.prol
  %indvars.iv.prol = phi i64 [ %indvars.iv.next.prol, %.lr.ph.prol ], [ %indvars.iv.ph, %.lr.ph.preheader ]
  %prol.iter = phi i64 [ %prol.iter.next, %.lr.ph.prol ], [ 0, %.lr.ph.preheader ]
  %15 = getelementptr inbounds [2000005 x i8], ptr @s, i64 0, i64 %indvars.iv.prol
  %16 = load i8, ptr %15, align 1, !tbaa !9
  %17 = add nuw nsw i64 %indvars.iv.prol, %3
  %18 = getelementptr inbounds [2000005 x i8], ptr @s, i64 0, i64 %17
  store i8 %16, ptr %18, align 1, !tbaa !9
  %indvars.iv.next.prol = add nuw nsw i64 %indvars.iv.prol, 1
  %prol.iter.next = add i64 %prol.iter, 1
  %prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
  br i1 %prol.iter.cmp.not, label %.lr.ph.prol.loopexit, label %.lr.ph.prol, !llvm.loop !14

.lr.ph.prol.loopexit:                             ; preds = %.lr.ph.prol, %.lr.ph.preheader
  %indvars.iv.unr = phi i64 [ %indvars.iv.ph, %.lr.ph.preheader ], [ %indvars.iv.next.prol, %.lr.ph.prol ]
  %19 = icmp ult i64 %14, 3
  br i1 %19, label %._crit_edge, label %.lr.ph

vec.epilog.ph:                                    ; preds = %vec.epilog.iter.check
  %n.vec61 = and i64 %5, 2147483640
  %ind.end = or disjoint i64 %n.vec61, 1
  br label %vec.epilog.vector.body

vec.epilog.vector.body:                           ; preds = %vec.epilog.vector.body, %vec.epilog.ph
  %index63 = phi i64 [ %n.vec, %vec.epilog.ph ], [ %index.next66, %vec.epilog.vector.body ]
  %offset.idx64 = or disjoint i64 %index63, 1
  %20 = getelementptr inbounds [2000005 x i8], ptr @s, i64 0, i64 %offset.idx64
  %wide.load65 = load <8 x i8>, ptr %20, align 1, !tbaa !9
  %21 = add nuw nsw i64 %offset.idx64, %3
  %22 = getelementptr inbounds [2000005 x i8], ptr @s, i64 0, i64 %21
  store <8 x i8> %wide.load65, ptr %22, align 1, !tbaa !9
  %index.next66 = add nuw i64 %index63, 8
  %23 = icmp eq i64 %index.next66, %n.vec61
  br i1 %23, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !16

vec.epilog.middle.block:                          ; preds = %vec.epilog.vector.body
  %cmp.n67 = icmp eq i64 %n.vec61, %5
  br i1 %cmp.n67, label %._crit_edge, label %.lr.ph.preheader

._crit_edge:                                      ; preds = %.lr.ph.prol.loopexit, %.lr.ph, %middle.block, %vec.epilog.middle.block, %0
  %24 = shl nsw i32 %2, 1
  store i32 %24, ptr @n, align 4, !tbaa !5
  tail call void @_Z8manacherv()
  %25 = load i32, ptr @n, align 4, !tbaa !5
  %26 = sdiv i32 %25, 2
  store i32 %26, ptr @n, align 4, !tbaa !5
  %.not2328 = icmp slt i32 %25, 2
  br i1 %.not2328, label %._crit_edge32, label %.lr.ph31.preheader

.lr.ph31.preheader:                               ; preds = %._crit_edge
  %27 = shl nuw nsw i32 %26, 1
  %smax = tail call i32 @llvm.smax.i32(i32 %27, i32 1)
  %28 = add nuw nsw i32 %smax, 1
  %wide.trip.count47 = zext nneg i32 %28 to i64
  %29 = zext nneg i32 %smax to i64
  %min.iters.check69 = icmp ult i32 %26, 4
  br i1 %min.iters.check69, label %.lr.ph31.preheader102, label %vector.ph70

.lr.ph31.preheader102:                            ; preds = %middle.block68, %.lr.ph31.preheader
  %indvars.iv44.ph = phi i64 [ 1, %.lr.ph31.preheader ], [ %ind.end73, %middle.block68 ]
  br label %.lr.ph31

vector.ph70:                                      ; preds = %.lr.ph31.preheader
  %n.vec72 = and i64 %29, 2147483640
  %ind.end73 = or disjoint i64 %n.vec72, 1
  br label %vector.body75

vector.body75:                                    ; preds = %vector.body75, %vector.ph70
  %index76 = phi i64 [ 0, %vector.ph70 ], [ %index.next82, %vector.body75 ]
  %offset.idx77 = or disjoint i64 %index76, 1
  %30 = getelementptr inbounds [2000005 x i32], ptr @go_odd, i64 0, i64 %offset.idx77
  %31 = getelementptr inbounds i8, ptr %30, i64 16
  %wide.load78 = load <4 x i32>, ptr %30, align 4, !tbaa !5
  %wide.load79 = load <4 x i32>, ptr %31, align 4, !tbaa !5
  %32 = shl nsw <4 x i32> %wide.load78, <i32 1, i32 1, i32 1, i32 1>
  %33 = shl nsw <4 x i32> %wide.load79, <i32 1, i32 1, i32 1, i32 1>
  %34 = add nsw <4 x i32> %32, <i32 -1, i32 -1, i32 -1, i32 -1>
  %35 = add nsw <4 x i32> %33, <i32 -1, i32 -1, i32 -1, i32 -1>
  store <4 x i32> %34, ptr %30, align 4, !tbaa !5
  store <4 x i32> %35, ptr %31, align 4, !tbaa !5
  %36 = getelementptr inbounds [2000005 x i32], ptr @go_even, i64 0, i64 %offset.idx77
  %37 = getelementptr inbounds i8, ptr %36, i64 16
  %wide.load80 = load <4 x i32>, ptr %36, align 4, !tbaa !5
  %wide.load81 = load <4 x i32>, ptr %37, align 4, !tbaa !5
  %38 = shl nsw <4 x i32> %wide.load80, <i32 1, i32 1, i32 1, i32 1>
  %39 = shl nsw <4 x i32> %wide.load81, <i32 1, i32 1, i32 1, i32 1>
  store <4 x i32> %38, ptr %36, align 4, !tbaa !5
  store <4 x i32> %39, ptr %37, align 4, !tbaa !5
  %index.next82 = add nuw i64 %index76, 8
  %40 = icmp eq i64 %index.next82, %n.vec72
  br i1 %40, label %middle.block68, label %vector.body75, !llvm.loop !17

middle.block68:                                   ; preds = %vector.body75
  %cmp.n83 = icmp eq i64 %n.vec72, %29
  br i1 %cmp.n83, label %._crit_edge32, label %.lr.ph31.preheader102

.lr.ph:                                           ; preds = %.lr.ph.prol.loopexit, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next.3, %.lr.ph ], [ %indvars.iv.unr, %.lr.ph.prol.loopexit ]
  %41 = getelementptr inbounds [2000005 x i8], ptr @s, i64 0, i64 %indvars.iv
  %42 = load i8, ptr %41, align 1, !tbaa !9
  %43 = add nuw nsw i64 %indvars.iv, %3
  %44 = getelementptr inbounds [2000005 x i8], ptr @s, i64 0, i64 %43
  store i8 %42, ptr %44, align 1, !tbaa !9
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %45 = getelementptr inbounds [2000005 x i8], ptr @s, i64 0, i64 %indvars.iv.next
  %46 = load i8, ptr %45, align 1, !tbaa !9
  %47 = add nuw nsw i64 %indvars.iv.next, %3
  %48 = getelementptr inbounds [2000005 x i8], ptr @s, i64 0, i64 %47
  store i8 %46, ptr %48, align 1, !tbaa !9
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %49 = getelementptr inbounds [2000005 x i8], ptr @s, i64 0, i64 %indvars.iv.next.1
  %50 = load i8, ptr %49, align 1, !tbaa !9
  %51 = add nuw nsw i64 %indvars.iv.next.1, %3
  %52 = getelementptr inbounds [2000005 x i8], ptr @s, i64 0, i64 %51
  store i8 %50, ptr %52, align 1, !tbaa !9
  %indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
  %53 = getelementptr inbounds [2000005 x i8], ptr @s, i64 0, i64 %indvars.iv.next.2
  %54 = load i8, ptr %53, align 1, !tbaa !9
  %55 = add nuw nsw i64 %indvars.iv.next.2, %3
  %56 = getelementptr inbounds [2000005 x i8], ptr @s, i64 0, i64 %55
  store i8 %54, ptr %56, align 1, !tbaa !9
  %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
  %exitcond.not.3 = icmp eq i64 %indvars.iv.next.3, %wide.trip.count
  br i1 %exitcond.not.3, label %._crit_edge, label %.lr.ph, !llvm.loop !18

._crit_edge32:                                    ; preds = %.lr.ph31, %middle.block68, %._crit_edge
  tail call void @_Z8solveOddb(i1 noundef zeroext false)
  tail call void @_Z9solveEvenb(i1 noundef zeroext false)
  %57 = load i32, ptr @n, align 4, !tbaa !5
  %58 = shl nsw i32 %57, 1
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds i8, ptr @s, i64 %59
  %61 = getelementptr inbounds i8, ptr %60, i64 1
  tail call void @_ZSt7reverseIPcEvT_S1_(ptr noundef nonnull getelementptr inbounds (i8, ptr @s, i64 1), ptr noundef nonnull %61)
  %62 = load i32, ptr @n, align 4, !tbaa !5
  %63 = shl nsw i32 %62, 1
  store i32 %63, ptr @n, align 4, !tbaa !5
  tail call void @_Z8manacherv()
  %64 = load i32, ptr @n, align 4, !tbaa !5
  %65 = sdiv i32 %64, 2
  store i32 %65, ptr @n, align 4, !tbaa !5
  %.not2433 = icmp slt i32 %64, 2
  br i1 %.not2433, label %._crit_edge37, label %.lr.ph36.preheader

.lr.ph36.preheader:                               ; preds = %._crit_edge32
  %66 = shl nuw nsw i32 %65, 1
  %smax52 = tail call i32 @llvm.smax.i32(i32 %66, i32 1)
  %67 = add nuw nsw i32 %smax52, 1
  %wide.trip.count53 = zext nneg i32 %67 to i64
  %68 = zext nneg i32 %smax52 to i64
  %min.iters.check86 = icmp ult i32 %65, 4
  br i1 %min.iters.check86, label %.lr.ph36.preheader101, label %vector.ph87

.lr.ph36.preheader101:                            ; preds = %middle.block84, %.lr.ph36.preheader
  %indvars.iv49.ph = phi i64 [ 1, %.lr.ph36.preheader ], [ %ind.end90, %middle.block84 ]
  br label %.lr.ph36

vector.ph87:                                      ; preds = %.lr.ph36.preheader
  %n.vec89 = and i64 %68, 2147483640
  %ind.end90 = or disjoint i64 %n.vec89, 1
  br label %vector.body92

vector.body92:                                    ; preds = %vector.body92, %vector.ph87
  %index93 = phi i64 [ 0, %vector.ph87 ], [ %index.next99, %vector.body92 ]
  %offset.idx94 = or disjoint i64 %index93, 1
  %69 = getelementptr inbounds [2000005 x i32], ptr @go_odd, i64 0, i64 %offset.idx94
  %70 = getelementptr inbounds i8, ptr %69, i64 16
  %wide.load95 = load <4 x i32>, ptr %69, align 4, !tbaa !5
  %wide.load96 = load <4 x i32>, ptr %70, align 4, !tbaa !5
  %71 = shl nsw <4 x i32> %wide.load95, <i32 1, i32 1, i32 1, i32 1>
  %72 = shl nsw <4 x i32> %wide.load96, <i32 1, i32 1, i32 1, i32 1>
  %73 = add nsw <4 x i32> %71, <i32 -1, i32 -1, i32 -1, i32 -1>
  %74 = add nsw <4 x i32> %72, <i32 -1, i32 -1, i32 -1, i32 -1>
  store <4 x i32> %73, ptr %69, align 4, !tbaa !5
  store <4 x i32> %74, ptr %70, align 4, !tbaa !5
  %75 = getelementptr inbounds [2000005 x i32], ptr @go_even, i64 0, i64 %offset.idx94
  %76 = getelementptr inbounds i8, ptr %75, i64 16
  %wide.load97 = load <4 x i32>, ptr %75, align 4, !tbaa !5
  %wide.load98 = load <4 x i32>, ptr %76, align 4, !tbaa !5
  %77 = shl nsw <4 x i32> %wide.load97, <i32 1, i32 1, i32 1, i32 1>
  %78 = shl nsw <4 x i32> %wide.load98, <i32 1, i32 1, i32 1, i32 1>
  store <4 x i32> %77, ptr %75, align 4, !tbaa !5
  store <4 x i32> %78, ptr %76, align 4, !tbaa !5
  %index.next99 = add nuw i64 %index93, 8
  %79 = icmp eq i64 %index.next99, %n.vec89
  br i1 %79, label %middle.block84, label %vector.body92, !llvm.loop !19

middle.block84:                                   ; preds = %vector.body92
  %cmp.n100 = icmp eq i64 %n.vec89, %68
  br i1 %cmp.n100, label %._crit_edge37, label %.lr.ph36.preheader101

.lr.ph31:                                         ; preds = %.lr.ph31.preheader102, %.lr.ph31
  %indvars.iv44 = phi i64 [ %indvars.iv.next45, %.lr.ph31 ], [ %indvars.iv44.ph, %.lr.ph31.preheader102 ]
  %80 = getelementptr inbounds [2000005 x i32], ptr @go_odd, i64 0, i64 %indvars.iv44
  %81 = load i32, ptr %80, align 4, !tbaa !5
  %82 = shl nsw i32 %81, 1
  %83 = add nsw i32 %82, -1
  store i32 %83, ptr %80, align 4, !tbaa !5
  %84 = getelementptr inbounds [2000005 x i32], ptr @go_even, i64 0, i64 %indvars.iv44
  %85 = load i32, ptr %84, align 4, !tbaa !5
  %86 = shl nsw i32 %85, 1
  store i32 %86, ptr %84, align 4, !tbaa !5
  %indvars.iv.next45 = add nuw nsw i64 %indvars.iv44, 1
  %exitcond48.not = icmp eq i64 %indvars.iv.next45, %wide.trip.count47
  br i1 %exitcond48.not, label %._crit_edge32, label %.lr.ph31, !llvm.loop !20

._crit_edge37:                                    ; preds = %.lr.ph36, %middle.block84, %._crit_edge32
  tail call void @_Z8solveOddb(i1 noundef zeroext true)
  tail call void @_Z9solveEvenb(i1 noundef zeroext true)
  %87 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (i8, ptr @ans, i64 4), ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (i8, ptr @ans, i64 8000024))
  %88 = load i32, ptr %87, align 4, !tbaa !5
  %89 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %88)
  %90 = load i32, ptr @n, align 4, !tbaa !5
  %.not2538 = icmp slt i32 %90, 2
  br i1 %.not2538, label %._crit_edge42, label %.lr.ph41

.lr.ph36:                                         ; preds = %.lr.ph36.preheader101, %.lr.ph36
  %indvars.iv49 = phi i64 [ %indvars.iv.next50, %.lr.ph36 ], [ %indvars.iv49.ph, %.lr.ph36.preheader101 ]
  %91 = getelementptr inbounds [2000005 x i32], ptr @go_odd, i64 0, i64 %indvars.iv49
  %92 = load i32, ptr %91, align 4, !tbaa !5
  %93 = shl nsw i32 %92, 1
  %94 = add nsw i32 %93, -1
  store i32 %94, ptr %91, align 4, !tbaa !5
  %95 = getelementptr inbounds [2000005 x i32], ptr @go_even, i64 0, i64 %indvars.iv49
  %96 = load i32, ptr %95, align 4, !tbaa !5
  %97 = shl nsw i32 %96, 1
  store i32 %97, ptr %95, align 4, !tbaa !5
  %indvars.iv.next50 = add nuw nsw i64 %indvars.iv49, 1
  %exitcond54.not = icmp eq i64 %indvars.iv.next50, %wide.trip.count53
  br i1 %exitcond54.not, label %._crit_edge37, label %.lr.ph36, !llvm.loop !21

._crit_edge42:                                    ; preds = %.lr.ph41, %._crit_edge37
  ret i32 0

.lr.ph41:                                         ; preds = %._crit_edge37, %.lr.ph41
  %indvars.iv55 = phi i64 [ %indvars.iv.next56, %.lr.ph41 ], [ 2, %._crit_edge37 ]
  %98 = phi i32 [ %107, %.lr.ph41 ], [ %90, %._crit_edge37 ]
  %99 = getelementptr inbounds [2000005 x i32], ptr @ans, i64 0, i64 %indvars.iv55
  %100 = trunc nuw nsw i64 %indvars.iv55 to i32
  %reass.sub = sub i32 %98, %100
  %101 = add i32 %reass.sub, 2
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [2000005 x i32], ptr getelementptr inbounds (i8, ptr @ans, i64 8000020), i64 0, i64 %102
  %104 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %99, ptr noundef nonnull align 4 dereferenceable(4) %103)
  %105 = load i32, ptr %104, align 4, !tbaa !5
  %106 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %105)
  %indvars.iv.next56 = add nuw nsw i64 %indvars.iv55, 1
  %107 = load i32, ptr @n, align 4, !tbaa !5
  %108 = sext i32 %107 to i64
  %.not25.not = icmp slt i64 %indvars.iv55, %108
  br i1 %.not25.not, label %.lr.ph41, label %._crit_edge42, !llvm.loop !22
}

; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3

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

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3

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

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { 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 #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 = { nofree nounwind "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 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11, !12, !13}
!11 = !{!"llvm.loop.mustprogress"}
!12 = !{!"llvm.loop.isvectorized", i32 1}
!13 = !{!"llvm.loop.unroll.runtime.disable"}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.unroll.disable"}
!16 = distinct !{!16, !11, !12, !13}
!17 = distinct !{!17, !11, !12, !13}
!18 = distinct !{!18, !11, !12}
!19 = distinct !{!19, !11, !12, !13}
!20 = distinct !{!20, !11, !13, !12}
!21 = distinct !{!21, !11, !13, !12}
!22 = distinct !{!22, !11}


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