; LLVM IR from ShahjalalShohag/code-library :: Dynamic Programming Optimizations/Persistent Li Chao Tree.ll (Z3updi4Lineii)

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

%struct.LiChaoNode = type { %struct.Line, i32, i32 }
%struct.Line = type { i64, i64 }

@t = external dso_local global [5000450 x %struct.LiChaoNode], align 16
@T = external dso_local global i32, align 4

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z3updi4Lineii(i32 noundef %0, i64 %1, i64 %2, i32 noundef %3, i32 noundef %4) #0 {
  %6 = alloca i32, align 4
  %7 = alloca %struct.Line, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i8, align 1
  %14 = alloca i8, align 1
  %15 = alloca i32, align 4
  %16 = alloca %struct.LiChaoNode, align 8
  %17 = alloca %struct.Line, align 8
  %18 = alloca %struct.Line, align 8
  %19 = alloca %struct.LiChaoNode, align 8
  %20 = alloca %struct.Line, align 8
  %21 = alloca %struct.Line, align 8
  %22 = getelementptr inbounds { i64, i64 }, ptr %7, i32 0, i32 0
  store i64 %1, ptr %22, align 8
  %23 = getelementptr inbounds { i64, i64 }, ptr %7, i32 0, i32 1
  store i64 %2, ptr %23, align 8
  store i32 %0, ptr %8, align 4, !tbaa !5
  store i32 %3, ptr %9, align 4, !tbaa !5
  store i32 %4, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %24 = load i32, ptr %9, align 4, !tbaa !5
  %25 = load i32, ptr %10, align 4, !tbaa !5
  %26 = add nsw i32 %24, %25
  %27 = sdiv i32 %26, 2
  store i32 %27, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  %28 = load i32, ptr @T, align 4, !tbaa !5
  %29 = add nsw i32 %28, 1
  store i32 %29, ptr @T, align 4, !tbaa !5
  store i32 %29, ptr %12, align 4, !tbaa !5
  %30 = load i32, ptr %8, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [5000450 x %struct.LiChaoNode], ptr @t, i64 0, i64 %31
  %33 = getelementptr inbounds %struct.LiChaoNode, ptr %32, i32 0, i32 0
  %34 = load i32, ptr %12, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [5000450 x %struct.LiChaoNode], ptr @t, i64 0, i64 %35
  %37 = getelementptr inbounds %struct.LiChaoNode, ptr %36, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %37, ptr align 8 %33, i64 16, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %13) #5
  %38 = load i32, ptr %9, align 4, !tbaa !5
  %39 = sext i32 %38 to i64
  %40 = call noundef i64 @_ZN4Line4evalEx(ptr noundef nonnull align 8 dereferenceable(16) %7, i64 noundef %39)
  %41 = load i32, ptr %12, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [5000450 x %struct.LiChaoNode], ptr @t, i64 0, i64 %42
  %44 = getelementptr inbounds %struct.LiChaoNode, ptr %43, i32 0, i32 0
  %45 = load i32, ptr %9, align 4, !tbaa !5
  %46 = sext i32 %45 to i64
  %47 = call noundef i64 @_ZN4Line4evalEx(ptr noundef nonnull align 8 dereferenceable(16) %44, i64 noundef %46)
  %48 = icmp slt i64 %40, %47
  %49 = zext i1 %48 to i8
  store i8 %49, ptr %13, align 1, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 1, ptr %14) #5
  %50 = load i32, ptr %11, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  %52 = call noundef i64 @_ZN4Line4evalEx(ptr noundef nonnull align 8 dereferenceable(16) %7, i64 noundef %51)
  %53 = load i32, ptr %12, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [5000450 x %struct.LiChaoNode], ptr @t, i64 0, i64 %54
  %56 = getelementptr inbounds %struct.LiChaoNode, ptr %55, i32 0, i32 0
  %57 = load i32, ptr %11, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = call noundef i64 @_ZN4Line4evalEx(ptr noundef nonnull align 8 dereferenceable(16) %56, i64 noundef %58)
  %60 = icmp slt i64 %52, %59
  %61 = zext i1 %60 to i8
  store i8 %61, ptr %14, align 1, !tbaa !12
  %62 = load i8, ptr %14, align 1, !tbaa !12, !range !14, !noundef !15
  %63 = trunc i8 %62 to i1
  br i1 %63, label %64, label %69

64:                                               ; preds = %5
  %65 = load i32, ptr %12, align 4, !tbaa !5
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [5000450 x %struct.LiChaoNode], ptr @t, i64 0, i64 %66
  %68 = getelementptr inbounds %struct.LiChaoNode, ptr %67, i32 0, i32 0
  call void @_ZSt4swapI4LineENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS4_ESt18is_move_assignableIS4_EEE5valueEvE4typeERS4_SD_(ptr noundef nonnull align 8 dereferenceable(16) %68, ptr noundef nonnull align 8 dereferenceable(16) %7) #5
  br label %69

69:                                               ; preds = %64, %5
  %70 = load i32, ptr %9, align 4, !tbaa !5
  %71 = load i32, ptr %10, align 4, !tbaa !5
  %72 = icmp eq i32 %70, %71
  br i1 %72, label %73, label %75

73:                                               ; preds = %69
  %74 = load i32, ptr %12, align 4, !tbaa !5
  store i32 %74, ptr %6, align 4
  store i32 1, ptr %15, align 4
  br label %182

75:                                               ; preds = %69
  %76 = load i8, ptr %13, align 1, !tbaa !12, !range !14, !noundef !15
  %77 = trunc i8 %76 to i1
  %78 = zext i1 %77 to i32
  %79 = load i8, ptr %14, align 1, !tbaa !12, !range !14, !noundef !15
  %80 = trunc i8 %79 to i1
  %81 = zext i1 %80 to i32
  %82 = icmp ne i32 %78, %81
  br i1 %82, label %83, label %131

83:                                               ; preds = %75
  %84 = load i32, ptr %8, align 4, !tbaa !5
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [5000450 x %struct.LiChaoNode], ptr @t, i64 0, i64 %85
  %87 = getelementptr inbounds %struct.LiChaoNode, ptr %86, i32 0, i32 1
  %88 = load i32, ptr %87, align 8, !tbaa !16
  %89 = icmp ne i32 %88, 0
  br i1 %89, label %104, label %90

90:                                               ; preds = %83
  %91 = load i32, ptr @T, align 4, !tbaa !5
  %92 = add nsw i32 %91, 1
  store i32 %92, ptr @T, align 4, !tbaa !5
  %93 = load i32, ptr %12, align 4, !tbaa !5
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [5000450 x %struct.LiChaoNode], ptr @t, i64 0, i64 %94
  %96 = getelementptr inbounds %struct.LiChaoNode, ptr %95, i32 0, i32 1
  store i32 %92, ptr %96, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 24, ptr %16) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %17, ptr align 8 %7, i64 16, i1 false), !tbaa.struct !9
  %97 = getelementptr inbounds { i64, i64 }, ptr %17, i32 0, i32 0
  %98 = load i64, ptr %97, align 8
  %99 = getelementptr inbounds { i64, i64 }, ptr %17, i32 0, i32 1
  %100 = load i64, ptr %99, align 8
  call void @_ZN10LiChaoNodeC2E4Line(ptr noundef nonnull align 8 dereferenceable(24) %16, i64 %98, i64 %100)
  %101 = load i32, ptr @T, align 4, !tbaa !5
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [5000450 x %struct.LiChaoNode], ptr @t, i64 0, i64 %102
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %103, ptr align 8 %16, i64 24, i1 false), !tbaa.struct !19
  call void @llvm.lifetime.end.p0(i64 24, ptr %16) #5
  br label %121

104:                                              ; preds = %83
  %105 = load i32, ptr %8, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [5000450 x %struct.LiChaoNode], ptr @t, i64 0, i64 %106
  %108 = getelementptr inbounds %struct.LiChaoNode, ptr %107, i32 0, i32 1
  %109 = load i32, ptr %108, align 8, !tbaa !16
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %18, ptr align 8 %7, i64 16, i1 false), !tbaa.struct !9
  %110 = load i32, ptr %9, align 4, !tbaa !5
  %111 = load i32, ptr %11, align 4, !tbaa !5
  %112 = getelementptr inbounds { i64, i64 }, ptr %18, i32 0, i32 0
  %113 = load i64, ptr %112, align 8
  %114 = getelementptr inbounds { i64, i64 }, ptr %18, i32 0, i32 1
  %115 = load i64, ptr %114, align 8
  %116 = call noundef i32 @_Z3updi4Lineii(i32 noundef %109, i64 %113, i64 %115, i32 noundef %110, i32 noundef %111)
  %117 = load i32, ptr %12, align 4, !tbaa !5
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [5000450 x %struct.LiChaoNode], ptr @t, i64 0, i64 %118
  %120 = getelementptr inbounds %struct.LiChaoNode, ptr %119, i32 0, i32 1
  store i32 %116, ptr %120, align 8, !tbaa !16
  br label %121

121:                                              ; preds = %104, %90
  %122 = load i32, ptr %8, align 4, !tbaa !5
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds [5000450 x %struct.LiChaoNode], ptr @t, i64 0, i64 %123
  %125 = getelementptr inbounds %struct.LiChaoNode, ptr %124, i32 0, i32 2
  %126 = load i32, ptr %125, align 4, !tbaa !20
  %127 = load i32, ptr %12, align 4, !tbaa !5
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds [5000450 x %struct.LiChaoNode], ptr @t, i64 0, i64 %128
  %130 = getelementptr inbounds %struct.LiChaoNode, ptr %129, i32 0, i32 2
  store i32 %126, ptr %130, align 4, !tbaa !20
  br label %180

131:                                              ; preds = %75
  %132 = load i32, ptr %8, align 4, !tbaa !5
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds [5000450 x %struct.LiChaoNode], ptr @t, i64 0, i64 %133
  %135 = getelementptr inbounds %struct.LiChaoNode, ptr %134, i32 0, i32 2
  %136 = load i32, ptr %135, align 4, !tbaa !20
  %137 = icmp ne i32 %136, 0
  br i1 %137, label %152, label %138

138:                                              ; preds = %131
  %139 = load i32, ptr @T, align 4, !tbaa !5
  %140 = add nsw i32 %139, 1
  store i32 %140, ptr @T, align 4, !tbaa !5
  %141 = load i32, ptr %12, align 4, !tbaa !5
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds [5000450 x %struct.LiChaoNode], ptr @t, i64 0, i64 %142
  %144 = getelementptr inbounds %struct.LiChaoNode, ptr %143, i32 0, i32 2
  store i32 %140, ptr %144, align 4, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 24, ptr %19) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %20, ptr align 8 %7, i64 16, i1 false), !tbaa.struct !9
  %145 = getelementptr inbounds { i64, i64 }, ptr %20, i32 0, i32 0
  %146 = load i64, ptr %145, align 8
  %147 = getelementptr inbounds { i64, i64 }, ptr %20, i32 0, i32 1
  %148 = load i64, ptr %147, align 8
  call void @_ZN10LiChaoNodeC2E4Line(ptr noundef nonnull align 8 dereferenceable(24) %19, i64 %146, i64 %148)
  %149 = load i32, ptr @T, align 4, !tbaa !5
  %150 = sext i32 %149 to i64
  %151 = getelementptr inbounds [5000450 x %struct.LiChaoNode], ptr @t, i64 0, i64 %150
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %151, ptr align 8 %19, i64 24, i1 false), !tbaa.struct !19
  call void @llvm.lifetime.end.p0(i64 24, ptr %19) #5
  br label %170

152:                                              ; preds = %131
  %153 = load i32, ptr %8, align 4, !tbaa !5
  %154 = sext i32 %153 to i64
  %155 = getelementptr inbounds [5000450 x %struct.LiChaoNode], ptr @t, i64 0, i64 %154
  %156 = getelementptr inbounds %struct.LiChaoNode, ptr %155, i32 0, i32 2
  %157 = load i32, ptr %156, align 4, !tbaa !20
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %21, ptr align 8 %7, i64 16, i1 false), !tbaa.struct !9
  %158 = load i32, ptr %11, align 4, !tbaa !5
  %159 = add nsw i32 %158, 1
  %160 = load i32, ptr %10, align 4, !tbaa !5
  %161 = getelementptr inbounds { i64, i64 }, ptr %21, i32 0, i32 0
  %162 = load i64, ptr %161, align 8
  %163 = getelementptr inbounds { i64, i64 }, ptr %21, i32 0, i32 1
  %164 = load i64, ptr %163, align 8
  %165 = call noundef i32 @_Z3updi4Lineii(i32 noundef %157, i64 %162, i64 %164, i32 noundef %159, i32 noundef %160)
  %166 = load i32, ptr %12, align 4, !tbaa !5
  %167 = sext i32 %166 to i64
  %168 = getelementptr inbounds [5000450 x %struct.LiChaoNode], ptr @t, i64 0, i64 %167
  %169 = getelementptr inbounds %struct.LiChaoNode, ptr %168, i32 0, i32 2
  store i32 %165, ptr %169, align 4, !tbaa !20
  br label %170

170:                                              ; preds = %152, %138
  %171 = load i32, ptr %8, align 4, !tbaa !5
  %172 = sext i32 %171 to i64
  %173 = getelementptr inbounds [5000450 x %struct.LiChaoNode], ptr @t, i64 0, i64 %172
  %174 = getelementptr inbounds %struct.LiChaoNode, ptr %173, i32 0, i32 1
  %175 = load i32, ptr %174, align 8, !tbaa !16
  %176 = load i32, ptr %12, align 4, !tbaa !5
  %177 = sext i32 %176 to i64
  %178 = getelementptr inbounds [5000450 x %struct.LiChaoNode], ptr @t, i64 0, i64 %177
  %179 = getelementptr inbounds %struct.LiChaoNode, ptr %178, i32 0, i32 1
  store i32 %175, ptr %179, align 8, !tbaa !16
  br label %180

180:                                              ; preds = %170, %121
  %181 = load i32, ptr %12, align 4, !tbaa !5
  store i32 %181, ptr %6, align 4
  store i32 1, ptr %15, align 4
  br label %182

182:                                              ; preds = %180, %73
  call void @llvm.lifetime.end.p0(i64 1, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  %183 = load i32, ptr %6, align 4
  ret i32 %183
}

; 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 nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN4Line4evalEx(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef) #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZSt4swapI4LineENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS4_ESt18is_move_assignableIS4_EEE5valueEvE4typeERS4_SD_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN10LiChaoNodeC2E4Line(ptr noundef nonnull align 8 dereferenceable(24), i64, i64) unnamed_addr #3 align 2

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

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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 = { 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 #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 = !{i64 0, i64 8, !10, i64 8, i64 8, !10}
!10 = !{!11, !11, i64 0}
!11 = !{!"long long", !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"bool", !7, i64 0}
!14 = !{i8 0, i8 2}
!15 = !{}
!16 = !{!17, !6, i64 16}
!17 = !{!"_ZTS10LiChaoNode", !18, i64 0, !6, i64 16, !6, i64 20}
!18 = !{!"_ZTS4Line", !11, i64 0, !11, i64 8}
!19 = !{i64 0, i64 8, !10, i64 8, i64 8, !10, i64 16, i64 4, !5, i64 20, i64 4, !5}
!20 = !{!17, !6, i64 20}


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

%struct.LiChaoNode = type { %struct.Line, i32, i32 }
%struct.Line = type { i64, i64 }

@t = external dso_local global [5000450 x %struct.LiChaoNode], align 16
@T = external dso_local local_unnamed_addr global i32, align 4

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef range(i32 -2147483647, -2147483648) i32 @_Z3updi4Lineii(i32 noundef %0, i64 %1, i64 %2, i32 noundef %3, i32 noundef %4) local_unnamed_addr #0 {
  %6 = alloca %struct.Line, align 8
  %7 = alloca %struct.LiChaoNode, align 8
  %8 = alloca %struct.LiChaoNode, align 8
  store i64 %1, ptr %6, align 8
  %9 = getelementptr inbounds i8, ptr %6, i64 8
  store i64 %2, ptr %9, align 8
  %10 = add nsw i32 %4, %3
  %11 = sdiv i32 %10, 2
  %12 = load i32, ptr @T, align 4, !tbaa !5
  %13 = add nsw i32 %12, 1
  store i32 %13, ptr @T, align 4, !tbaa !5
  %14 = sext i32 %0 to i64
  %15 = getelementptr inbounds [5000450 x %struct.LiChaoNode], ptr @t, i64 0, i64 %14
  %16 = sext i32 %13 to i64
  %17 = getelementptr inbounds [5000450 x %struct.LiChaoNode], ptr @t, i64 0, i64 %16
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %17, ptr noundef nonnull align 8 dereferenceable(16) %15, i64 16, i1 false), !tbaa.struct !9
  %18 = sext i32 %3 to i64
  %19 = call noundef i64 @_ZN4Line4evalEx(ptr noundef nonnull align 8 dereferenceable(16) %6, i64 noundef %18)
  %20 = call noundef i64 @_ZN4Line4evalEx(ptr noundef nonnull align 8 dereferenceable(16) %17, i64 noundef %18)
  %21 = sext i32 %11 to i64
  %22 = call noundef i64 @_ZN4Line4evalEx(ptr noundef nonnull align 8 dereferenceable(16) %6, i64 noundef %21)
  %23 = call noundef i64 @_ZN4Line4evalEx(ptr noundef nonnull align 8 dereferenceable(16) %17, i64 noundef %21)
  %24 = icmp slt i64 %22, %23
  br i1 %24, label %25, label %26

25:                                               ; preds = %5
  call void @_ZSt4swapI4LineENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS4_ESt18is_move_assignableIS4_EEE5valueEvE4typeERS4_SD_(ptr noundef nonnull align 8 dereferenceable(16) %17, ptr noundef nonnull align 8 dereferenceable(16) %6) #4
  br label %26

26:                                               ; preds = %25, %5
  %27 = icmp eq i32 %3, %4
  br i1 %27, label %64, label %28

28:                                               ; preds = %26
  %29 = icmp sge i64 %19, %20
  %.not = xor i1 %29, %24
  br i1 %.not, label %46, label %30

30:                                               ; preds = %28
  %31 = getelementptr inbounds i8, ptr %15, i64 16
  %32 = load i32, ptr %31, align 8, !tbaa !12
  %.not45 = icmp eq i32 %32, 0
  %33 = getelementptr inbounds i8, ptr %17, i64 16
  br i1 %.not45, label %34, label %40

34:                                               ; preds = %30
  %35 = load i32, ptr @T, align 4, !tbaa !5
  %36 = add nsw i32 %35, 1
  store i32 %36, ptr @T, align 4, !tbaa !5
  store i32 %36, ptr %33, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #4
  %.sroa.05.0.copyload = load i64, ptr %6, align 8, !tbaa !10
  %.sroa.26.0.copyload = load i64, ptr %9, align 8, !tbaa !10
  call void @_ZN10LiChaoNodeC2E4Line(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 %.sroa.05.0.copyload, i64 %.sroa.26.0.copyload)
  %37 = load i32, ptr @T, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [5000450 x %struct.LiChaoNode], ptr @t, i64 0, i64 %38
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %39, ptr noundef nonnull align 8 dereferenceable(24) %7, i64 24, i1 false), !tbaa.struct !15
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #4
  br label %42

40:                                               ; preds = %30
  %.sroa.03.0.copyload = load i64, ptr %6, align 8, !tbaa !10
  %.sroa.24.0.copyload = load i64, ptr %9, align 8, !tbaa !10
  %41 = call noundef i32 @_Z3updi4Lineii(i32 noundef %32, i64 %.sroa.03.0.copyload, i64 %.sroa.24.0.copyload, i32 noundef %3, i32 noundef %11)
  store i32 %41, ptr %33, align 8, !tbaa !12
  br label %42

42:                                               ; preds = %40, %34
  %43 = getelementptr inbounds i8, ptr %15, i64 20
  %44 = load i32, ptr %43, align 4, !tbaa !16
  %45 = getelementptr inbounds i8, ptr %17, i64 20
  store i32 %44, ptr %45, align 4, !tbaa !16
  br label %64

46:                                               ; preds = %28
  %47 = getelementptr inbounds i8, ptr %15, i64 20
  %48 = load i32, ptr %47, align 4, !tbaa !16
  %.not44 = icmp eq i32 %48, 0
  br i1 %.not44, label %49, label %56

49:                                               ; preds = %46
  %50 = load i32, ptr @T, align 4, !tbaa !5
  %51 = add nsw i32 %50, 1
  store i32 %51, ptr @T, align 4, !tbaa !5
  %52 = getelementptr inbounds i8, ptr %17, i64 20
  store i32 %51, ptr %52, align 4, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #4
  %.sroa.01.0.copyload = load i64, ptr %6, align 8, !tbaa !10
  %.sroa.22.0.copyload = load i64, ptr %9, align 8, !tbaa !10
  call void @_ZN10LiChaoNodeC2E4Line(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 %.sroa.01.0.copyload, i64 %.sroa.22.0.copyload)
  %53 = load i32, ptr @T, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [5000450 x %struct.LiChaoNode], ptr @t, i64 0, i64 %54
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %55, ptr noundef nonnull align 8 dereferenceable(24) %8, i64 24, i1 false), !tbaa.struct !15
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #4
  br label %60

56:                                               ; preds = %46
  %.sroa.0.0.copyload = load i64, ptr %6, align 8, !tbaa !10
  %.sroa.2.0.copyload = load i64, ptr %9, align 8, !tbaa !10
  %57 = add nsw i32 %11, 1
  %58 = call noundef i32 @_Z3updi4Lineii(i32 noundef %48, i64 %.sroa.0.0.copyload, i64 %.sroa.2.0.copyload, i32 noundef %57, i32 noundef %4)
  %59 = getelementptr inbounds i8, ptr %17, i64 20
  store i32 %58, ptr %59, align 4, !tbaa !16
  br label %60

60:                                               ; preds = %56, %49
  %61 = getelementptr inbounds i8, ptr %15, i64 16
  %62 = load i32, ptr %61, align 8, !tbaa !12
  %63 = getelementptr inbounds i8, ptr %17, i64 16
  store i32 %62, ptr %63, align 8, !tbaa !12
  br label %64

64:                                               ; preds = %42, %60, %26
  ret i32 %13
}

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN4Line4evalEx(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZSt4swapI4LineENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS4_ESt18is_move_assignableIS4_EEE5valueEvE4typeERS4_SD_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN10LiChaoNodeC2E4Line(ptr noundef nonnull align 8 dereferenceable(24), i64, i64) unnamed_addr #0 align 2

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

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 nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree 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 = !{i64 0, i64 8, !10, i64 8, i64 8, !10}
!10 = !{!11, !11, i64 0}
!11 = !{!"long long", !7, i64 0}
!12 = !{!13, !6, i64 16}
!13 = !{!"_ZTS10LiChaoNode", !14, i64 0, !6, i64 16, !6, i64 20}
!14 = !{!"_ZTS4Line", !11, i64 0, !11, i64 8}
!15 = !{i64 0, i64 8, !10, i64 8, i64 8, !10, i64 16, i64 4, !5, i64 20, i64 4, !5}
!16 = !{!13, !6, i64 20}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass