; LLVM IR from imeplusplus/icpc-notebook :: data-structures (ita_lichao)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%class.LiChao = type { %"class.std::vector", %"class.std::vector", i32, i32, ptr }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@w = external dso_local global [1009 x i64], align 16
@x = external dso_local global [1009 x i64], align 16
@A = external dso_local global [1009 x i64], align 16
@B = external dso_local global [1009 x i64], align 16
@dp = external dso_local global [1009 x [1009 x i64]], align 16
@.str = external hidden unnamed_addr constant [6 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 personality ptr @__gxx_personality_v0 {
  %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 %class.LiChao, align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  br label %11

11:                                               ; preds = %168, %0
  %12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2, ptr noundef %3)
  %13 = icmp ne i32 %12, -1
  br i1 %13, label %14, label %178

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

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

19:                                               ; preds = %15
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  br label %92

20:                                               ; preds = %15
  %21 = load i32, ptr %4, align 4, !tbaa !5
  %22 = sext i32 %21 to i64
  %23 = getelementptr inbounds i64, ptr @x, i64 %22
  %24 = load i32, ptr %4, align 4, !tbaa !5
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds i64, ptr @w, i64 %25
  %27 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %23, ptr noundef %26)
  %28 = load i32, ptr %4, align 4, !tbaa !5
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds [1009 x i64], ptr @w, i64 0, i64 %29
  %31 = load i64, ptr %30, align 8, !tbaa !9
  %32 = load i32, ptr %4, align 4, !tbaa !5
  %33 = icmp sgt i32 %32, 0
  br i1 %33, label %34, label %40

34:                                               ; preds = %20
  %35 = load i32, ptr %4, align 4, !tbaa !5
  %36 = sub nsw i32 %35, 1
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [1009 x i64], ptr @A, i64 0, i64 %37
  %39 = load i64, ptr %38, align 8, !tbaa !9
  br label %41

40:                                               ; preds = %20
  br label %41

41:                                               ; preds = %40, %34
  %42 = phi i64 [ %39, %34 ], [ 0, %40 ]
  %43 = add nsw i64 %31, %42
  %44 = load i32, ptr %4, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [1009 x i64], ptr @A, i64 0, i64 %45
  store i64 %43, ptr %46, align 8, !tbaa !9
  %47 = load i32, ptr %4, align 4, !tbaa !5
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [1009 x i64], ptr @w, i64 0, i64 %48
  %50 = load i64, ptr %49, align 8, !tbaa !9
  %51 = load i32, ptr %4, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [1009 x i64], ptr @x, i64 0, i64 %52
  %54 = load i64, ptr %53, align 8, !tbaa !9
  %55 = mul nsw i64 %50, %54
  %56 = load i32, ptr %4, align 4, !tbaa !5
  %57 = icmp sgt i32 %56, 0
  br i1 %57, label %58, label %64

58:                                               ; preds = %41
  %59 = load i32, ptr %4, align 4, !tbaa !5
  %60 = sub nsw i32 %59, 1
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [1009 x i64], ptr @B, i64 0, i64 %61
  %63 = load i64, ptr %62, align 8, !tbaa !9
  br label %65

64:                                               ; preds = %41
  br label %65

65:                                               ; preds = %64, %58
  %66 = phi i64 [ %63, %58 ], [ 0, %64 ]
  %67 = add nsw i64 %55, %66
  %68 = load i32, ptr %4, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [1009 x i64], ptr @B, i64 0, i64 %69
  store i64 %67, ptr %70, align 8, !tbaa !9
  %71 = load i32, ptr %4, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [1009 x i64], ptr @x, i64 0, i64 %72
  %74 = load i64, ptr %73, align 8, !tbaa !9
  %75 = load i32, ptr %4, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [1009 x i64], ptr @A, i64 0, i64 %76
  %78 = load i64, ptr %77, align 8, !tbaa !9
  %79 = mul nsw i64 %74, %78
  %80 = load i32, ptr %4, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [1009 x i64], ptr @B, i64 0, i64 %81
  %83 = load i64, ptr %82, align 8, !tbaa !9
  %84 = sub nsw i64 %79, %83
  %85 = load i32, ptr %4, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [1009 x [1009 x i64]], ptr @dp, i64 0, i64 %86
  %88 = getelementptr inbounds [1009 x i64], ptr %87, i64 0, i64 1
  store i64 %84, ptr %88, align 8, !tbaa !9
  br label %89

89:                                               ; preds = %65
  %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 %15, !llvm.loop !11

92:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  store i32 2, ptr %5, align 4, !tbaa !5
  br label %93

93:                                               ; preds = %165, %92
  %94 = load i32, ptr %5, align 4, !tbaa !5
  %95 = load i32, ptr %3, align 4, !tbaa !5
  %96 = icmp sle i32 %94, %95
  br i1 %96, label %98, label %97

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

98:                                               ; preds = %93
  %99 = load i32, ptr %5, align 4, !tbaa !5
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [1009 x i64], ptr @dp, i64 0, i64 %100
  store i64 0, ptr %101, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 64, ptr %7) #5
  %102 = load i32, ptr %2, align 4, !tbaa !5
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds i64, ptr @x, i64 %103
  call void @_ZN6LiChaoC2EPxS0_(ptr noundef nonnull align 8 dereferenceable(64) %7, ptr noundef @x, ptr noundef %104)
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 1, ptr %8, align 4, !tbaa !5
  br label %105

105:                                              ; preds = %157, %98
  %106 = load i32, ptr %8, align 4, !tbaa !5
  %107 = load i32, ptr %2, align 4, !tbaa !5
  %108 = icmp slt i32 %106, %107
  br i1 %108, label %110, label %109

109:                                              ; preds = %105
  store i32 10, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %164

110:                                              ; preds = %105
  %111 = load i32, ptr %8, align 4, !tbaa !5
  %112 = sub nsw i32 %111, 1
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds [1009 x i64], ptr @A, i64 0, i64 %113
  %115 = load i64, ptr %114, align 8, !tbaa !9
  %116 = load i32, ptr %8, align 4, !tbaa !5
  %117 = sub nsw i32 %116, 1
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [1009 x [1009 x i64]], ptr @dp, i64 0, i64 %118
  %120 = load i32, ptr %5, align 4, !tbaa !5
  %121 = sub nsw i32 %120, 1
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds [1009 x i64], ptr %119, i64 0, i64 %122
  %124 = load i64, ptr %123, align 8, !tbaa !9
  %125 = sub nsw i64 0, %124
  %126 = load i32, ptr %8, align 4, !tbaa !5
  %127 = sub nsw i32 %126, 1
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds [1009 x i64], ptr @B, i64 0, i64 %128
  %130 = load i64, ptr %129, align 8, !tbaa !9
  %131 = sub nsw i64 %125, %130
  invoke void @_ZN6LiChao11insert_lineExx(ptr noundef nonnull align 8 dereferenceable(64) %7, i64 noundef %115, i64 noundef %131)
          to label %132 unwind label %160

132:                                              ; preds = %110
  %133 = load i32, ptr %8, align 4, !tbaa !5
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds [1009 x i64], ptr @x, i64 0, i64 %134
  %136 = load i64, ptr %135, align 8, !tbaa !9
  %137 = load i32, ptr %8, align 4, !tbaa !5
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds [1009 x i64], ptr @A, i64 0, i64 %138
  %140 = load i64, ptr %139, align 8, !tbaa !9
  %141 = mul nsw i64 %136, %140
  %142 = load i32, ptr %8, align 4, !tbaa !5
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds [1009 x i64], ptr @B, i64 0, i64 %143
  %145 = load i64, ptr %144, align 8, !tbaa !9
  %146 = sub nsw i64 %141, %145
  %147 = load i32, ptr %8, align 4, !tbaa !5
  %148 = invoke noundef i64 @_ZN6LiChao5queryEi(ptr noundef nonnull align 8 dereferenceable(64) %7, i32 noundef %147)
          to label %149 unwind label %160

149:                                              ; preds = %132
  %150 = sub nsw i64 %146, %148
  %151 = load i32, ptr %8, align 4, !tbaa !5
  %152 = sext i32 %151 to i64
  %153 = getelementptr inbounds [1009 x [1009 x i64]], ptr @dp, i64 0, i64 %152
  %154 = load i32, ptr %5, align 4, !tbaa !5
  %155 = sext i32 %154 to i64
  %156 = getelementptr inbounds [1009 x i64], ptr %153, i64 0, i64 %155
  store i64 %150, ptr %156, align 8, !tbaa !9
  br label %157

157:                                              ; preds = %149
  %158 = load i32, ptr %8, align 4, !tbaa !5
  %159 = add nsw i32 %158, 1
  store i32 %159, ptr %8, align 4, !tbaa !5
  br label %105, !llvm.loop !13

160:                                              ; preds = %132, %110
  %161 = landingpad { ptr, i32 }
          cleanup
  %162 = extractvalue { ptr, i32 } %161, 0
  store ptr %162, ptr %9, align 8
  %163 = extractvalue { ptr, i32 } %161, 1
  store i32 %163, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @_ZN6LiChaoD2Ev(ptr noundef nonnull align 8 dereferenceable(64) %7) #5
  call void @llvm.lifetime.end.p0(i64 64, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  br label %180

164:                                              ; preds = %109
  call void @_ZN6LiChaoD2Ev(ptr noundef nonnull align 8 dereferenceable(64) %7) #5
  call void @llvm.lifetime.end.p0(i64 64, ptr %7) #5
  br label %165

165:                                              ; preds = %164
  %166 = load i32, ptr %5, align 4, !tbaa !5
  %167 = add nsw i32 %166, 1
  store i32 %167, ptr %5, align 4, !tbaa !5
  br label %93, !llvm.loop !14

168:                                              ; preds = %97
  %169 = load i32, ptr %2, align 4, !tbaa !5
  %170 = sub nsw i32 %169, 1
  %171 = sext i32 %170 to i64
  %172 = getelementptr inbounds [1009 x [1009 x i64]], ptr @dp, i64 0, i64 %171
  %173 = load i32, ptr %3, align 4, !tbaa !5
  %174 = sext i32 %173 to i64
  %175 = getelementptr inbounds [1009 x i64], ptr %172, i64 0, i64 %174
  %176 = load i64, ptr %175, align 8, !tbaa !9
  %177 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i64 noundef %176)
  br label %11, !llvm.loop !15

178:                                              ; preds = %11
  store i32 0, ptr %1, align 4
  store i32 1, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  %179 = load i32, ptr %1, align 4
  ret i32 %179

180:                                              ; preds = %160
  %181 = load ptr, ptr %9, align 8
  %182 = load i32, ptr %10, align 4
  %183 = insertvalue { ptr, i32 } poison, ptr %181, 0
  %184 = insertvalue { ptr, i32 } %183, i32 %182, 1
  resume { ptr, i32 } %184
}

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6LiChaoC2EPxS0_(ptr noundef nonnull align 8 dereferenceable(64), ptr noundef, ptr noundef) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6LiChao11insert_lineExx(ptr noundef nonnull align 8 dereferenceable(64), i64 noundef, i64 noundef) #3 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZN6LiChao5queryEi(ptr noundef nonnull align 8 dereferenceable(64), i32 noundef) #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN6LiChaoD2Ev(ptr noundef nonnull align 8 dereferenceable(64)) unnamed_addr #4 align 2

declare i32 @printf(ptr noundef, ...) #2

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


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%class.LiChao = type { %"class.std::vector", %"class.std::vector", i32, i32, ptr }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@w = external dso_local global [1009 x i64], align 16
@x = external dso_local global [1009 x i64], align 16
@A = external dso_local local_unnamed_addr global [1009 x i64], align 16
@B = external dso_local local_unnamed_addr global [1009 x i64], align 16
@dp = external dso_local local_unnamed_addr global [1009 x [1009 x i64]], align 16
@.str = external hidden unnamed_addr constant [6 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca %class.LiChao, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #5
  %4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1, ptr noundef nonnull %2)
  %.not50 = icmp eq i32 %4, -1
  br i1 %.not50, label %._crit_edge51, label %.preheader41

.preheader41:                                     ; preds = %0, %._crit_edge49
  %5 = load i32, ptr %1, align 4, !tbaa !5
  %6 = icmp sgt i32 %5, 0
  br i1 %6, label %7, label %.preheader

7:                                                ; preds = %.preheader41
  %8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @x, ptr noundef nonnull @w)
  %9 = load i64, ptr @w, align 16, !tbaa !9
  store i64 %9, ptr @A, align 16
  %10 = load i64, ptr @x, align 16, !tbaa !9
  %11 = mul nsw i64 %10, %9
  store i64 %11, ptr @B, align 16, !tbaa !9
  store i64 0, ptr getelementptr inbounds (i8, ptr @dp, i64 8), align 8, !tbaa !9
  %12 = load i32, ptr %1, align 4, !tbaa !5
  %13 = icmp sgt i32 %12, 1
  br i1 %13, label %.lr.ph.peel.next, label %.preheader

.preheader:                                       ; preds = %.lr.ph.peel.next, %7, %.preheader41
  %14 = phi i32 [ %5, %.preheader41 ], [ %12, %7 ], [ %34, %.lr.ph.peel.next ]
  %15 = load i32, ptr %2, align 4, !tbaa !5
  %.not3746 = icmp slt i32 %15, 2
  br i1 %.not3746, label %.preheader.._crit_edge49_crit_edge, label %.lr.ph48

.preheader.._crit_edge49_crit_edge:               ; preds = %.preheader
  %.pre62 = sext i32 %15 to i64
  br label %._crit_edge49

.lr.ph.peel.next:                                 ; preds = %7, %.lr.ph.peel.next
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph.peel.next ], [ 1, %7 ]
  %16 = getelementptr inbounds i64, ptr @x, i64 %indvars.iv
  %17 = getelementptr inbounds i64, ptr @w, i64 %indvars.iv
  %18 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %16, ptr noundef nonnull %17)
  %19 = load i64, ptr %17, align 8, !tbaa !9
  %20 = add nsw i64 %indvars.iv, -1
  %21 = getelementptr inbounds [1009 x i64], ptr @B, i64 0, i64 %20
  %22 = load i64, ptr %21, align 8, !tbaa !9
  %23 = getelementptr inbounds [1009 x i64], ptr @A, i64 0, i64 %20
  %24 = load i64, ptr %23, align 8, !tbaa !9
  %25 = add nsw i64 %24, %19
  %26 = getelementptr inbounds [1009 x i64], ptr @A, i64 0, i64 %indvars.iv
  store i64 %25, ptr %26, align 8
  %27 = load i64, ptr %16, align 8, !tbaa !9
  %28 = mul nsw i64 %27, %19
  %29 = add nsw i64 %28, %22
  %30 = getelementptr inbounds [1009 x i64], ptr @B, i64 0, i64 %indvars.iv
  store i64 %29, ptr %30, align 8, !tbaa !9
  %31 = mul nsw i64 %27, %25
  %32 = sub nsw i64 %31, %29
  %33 = getelementptr inbounds [1009 x [1009 x i64]], ptr @dp, i64 0, i64 %indvars.iv, i64 1
  store i64 %32, ptr %33, align 8, !tbaa !9
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %34 = load i32, ptr %1, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = icmp slt i64 %indvars.iv.next, %35
  br i1 %36, label %.lr.ph.peel.next, label %.preheader, !llvm.loop !11

._crit_edge49.loopexit:                           ; preds = %._crit_edge
  %.pre = load i32, ptr %1, align 4, !tbaa !5
  br label %._crit_edge49

._crit_edge49:                                    ; preds = %.preheader.._crit_edge49_crit_edge, %._crit_edge49.loopexit
  %.pre-phi = phi i64 [ %.pre62, %.preheader.._crit_edge49_crit_edge ], [ %52, %._crit_edge49.loopexit ]
  %37 = phi i32 [ %14, %.preheader.._crit_edge49_crit_edge ], [ %.pre, %._crit_edge49.loopexit ]
  %38 = add nsw i32 %37, -1
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds [1009 x [1009 x i64]], ptr @dp, i64 0, i64 %39, i64 %.pre-phi
  %41 = load i64, ptr %40, align 8, !tbaa !9
  %42 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %41)
  %43 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1, ptr noundef nonnull %2)
  %.not = icmp eq i32 %43, -1
  br i1 %.not, label %._crit_edge51, label %.preheader41, !llvm.loop !14

.lr.ph48:                                         ; preds = %.preheader, %._crit_edge
  %indvars.iv58 = phi i64 [ %indvars.iv.next59, %._crit_edge ], [ 2, %.preheader ]
  %44 = getelementptr inbounds [1009 x i64], ptr @dp, i64 0, i64 %indvars.iv58
  store i64 0, ptr %44, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %3) #5
  %45 = load i32, ptr %1, align 4, !tbaa !5
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds i64, ptr @x, i64 %46
  call void @_ZN6LiChaoC2EPxS0_(ptr noundef nonnull align 8 dereferenceable(64) %3, ptr noundef nonnull @x, ptr noundef nonnull %47)
  %48 = load i32, ptr %1, align 4, !tbaa !5
  %49 = icmp sgt i32 %48, 1
  br i1 %49, label %.lr.ph45, label %._crit_edge

.lr.ph45:                                         ; preds = %.lr.ph48
  %50 = add nsw i64 %indvars.iv58, -1
  br label %53

._crit_edge:                                      ; preds = %72, %.lr.ph48
  call void @_ZN6LiChaoD2Ev(ptr noundef nonnull align 8 dereferenceable(64) %3) #5
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %3) #5
  %indvars.iv.next59 = add nuw nsw i64 %indvars.iv58, 1
  %51 = load i32, ptr %2, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %.not37.not = icmp slt i64 %indvars.iv58, %52
  br i1 %.not37.not, label %.lr.ph48, label %._crit_edge49.loopexit, !llvm.loop !15

53:                                               ; preds = %.lr.ph45, %72
  %indvars.iv55 = phi i64 [ 1, %.lr.ph45 ], [ %indvars.iv.next56, %72 ]
  %54 = add nsw i64 %indvars.iv55, -1
  %55 = getelementptr inbounds [1009 x i64], ptr @A, i64 0, i64 %54
  %56 = load i64, ptr %55, align 8, !tbaa !9
  %57 = getelementptr inbounds [1009 x [1009 x i64]], ptr @dp, i64 0, i64 %54, i64 %50
  %58 = load i64, ptr %57, align 8, !tbaa !9
  %59 = getelementptr inbounds [1009 x i64], ptr @B, i64 0, i64 %54
  %60 = load i64, ptr %59, align 8, !tbaa !9
  %61 = add i64 %58, %60
  %62 = sub i64 0, %61
  invoke void @_ZN6LiChao11insert_lineExx(ptr noundef nonnull align 8 dereferenceable(64) %3, i64 noundef %56, i64 noundef %62)
          to label %63 unwind label %80

63:                                               ; preds = %53
  %64 = getelementptr inbounds [1009 x i64], ptr @x, i64 0, i64 %indvars.iv55
  %65 = load i64, ptr %64, align 8, !tbaa !9
  %66 = getelementptr inbounds [1009 x i64], ptr @A, i64 0, i64 %indvars.iv55
  %67 = load i64, ptr %66, align 8, !tbaa !9
  %68 = getelementptr inbounds [1009 x i64], ptr @B, i64 0, i64 %indvars.iv55
  %69 = load i64, ptr %68, align 8, !tbaa !9
  %70 = trunc nuw nsw i64 %indvars.iv55 to i32
  %71 = invoke noundef i64 @_ZN6LiChao5queryEi(ptr noundef nonnull align 8 dereferenceable(64) %3, i32 noundef %70)
          to label %72 unwind label %80

72:                                               ; preds = %63
  %73 = mul nsw i64 %67, %65
  %74 = add i64 %69, %71
  %75 = sub i64 %73, %74
  %76 = getelementptr inbounds [1009 x [1009 x i64]], ptr @dp, i64 0, i64 %indvars.iv55, i64 %indvars.iv58
  store i64 %75, ptr %76, align 8, !tbaa !9
  %indvars.iv.next56 = add nuw nsw i64 %indvars.iv55, 1
  %77 = load i32, ptr %1, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = icmp slt i64 %indvars.iv.next56, %78
  br i1 %79, label %53, label %._crit_edge, !llvm.loop !16

80:                                               ; preds = %63, %53
  %81 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN6LiChaoD2Ev(ptr noundef nonnull align 8 dereferenceable(64) %3) #5
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %3) #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
  resume { ptr, i32 } %81

._crit_edge51:                                    ; preds = %._crit_edge49, %0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  ret i32 0
}

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6LiChaoC2EPxS0_(ptr noundef nonnull align 8 dereferenceable(64), ptr noundef, ptr noundef) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6LiChao11insert_lineExx(ptr noundef nonnull align 8 dereferenceable(64), i64 noundef, i64 noundef) local_unnamed_addr #3 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZN6LiChao5queryEi(ptr noundef nonnull align 8 dereferenceable(64), i32 noundef) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN6LiChaoD2Ev(ptr noundef nonnull align 8 dereferenceable(64)) unnamed_addr #4 align 2

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

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


; Effective O3 passes: BDCEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopFullUnrollPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,MergedLoadStoreMotionPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass