; LLVM IR from tangjz/acm-icpc :: TDL_training/2016-04-04 (H - Laser Cutter - lzy)

; 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.Point = type { i32, i32 }

@s = external dso_local global [309 x %struct.Point], align 16
@t = external dso_local global [309 x %struct.Point], align 16
@n = external dso_local global i32, align 4
@g = external dso_local global [309 x [309 x double]], align 16
@lbx = external dso_local global [309 x double], align 16
@slk = external dso_local global [309 x double], align 16
@mat = external dso_local global [309 x i32], align 16
@usx = external dso_local global [309 x i8], align 16
@usy = external dso_local global [309 x i8], align 16
@ans = external dso_local global double, align 8
@.str = external hidden unnamed_addr constant [9 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_Z3dis5PointS_(i64, i64) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z3dngRdd(ptr noundef nonnull align 8 dereferenceable(8), double noundef) #0

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z3augi(i32 noundef) #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: mustprogress nounwind uwtable
declare dso_local void @_Z3adjv() #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 %struct.Point, align 4
  %4 = alloca %struct.Point, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca %struct.Point, align 4
  %9 = alloca %struct.Point, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %13 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %14

14:                                               ; preds = %48, %0
  %15 = load i32, ptr %2, align 4, !tbaa !5
  %16 = load i32, ptr @n, align 4, !tbaa !5
  %17 = icmp sle i32 %15, %16
  br i1 %17, label %19, label %18

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

19:                                               ; preds = %14
  %20 = load i32, ptr %2, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds [309 x %struct.Point], ptr @s, i64 0, i64 %21
  %23 = getelementptr inbounds %struct.Point, ptr %22, i32 0, i32 0
  %24 = load i32, ptr %2, align 4, !tbaa !5
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds [309 x %struct.Point], ptr @s, i64 0, i64 %25
  %27 = getelementptr inbounds %struct.Point, ptr %26, i32 0, i32 1
  %28 = load i32, ptr %2, align 4, !tbaa !5
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds [309 x %struct.Point], ptr @t, i64 0, i64 %29
  %31 = getelementptr inbounds %struct.Point, ptr %30, i32 0, i32 0
  %32 = load i32, ptr %2, align 4, !tbaa !5
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [309 x %struct.Point], ptr @t, i64 0, i64 %33
  %35 = getelementptr inbounds %struct.Point, ptr %34, i32 0, i32 1
  %36 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %23, ptr noundef %27, ptr noundef %31, ptr noundef %35)
  %37 = load i32, ptr %2, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [309 x %struct.Point], ptr @s, i64 0, i64 %38
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %3, ptr align 8 %39, i64 8, i1 false), !tbaa.struct !9
  %40 = load i32, ptr %2, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [309 x %struct.Point], ptr @t, i64 0, i64 %41
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %4, ptr align 8 %42, i64 8, i1 false), !tbaa.struct !9
  %43 = load i64, ptr %3, align 4
  %44 = load i64, ptr %4, align 4
  %45 = call noundef double @_Z3dis5PointS_(i64 %43, i64 %44)
  %46 = load double, ptr @ans, align 8, !tbaa !10
  %47 = fadd double %46, %45
  store double %47, ptr @ans, align 8, !tbaa !10
  br label %48

48:                                               ; preds = %19
  %49 = load i32, ptr %2, align 4, !tbaa !5
  %50 = add nsw i32 %49, 1
  store i32 %50, ptr %2, align 4, !tbaa !5
  br label %14, !llvm.loop !12

51:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  store i32 1, ptr %5, align 4, !tbaa !5
  br label %52

52:                                               ; preds = %96, %51
  %53 = load i32, ptr %5, align 4, !tbaa !5
  %54 = load i32, ptr @n, align 4, !tbaa !5
  %55 = icmp sle i32 %53, %54
  br i1 %55, label %57, label %56

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

57:                                               ; preds = %52
  %58 = load i32, ptr %5, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [309 x double], ptr @lbx, i64 0, i64 %59
  store double 1.000000e+08, ptr %60, align 8, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  store i32 1, ptr %7, align 4, !tbaa !5
  br label %61

61:                                               ; preds = %92, %57
  %62 = load i32, ptr %7, align 4, !tbaa !5
  %63 = load i32, ptr @n, align 4, !tbaa !5
  %64 = icmp sle i32 %62, %63
  br i1 %64, label %66, label %65

65:                                               ; preds = %61
  store i32 8, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  br label %95

66:                                               ; preds = %61
  %67 = load i32, ptr %5, align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [309 x %struct.Point], ptr @t, i64 0, i64 %68
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %8, ptr align 8 %69, i64 8, i1 false), !tbaa.struct !9
  %70 = load i32, ptr %7, align 4, !tbaa !5
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [309 x %struct.Point], ptr @s, i64 0, i64 %71
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %9, ptr align 8 %72, i64 8, i1 false), !tbaa.struct !9
  %73 = load i64, ptr %8, align 4
  %74 = load i64, ptr %9, align 4
  %75 = call noundef double @_Z3dis5PointS_(i64 %73, i64 %74)
  %76 = load i32, ptr %5, align 4, !tbaa !5
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [309 x [309 x double]], ptr @g, i64 0, i64 %77
  %79 = load i32, ptr %7, align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [309 x double], ptr %78, i64 0, i64 %80
  store double %75, ptr %81, align 8, !tbaa !10
  %82 = load i32, ptr %5, align 4, !tbaa !5
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [309 x double], ptr @lbx, i64 0, i64 %83
  %85 = load i32, ptr %5, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [309 x [309 x double]], ptr @g, i64 0, i64 %86
  %88 = load i32, ptr %7, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [309 x double], ptr %87, i64 0, i64 %89
  %91 = load double, ptr %90, align 8, !tbaa !10
  call void @_Z3dngRdd(ptr noundef nonnull align 8 dereferenceable(8) %84, double noundef %91)
  br label %92

92:                                               ; preds = %66
  %93 = load i32, ptr %7, align 4, !tbaa !5
  %94 = add nsw i32 %93, 1
  store i32 %94, ptr %7, align 4, !tbaa !5
  br label %61, !llvm.loop !14

95:                                               ; preds = %65
  br label %96

96:                                               ; preds = %95
  %97 = load i32, ptr %5, align 4, !tbaa !5
  %98 = add nsw i32 %97, 1
  store i32 %98, ptr %5, align 4, !tbaa !5
  br label %52, !llvm.loop !15

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

100:                                              ; preds = %125, %99
  %101 = load i32, ptr %10, align 4, !tbaa !5
  %102 = load i32, ptr @n, align 4, !tbaa !5
  %103 = icmp sle i32 %101, %102
  br i1 %103, label %105, label %104

104:                                              ; preds = %100
  store i32 11, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %128

105:                                              ; preds = %100
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  store i32 1, ptr %11, align 4, !tbaa !5
  br label %106

106:                                              ; preds = %115, %105
  %107 = load i32, ptr %11, align 4, !tbaa !5
  %108 = load i32, ptr @n, align 4, !tbaa !5
  %109 = icmp sle i32 %107, %108
  br i1 %109, label %111, label %110

110:                                              ; preds = %106
  store i32 14, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %118

111:                                              ; preds = %106
  %112 = load i32, ptr %11, align 4, !tbaa !5
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds [309 x double], ptr @slk, i64 0, i64 %113
  store double 1.000000e+08, ptr %114, align 8, !tbaa !10
  br label %115

115:                                              ; preds = %111
  %116 = load i32, ptr %11, align 4, !tbaa !5
  %117 = add nsw i32 %116, 1
  store i32 %117, ptr %11, align 4, !tbaa !5
  br label %106, !llvm.loop !16

118:                                              ; preds = %110
  br label %119

119:                                              ; preds = %124, %118
  call void @llvm.memset.p0.i64(ptr align 16 @usx, i8 0, i64 309, i1 false)
  call void @llvm.memset.p0.i64(ptr align 16 @usy, i8 0, i64 309, i1 false)
  %120 = load i32, ptr %10, align 4, !tbaa !5
  %121 = call noundef zeroext i1 @_Z3augi(i32 noundef %120)
  br i1 %121, label %122, label %123

122:                                              ; preds = %119
  br label %125

123:                                              ; preds = %119
  call void @_Z3adjv()
  br label %124

124:                                              ; preds = %123
  br label %119

125:                                              ; preds = %122
  %126 = load i32, ptr %10, align 4, !tbaa !5
  %127 = add nsw i32 %126, 1
  store i32 %127, ptr %10, align 4, !tbaa !5
  br label %100, !llvm.loop !17

128:                                              ; preds = %104
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  store i32 1, ptr %12, align 4, !tbaa !5
  br label %129

129:                                              ; preds = %147, %128
  %130 = load i32, ptr %12, align 4, !tbaa !5
  %131 = load i32, ptr @n, align 4, !tbaa !5
  %132 = icmp sle i32 %130, %131
  br i1 %132, label %134, label %133

133:                                              ; preds = %129
  store i32 18, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  br label %150

134:                                              ; preds = %129
  %135 = load i32, ptr %12, align 4, !tbaa !5
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds [309 x i32], ptr @mat, i64 0, i64 %136
  %138 = load i32, ptr %137, align 4, !tbaa !5
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds [309 x [309 x double]], ptr @g, i64 0, i64 %139
  %141 = load i32, ptr %12, align 4, !tbaa !5
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds [309 x double], ptr %140, i64 0, i64 %142
  %144 = load double, ptr %143, align 8, !tbaa !10
  %145 = load double, ptr @ans, align 8, !tbaa !10
  %146 = fadd double %145, %144
  store double %146, ptr @ans, align 8, !tbaa !10
  br label %147

147:                                              ; preds = %134
  %148 = load i32, ptr %12, align 4, !tbaa !5
  %149 = add nsw i32 %148, 1
  store i32 %149, ptr %12, align 4, !tbaa !5
  br label %129, !llvm.loop !18

150:                                              ; preds = %133
  %151 = load double, ptr @ans, align 8, !tbaa !10
  %152 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, double noundef %151)
  ret i32 0
}

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

; 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) #5

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

declare i32 @printf(ptr noundef, ...) #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 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #7 = { 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 4, !5, i64 4, i64 4, !5}
!10 = !{!11, !11, i64 0}
!11 = !{!"double", !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = distinct !{!15, !13}
!16 = distinct !{!16, !13}
!17 = distinct !{!17, !13}
!18 = distinct !{!18, !13}


; 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.Point = type { i32, i32 }

@s = external dso_local global [309 x %struct.Point], align 16
@t = external dso_local global [309 x %struct.Point], align 16
@n = external dso_local global i32, align 4
@g = external dso_local local_unnamed_addr global [309 x [309 x double]], align 16
@lbx = external dso_local global [309 x double], align 16
@slk = external dso_local local_unnamed_addr global [309 x double], align 16
@mat = external dso_local local_unnamed_addr global [309 x i32], align 16
@usx = external dso_local local_unnamed_addr global [309 x i8], align 16
@usy = external dso_local local_unnamed_addr global [309 x i8], align 16
@ans = external dso_local local_unnamed_addr global double, align 8
@.str = external hidden unnamed_addr constant [9 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_Z3dis5PointS_(i64, i64) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z3dngRdd(ptr noundef nonnull align 8 dereferenceable(8), double noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z3augi(i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z3adjv() 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)
  %2 = load i32, ptr @n, align 4, !tbaa !5
  %.not47 = icmp slt i32 %2, 1
  br i1 %.not47, label %.preheader.thread, label %.lr.ph

.preheader46:                                     ; preds = %.lr.ph
  %.not3852 = icmp slt i32 %11, 1
  br i1 %.not3852, label %.preheader.thread, label %.lr.ph54.split

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %0 ]
  %3 = getelementptr inbounds [309 x %struct.Point], ptr @s, i64 0, i64 %indvars.iv
  %4 = getelementptr inbounds i8, ptr %3, i64 4
  %5 = getelementptr inbounds [309 x %struct.Point], ptr @t, i64 0, i64 %indvars.iv
  %6 = getelementptr inbounds i8, ptr %5, i64 4
  %7 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %3, ptr noundef nonnull %4, ptr noundef nonnull %5, ptr noundef nonnull %6)
  %.sroa.024.0.copyload = load i64, ptr %3, align 8
  %.sroa.023.0.copyload = load i64, ptr %5, align 8
  %8 = tail call noundef double @_Z3dis5PointS_(i64 %.sroa.024.0.copyload, i64 %.sroa.023.0.copyload)
  %9 = load double, ptr @ans, align 8, !tbaa !9
  %10 = fadd double %8, %9
  store double %10, ptr @ans, align 8, !tbaa !9
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %11 = load i32, ptr @n, align 4, !tbaa !5
  %12 = sext i32 %11 to i64
  %.not.not = icmp slt i64 %indvars.iv, %12
  br i1 %.not.not, label %.lr.ph, label %.preheader46, !llvm.loop !11

.preheader45:                                     ; preds = %._crit_edge
  %.not3960 = icmp slt i32 %16, 1
  br i1 %.not3960, label %.preheader.thread, label %.preheader44

.lr.ph54.split:                                   ; preds = %.preheader46, %._crit_edge
  %13 = phi i32 [ %16, %._crit_edge ], [ %11, %.preheader46 ]
  %indvars.iv74 = phi i64 [ %indvars.iv.next75, %._crit_edge ], [ 1, %.preheader46 ]
  %14 = getelementptr inbounds [309 x double], ptr @lbx, i64 0, i64 %indvars.iv74
  store double 1.000000e+08, ptr %14, align 8, !tbaa !9
  %.not4249 = icmp slt i32 %13, 1
  br i1 %.not4249, label %.lr.ph54.split.._crit_edge_crit_edge, label %.lr.ph51

.lr.ph54.split.._crit_edge_crit_edge:             ; preds = %.lr.ph54.split
  %.pre = sext i32 %13 to i64
  br label %._crit_edge

.lr.ph51:                                         ; preds = %.lr.ph54.split
  %15 = getelementptr inbounds [309 x %struct.Point], ptr @t, i64 0, i64 %indvars.iv74
  br label %17

._crit_edge:                                      ; preds = %17, %.lr.ph54.split.._crit_edge_crit_edge
  %.pre-phi = phi i64 [ %.pre, %.lr.ph54.split.._crit_edge_crit_edge ], [ %22, %17 ]
  %16 = phi i32 [ %13, %.lr.ph54.split.._crit_edge_crit_edge ], [ %21, %17 ]
  %indvars.iv.next75 = add nuw nsw i64 %indvars.iv74, 1
  %.not38.not = icmp slt i64 %indvars.iv74, %.pre-phi
  br i1 %.not38.not, label %.lr.ph54.split, label %.preheader45, !llvm.loop !13

17:                                               ; preds = %.lr.ph51, %17
  %indvars.iv71 = phi i64 [ 1, %.lr.ph51 ], [ %indvars.iv.next72, %17 ]
  %.sroa.010.0.copyload = load i64, ptr %15, align 8
  %18 = getelementptr inbounds [309 x %struct.Point], ptr @s, i64 0, i64 %indvars.iv71
  %.sroa.0.0.copyload = load i64, ptr %18, align 8
  %19 = tail call noundef double @_Z3dis5PointS_(i64 %.sroa.010.0.copyload, i64 %.sroa.0.0.copyload)
  %20 = getelementptr inbounds [309 x [309 x double]], ptr @g, i64 0, i64 %indvars.iv74, i64 %indvars.iv71
  store double %19, ptr %20, align 8, !tbaa !9
  tail call void @_Z3dngRdd(ptr noundef nonnull align 8 dereferenceable(8) %14, double noundef %19)
  %indvars.iv.next72 = add nuw nsw i64 %indvars.iv71, 1
  %21 = load i32, ptr @n, align 4, !tbaa !5
  %22 = sext i32 %21 to i64
  %.not42.not = icmp slt i64 %indvars.iv71, %22
  br i1 %.not42.not, label %17, label %._crit_edge, !llvm.loop !15

.preheader44:                                     ; preds = %.preheader45, %._crit_edge59
  %23 = phi i32 [ %35, %._crit_edge59 ], [ %16, %.preheader45 ]
  %.03461 = phi i32 [ %34, %._crit_edge59 ], [ 1, %.preheader45 ]
  %.not4155 = icmp slt i32 %23, 1
  br i1 %.not4155, label %.preheader43, label %.lr.ph57.preheader

.lr.ph57.preheader:                               ; preds = %.preheader44
  %24 = add nuw i32 %23, 1
  %wide.trip.count83 = zext i32 %24 to i64
  %25 = zext nneg i32 %23 to i64
  %min.iters.check = icmp ult i32 %23, 4
  br i1 %min.iters.check, label %.lr.ph57.preheader105, label %vector.ph

.lr.ph57.preheader105:                            ; preds = %middle.block, %.lr.ph57.preheader
  %indvars.iv80.ph = phi i64 [ 1, %.lr.ph57.preheader ], [ %ind.end, %middle.block ]
  br label %.lr.ph57

vector.ph:                                        ; preds = %.lr.ph57.preheader
  %n.vec = and i64 %25, 2147483644
  %ind.end = or disjoint i64 %n.vec, 1
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %offset.idx = or disjoint i64 %index, 1
  %26 = getelementptr inbounds [309 x double], ptr @slk, i64 0, i64 %offset.idx
  %27 = getelementptr inbounds i8, ptr %26, i64 16
  store <2 x double> <double 1.000000e+08, double 1.000000e+08>, ptr %26, align 8, !tbaa !9
  store <2 x double> <double 1.000000e+08, double 1.000000e+08>, ptr %27, align 8, !tbaa !9
  %index.next = add nuw i64 %index, 4
  %28 = icmp eq i64 %index.next, %n.vec
  br i1 %28, label %middle.block, label %vector.body, !llvm.loop !16

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %25
  br i1 %cmp.n, label %.preheader43, label %.lr.ph57.preheader105

.preheader.thread:                                ; preds = %.preheader45, %.preheader46, %0
  %ans.promoted93 = load double, ptr @ans, align 8, !tbaa !9
  br label %43

.preheader:                                       ; preds = %._crit_edge59
  %ans.promoted = load double, ptr @ans, align 8, !tbaa !9
  %.not4062 = icmp slt i32 %35, 1
  br i1 %.not4062, label %43, label %.lr.ph64.preheader

.lr.ph64.preheader:                               ; preds = %.preheader
  %29 = zext nneg i32 %35 to i64
  %xtraiter = and i64 %29, 3
  %30 = icmp ult i32 %35, 4
  br i1 %30, label %._crit_edge65.unr-lcssa, label %.lr.ph64.preheader.new

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

.preheader43:                                     ; preds = %.lr.ph57, %middle.block, %.preheader44
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(309) @usx, i8 0, i64 309, i1 false)
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(309) @usy, i8 0, i64 309, i1 false)
  %31 = tail call noundef zeroext i1 @_Z3augi(i32 noundef %.03461)
  br i1 %31, label %._crit_edge59, label %.lr.ph58

.lr.ph57:                                         ; preds = %.lr.ph57.preheader105, %.lr.ph57
  %indvars.iv80 = phi i64 [ %indvars.iv.next81, %.lr.ph57 ], [ %indvars.iv80.ph, %.lr.ph57.preheader105 ]
  %32 = getelementptr inbounds [309 x double], ptr @slk, i64 0, i64 %indvars.iv80
  store double 1.000000e+08, ptr %32, align 8, !tbaa !9
  %indvars.iv.next81 = add nuw nsw i64 %indvars.iv80, 1
  %exitcond84.not = icmp eq i64 %indvars.iv.next81, %wide.trip.count83
  br i1 %exitcond84.not, label %.preheader43, label %.lr.ph57, !llvm.loop !19

.lr.ph58:                                         ; preds = %.preheader43, %.lr.ph58
  tail call void @_Z3adjv()
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(309) @usx, i8 0, i64 309, i1 false)
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(309) @usy, i8 0, i64 309, i1 false)
  %33 = tail call noundef zeroext i1 @_Z3augi(i32 noundef %.03461)
  br i1 %33, label %._crit_edge59, label %.lr.ph58

._crit_edge59:                                    ; preds = %.lr.ph58, %.preheader43
  %34 = add nuw nsw i32 %.03461, 1
  %35 = load i32, ptr @n, align 4, !tbaa !5
  %.not39.not = icmp slt i32 %.03461, %35
  br i1 %.not39.not, label %.preheader44, label %.preheader, !llvm.loop !20

._crit_edge65.unr-lcssa:                          ; preds = %.lr.ph64, %.lr.ph64.preheader
  %.lcssa.ph = phi double [ poison, %.lr.ph64.preheader ], [ %70, %.lr.ph64 ]
  %indvars.iv85.unr = phi i64 [ 1, %.lr.ph64.preheader ], [ %indvars.iv.next86.3, %.lr.ph64 ]
  %.unr = phi double [ %ans.promoted, %.lr.ph64.preheader ], [ %70, %.lr.ph64 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge65, label %.lr.ph64.epil

.lr.ph64.epil:                                    ; preds = %._crit_edge65.unr-lcssa, %.lr.ph64.epil
  %indvars.iv85.epil = phi i64 [ %indvars.iv.next86.epil, %.lr.ph64.epil ], [ %indvars.iv85.unr, %._crit_edge65.unr-lcssa ]
  %36 = phi double [ %42, %.lr.ph64.epil ], [ %.unr, %._crit_edge65.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph64.epil ], [ 0, %._crit_edge65.unr-lcssa ]
  %37 = getelementptr inbounds [309 x i32], ptr @mat, i64 0, i64 %indvars.iv85.epil
  %38 = load i32, ptr %37, align 4, !tbaa !5
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds [309 x [309 x double]], ptr @g, i64 0, i64 %39, i64 %indvars.iv85.epil
  %41 = load double, ptr %40, align 8, !tbaa !9
  %42 = fadd double %41, %36
  %indvars.iv.next86.epil = add nuw nsw i64 %indvars.iv85.epil, 1
  %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 %._crit_edge65, label %.lr.ph64.epil, !llvm.loop !21

._crit_edge65:                                    ; preds = %.lr.ph64.epil, %._crit_edge65.unr-lcssa
  %.lcssa = phi double [ %.lcssa.ph, %._crit_edge65.unr-lcssa ], [ %42, %.lr.ph64.epil ]
  store double %.lcssa, ptr @ans, align 8, !tbaa !9
  br label %43

43:                                               ; preds = %.preheader.thread, %._crit_edge65, %.preheader
  %44 = phi double [ %.lcssa, %._crit_edge65 ], [ %ans.promoted, %.preheader ], [ %ans.promoted93, %.preheader.thread ]
  %45 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, double noundef %44)
  ret i32 0

.lr.ph64:                                         ; preds = %.lr.ph64, %.lr.ph64.preheader.new
  %indvars.iv85 = phi i64 [ 1, %.lr.ph64.preheader.new ], [ %indvars.iv.next86.3, %.lr.ph64 ]
  %46 = phi double [ %ans.promoted, %.lr.ph64.preheader.new ], [ %70, %.lr.ph64 ]
  %niter = phi i64 [ 0, %.lr.ph64.preheader.new ], [ %niter.next.3, %.lr.ph64 ]
  %47 = getelementptr inbounds [309 x i32], ptr @mat, i64 0, i64 %indvars.iv85
  %48 = load i32, ptr %47, align 4, !tbaa !5
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [309 x [309 x double]], ptr @g, i64 0, i64 %49, i64 %indvars.iv85
  %51 = load double, ptr %50, align 8, !tbaa !9
  %52 = fadd double %51, %46
  %indvars.iv.next86 = add nuw nsw i64 %indvars.iv85, 1
  %53 = getelementptr inbounds [309 x i32], ptr @mat, i64 0, i64 %indvars.iv.next86
  %54 = load i32, ptr %53, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [309 x [309 x double]], ptr @g, i64 0, i64 %55, i64 %indvars.iv.next86
  %57 = load double, ptr %56, align 8, !tbaa !9
  %58 = fadd double %57, %52
  %indvars.iv.next86.1 = add nuw nsw i64 %indvars.iv85, 2
  %59 = getelementptr inbounds [309 x i32], ptr @mat, i64 0, i64 %indvars.iv.next86.1
  %60 = load i32, ptr %59, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [309 x [309 x double]], ptr @g, i64 0, i64 %61, i64 %indvars.iv.next86.1
  %63 = load double, ptr %62, align 8, !tbaa !9
  %64 = fadd double %63, %58
  %indvars.iv.next86.2 = add nuw nsw i64 %indvars.iv85, 3
  %65 = getelementptr inbounds [309 x i32], ptr @mat, i64 0, i64 %indvars.iv.next86.2
  %66 = load i32, ptr %65, align 4, !tbaa !5
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [309 x [309 x double]], ptr @g, i64 0, i64 %67, i64 %indvars.iv.next86.2
  %69 = load double, ptr %68, align 8, !tbaa !9
  %70 = fadd double %69, %64
  %indvars.iv.next86.3 = add nuw nsw i64 %indvars.iv85, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %._crit_edge65.unr-lcssa, label %.lr.ph64, !llvm.loop !23
}

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

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

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

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 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }

!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 = !{!"double", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12, !14}
!14 = !{!"llvm.loop.unswitch.partial.disable"}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12, !17, !18}
!17 = !{!"llvm.loop.isvectorized", i32 1}
!18 = !{!"llvm.loop.unroll.runtime.disable"}
!19 = distinct !{!19, !12, !18, !17}
!20 = distinct !{!20, !12}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.unroll.disable"}
!23 = distinct !{!23, !12}


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