; LLVM IR from VastoLorde95/Competitive-Programming :: Codeforces/230 Division 2/Problem B (B)

; 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.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }

@n = external dso_local global i32, align 4
@w = external dso_local global [170 x [170 x i32]], align 16
@a = external dso_local global [170 x [170 x double]], align 16
@b = external dso_local global [170 x [170 x double]], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %13 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @n)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #3
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %14

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

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

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

20:                                               ; preds = %33, %19
  %21 = load i32, ptr %4, align 4, !tbaa !5
  %22 = load i32, ptr @n, align 4, !tbaa !5
  %23 = icmp slt i32 %21, %22
  br i1 %23, label %25, label %24

24:                                               ; preds = %20
  store i32 5, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #3
  br label %36

25:                                               ; preds = %20
  %26 = load i32, ptr %2, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [170 x [170 x i32]], ptr @w, i64 0, i64 %27
  %29 = load i32, ptr %4, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds [170 x i32], ptr %28, i64 0, i64 %30
  %32 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %31)
  br label %33

33:                                               ; preds = %25
  %34 = load i32, ptr %4, align 4, !tbaa !5
  %35 = add nsw i32 %34, 1
  store i32 %35, ptr %4, align 4, !tbaa !5
  br label %20, !llvm.loop !9

36:                                               ; preds = %24
  br label %37

37:                                               ; preds = %36
  %38 = load i32, ptr %2, align 4, !tbaa !5
  %39 = add nsw i32 %38, 1
  store i32 %39, ptr %2, align 4, !tbaa !5
  br label %14, !llvm.loop !11

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

41:                                               ; preds = %80, %40
  %42 = load i32, ptr %5, align 4, !tbaa !5
  %43 = load i32, ptr @n, align 4, !tbaa !5
  %44 = icmp slt i32 %42, %43
  br i1 %44, label %46, label %45

45:                                               ; preds = %41
  store i32 8, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #3
  br label %83

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

47:                                               ; preds = %76, %46
  %48 = load i32, ptr %6, align 4, !tbaa !5
  %49 = load i32, ptr @n, align 4, !tbaa !5
  %50 = icmp slt i32 %48, %49
  br i1 %50, label %52, label %51

51:                                               ; preds = %47
  store i32 11, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  br label %79

52:                                               ; preds = %47
  %53 = load i32, ptr %5, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [170 x [170 x i32]], ptr @w, i64 0, i64 %54
  %56 = load i32, ptr %6, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds [170 x i32], ptr %55, i64 0, i64 %57
  %59 = load i32, ptr %58, align 4, !tbaa !5
  %60 = load i32, ptr %6, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [170 x [170 x i32]], ptr @w, i64 0, i64 %61
  %63 = load i32, ptr %5, align 4, !tbaa !5
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [170 x i32], ptr %62, i64 0, i64 %64
  %66 = load i32, ptr %65, align 4, !tbaa !5
  %67 = add nsw i32 %59, %66
  %68 = sitofp i32 %67 to double
  %69 = fdiv double %68, 2.000000e+00
  %70 = load i32, ptr %5, align 4, !tbaa !5
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [170 x [170 x double]], ptr @a, i64 0, i64 %71
  %73 = load i32, ptr %6, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [170 x double], ptr %72, i64 0, i64 %74
  store double %69, ptr %75, align 8, !tbaa !12
  br label %76

76:                                               ; preds = %52
  %77 = load i32, ptr %6, align 4, !tbaa !5
  %78 = add nsw i32 %77, 1
  store i32 %78, ptr %6, align 4, !tbaa !5
  br label %47, !llvm.loop !14

79:                                               ; preds = %51
  br label %80

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

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

84:                                               ; preds = %122, %83
  %85 = load i32, ptr %7, align 4, !tbaa !5
  %86 = load i32, ptr @n, align 4, !tbaa !5
  %87 = icmp slt i32 %85, %86
  br i1 %87, label %89, label %88

88:                                               ; preds = %84
  store i32 14, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  br label %125

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

90:                                               ; preds = %118, %89
  %91 = load i32, ptr %8, align 4, !tbaa !5
  %92 = load i32, ptr @n, align 4, !tbaa !5
  %93 = icmp slt i32 %91, %92
  br i1 %93, label %95, label %94

94:                                               ; preds = %90
  store i32 17, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  br label %121

95:                                               ; preds = %90
  %96 = load i32, ptr %7, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [170 x [170 x i32]], ptr @w, i64 0, i64 %97
  %99 = load i32, ptr %8, align 4, !tbaa !5
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [170 x i32], ptr %98, i64 0, i64 %100
  %102 = load i32, ptr %101, align 4, !tbaa !5
  %103 = sitofp i32 %102 to double
  %104 = load i32, ptr %7, align 4, !tbaa !5
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [170 x [170 x double]], ptr @a, i64 0, i64 %105
  %107 = load i32, ptr %8, align 4, !tbaa !5
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [170 x double], ptr %106, i64 0, i64 %108
  %110 = load double, ptr %109, align 8, !tbaa !12
  %111 = fsub double %103, %110
  %112 = load i32, ptr %7, align 4, !tbaa !5
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds [170 x [170 x double]], ptr @b, i64 0, i64 %113
  %115 = load i32, ptr %8, align 4, !tbaa !5
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds [170 x double], ptr %114, i64 0, i64 %116
  store double %111, ptr %117, align 8, !tbaa !12
  br label %118

118:                                              ; preds = %95
  %119 = load i32, ptr %8, align 4, !tbaa !5
  %120 = add nsw i32 %119, 1
  store i32 %120, ptr %8, align 4, !tbaa !5
  br label %90, !llvm.loop !16

121:                                              ; preds = %94
  br label %122

122:                                              ; preds = %121
  %123 = load i32, ptr %7, align 4, !tbaa !5
  %124 = add nsw i32 %123, 1
  store i32 %124, ptr %7, align 4, !tbaa !5
  br label %84, !llvm.loop !17

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

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

130:                                              ; preds = %126
  store i32 20, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  br label %154

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

132:                                              ; preds = %146, %131
  %133 = load i32, ptr %10, align 4, !tbaa !5
  %134 = load i32, ptr @n, align 4, !tbaa !5
  %135 = icmp slt i32 %133, %134
  br i1 %135, label %137, label %136

136:                                              ; preds = %132
  store i32 23, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  br label %149

137:                                              ; preds = %132
  %138 = load i32, ptr %9, align 4, !tbaa !5
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds [170 x [170 x double]], ptr @a, i64 0, i64 %139
  %141 = load i32, ptr %10, align 4, !tbaa !5
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds [170 x double], ptr %140, i64 0, i64 %142
  %144 = load double, ptr %143, align 8, !tbaa !12
  %145 = call i32 (ptr, ...) @printf(ptr noundef @.str, double noundef %144)
  br label %146

146:                                              ; preds = %137
  %147 = load i32, ptr %10, align 4, !tbaa !5
  %148 = add nsw i32 %147, 1
  store i32 %148, ptr %10, align 4, !tbaa !5
  br label %132, !llvm.loop !18

149:                                              ; preds = %136
  %150 = call i32 (ptr, ...) @printf(ptr noundef @.str.1)
  br label %151

151:                                              ; preds = %149
  %152 = load i32, ptr %9, align 4, !tbaa !5
  %153 = add nsw i32 %152, 1
  store i32 %153, ptr %9, align 4, !tbaa !5
  br label %126, !llvm.loop !19

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

155:                                              ; preds = %180, %154
  %156 = load i32, ptr %11, align 4, !tbaa !5
  %157 = load i32, ptr @n, align 4, !tbaa !5
  %158 = icmp slt i32 %156, %157
  br i1 %158, label %160, label %159

159:                                              ; preds = %155
  store i32 26, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  br label %183

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

161:                                              ; preds = %175, %160
  %162 = load i32, ptr %12, align 4, !tbaa !5
  %163 = load i32, ptr @n, align 4, !tbaa !5
  %164 = icmp slt i32 %162, %163
  br i1 %164, label %166, label %165

165:                                              ; preds = %161
  store i32 29, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #3
  br label %178

166:                                              ; preds = %161
  %167 = load i32, ptr %11, align 4, !tbaa !5
  %168 = sext i32 %167 to i64
  %169 = getelementptr inbounds [170 x [170 x double]], ptr @b, i64 0, i64 %168
  %170 = load i32, ptr %12, align 4, !tbaa !5
  %171 = sext i32 %170 to i64
  %172 = getelementptr inbounds [170 x double], ptr %169, i64 0, i64 %171
  %173 = load double, ptr %172, align 8, !tbaa !12
  %174 = call i32 (ptr, ...) @printf(ptr noundef @.str, double noundef %173)
  br label %175

175:                                              ; preds = %166
  %176 = load i32, ptr %12, align 4, !tbaa !5
  %177 = add nsw i32 %176, 1
  store i32 %177, ptr %12, align 4, !tbaa !5
  br label %161, !llvm.loop !20

178:                                              ; preds = %165
  %179 = call i32 (ptr, ...) @printf(ptr noundef @.str.1)
  br label %180

180:                                              ; preds = %178
  %181 = load i32, ptr %11, align 4, !tbaa !5
  %182 = add nsw i32 %181, 1
  store i32 %182, ptr %11, align 4, !tbaa !5
  br label %155, !llvm.loop !21

183:                                              ; preds = %159
  ret i32 0
}

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #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

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

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 = { "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 = { nounwind }

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

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


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

%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }

@n = external dso_local global i32, align 4
@w = external dso_local global [170 x [170 x i32]], align 16
@a = external dso_local local_unnamed_addr global [170 x [170 x double]], align 16
@b = external dso_local local_unnamed_addr global [170 x [170 x double]], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @n)
  %2 = load i32, ptr @n, align 4, !tbaa !5
  %3 = icmp sgt i32 %2, 0
  br i1 %3, label %.preheader54, label %._crit_edge73

.preheader54:                                     ; preds = %0, %._crit_edge
  %4 = phi i32 [ %41, %._crit_edge ], [ %2, %0 ]
  %indvars.iv77 = phi i64 [ %indvars.iv.next78, %._crit_edge ], [ 0, %0 ]
  %5 = icmp sgt i32 %4, 0
  br i1 %5, label %.lr.ph, label %.preheader54.._crit_edge_crit_edge

.preheader54.._crit_edge_crit_edge:               ; preds = %.preheader54
  %.pre = sext i32 %4 to i64
  br label %._crit_edge

.preheader53:                                     ; preds = %._crit_edge
  %6 = icmp sgt i32 %41, 0
  br i1 %6, label %.preheader52.us.preheader, label %._crit_edge73

.preheader52.us.preheader:                        ; preds = %.preheader53
  %wide.trip.count86 = zext nneg i32 %41 to i64
  %min.iters.check = icmp ult i32 %41, 4
  %n.vec = and i64 %wide.trip.count86, 2147483644
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count86
  br label %.preheader52.us

.preheader52.us:                                  ; preds = %.preheader52.us.preheader, %._crit_edge59.us
  %indvars.iv83 = phi i64 [ 0, %.preheader52.us.preheader ], [ %indvars.iv.next84, %._crit_edge59.us ]
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.body

vector.body:                                      ; preds = %.preheader52.us, %vector.body
  %index = phi i64 [ %index.next, %vector.body ], [ 0, %.preheader52.us ]
  %7 = or disjoint i64 %index, 1
  %8 = or disjoint i64 %index, 2
  %9 = or disjoint i64 %index, 3
  %10 = getelementptr inbounds [170 x [170 x i32]], ptr @w, i64 0, i64 %indvars.iv83, i64 %index
  %11 = getelementptr inbounds i8, ptr %10, i64 8
  %wide.load = load <2 x i32>, ptr %10, align 8, !tbaa !5
  %wide.load121 = load <2 x i32>, ptr %11, align 8, !tbaa !5
  %12 = getelementptr inbounds [170 x [170 x i32]], ptr @w, i64 0, i64 %index, i64 %indvars.iv83
  %13 = getelementptr inbounds [170 x [170 x i32]], ptr @w, i64 0, i64 %7, i64 %indvars.iv83
  %14 = getelementptr inbounds [170 x [170 x i32]], ptr @w, i64 0, i64 %8, i64 %indvars.iv83
  %15 = getelementptr inbounds [170 x [170 x i32]], ptr @w, i64 0, i64 %9, i64 %indvars.iv83
  %16 = load i32, ptr %12, align 4, !tbaa !5
  %17 = load i32, ptr %13, align 4, !tbaa !5
  %18 = insertelement <2 x i32> poison, i32 %16, i64 0
  %19 = insertelement <2 x i32> %18, i32 %17, i64 1
  %20 = load i32, ptr %14, align 4, !tbaa !5
  %21 = load i32, ptr %15, align 4, !tbaa !5
  %22 = insertelement <2 x i32> poison, i32 %20, i64 0
  %23 = insertelement <2 x i32> %22, i32 %21, i64 1
  %24 = add nsw <2 x i32> %19, %wide.load
  %25 = add nsw <2 x i32> %23, %wide.load121
  %26 = sitofp <2 x i32> %24 to <2 x double>
  %27 = sitofp <2 x i32> %25 to <2 x double>
  %28 = fmul <2 x double> %26, <double 5.000000e-01, double 5.000000e-01>
  %29 = fmul <2 x double> %27, <double 5.000000e-01, double 5.000000e-01>
  %30 = getelementptr inbounds [170 x [170 x double]], ptr @a, i64 0, i64 %indvars.iv83, i64 %index
  %31 = getelementptr inbounds i8, ptr %30, i64 16
  store <2 x double> %28, ptr %30, align 16, !tbaa !9
  store <2 x double> %29, ptr %31, align 16, !tbaa !9
  %index.next = add nuw i64 %index, 4
  %32 = icmp eq i64 %index.next, %n.vec
  br i1 %32, label %middle.block, label %vector.body, !llvm.loop !11

middle.block:                                     ; preds = %vector.body
  br i1 %cmp.n, label %._crit_edge59.us, label %scalar.ph.preheader

scalar.ph.preheader:                              ; preds = %middle.block, %.preheader52.us
  %indvars.iv80.ph = phi i64 [ 0, %.preheader52.us ], [ %n.vec, %middle.block ]
  br label %scalar.ph

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv80 = phi i64 [ %indvars.iv.next81, %scalar.ph ], [ %indvars.iv80.ph, %scalar.ph.preheader ]
  %33 = getelementptr inbounds [170 x [170 x i32]], ptr @w, i64 0, i64 %indvars.iv83, i64 %indvars.iv80
  %34 = load i32, ptr %33, align 4, !tbaa !5
  %35 = getelementptr inbounds [170 x [170 x i32]], ptr @w, i64 0, i64 %indvars.iv80, i64 %indvars.iv83
  %36 = load i32, ptr %35, align 4, !tbaa !5
  %37 = add nsw i32 %36, %34
  %38 = sitofp i32 %37 to double
  %39 = fmul double %38, 5.000000e-01
  %40 = getelementptr inbounds [170 x [170 x double]], ptr @a, i64 0, i64 %indvars.iv83, i64 %indvars.iv80
  store double %39, ptr %40, align 8, !tbaa !9
  %indvars.iv.next81 = add nuw nsw i64 %indvars.iv80, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next81, %wide.trip.count86
  br i1 %exitcond.not, label %._crit_edge59.us, label %scalar.ph, !llvm.loop !15

._crit_edge59.us:                                 ; preds = %scalar.ph, %middle.block
  %indvars.iv.next84 = add nuw nsw i64 %indvars.iv83, 1
  %exitcond87.not = icmp eq i64 %indvars.iv.next84, %wide.trip.count86
  br i1 %exitcond87.not, label %.preheader51, label %.preheader52.us, !llvm.loop !16

._crit_edge:                                      ; preds = %.lr.ph, %.preheader54.._crit_edge_crit_edge
  %.pre-phi = phi i64 [ %.pre, %.preheader54.._crit_edge_crit_edge ], [ %46, %.lr.ph ]
  %41 = phi i32 [ %4, %.preheader54.._crit_edge_crit_edge ], [ %45, %.lr.ph ]
  %indvars.iv.next78 = add nuw nsw i64 %indvars.iv77, 1
  %42 = icmp slt i64 %indvars.iv.next78, %.pre-phi
  br i1 %42, label %.preheader54, label %.preheader53, !llvm.loop !17

.lr.ph:                                           ; preds = %.preheader54, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.preheader54 ]
  %43 = getelementptr inbounds [170 x [170 x i32]], ptr @w, i64 0, i64 %indvars.iv77, i64 %indvars.iv
  %44 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %43)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %45 = load i32, ptr @n, align 4, !tbaa !5
  %46 = sext i32 %45 to i64
  %47 = icmp slt i64 %indvars.iv.next, %46
  br i1 %47, label %.lr.ph, label %._crit_edge, !llvm.loop !19

.preheader51:                                     ; preds = %._crit_edge59.us
  br i1 %6, label %.preheader50.us.preheader, label %.preheader48.preheader

.preheader50.us.preheader:                        ; preds = %.preheader51
  %wide.trip.count96 = zext nneg i32 %41 to i64
  %min.iters.check124 = icmp ult i32 %41, 4
  %n.vec127 = and i64 %wide.trip.count86, 2147483644
  %cmp.n136 = icmp eq i64 %n.vec127, %wide.trip.count86
  br label %.preheader50.us

.preheader50.us:                                  ; preds = %.preheader50.us.preheader, %._crit_edge63.us
  %indvars.iv93 = phi i64 [ 0, %.preheader50.us.preheader ], [ %indvars.iv.next94, %._crit_edge63.us ]
  br i1 %min.iters.check124, label %scalar.ph123.preheader, label %vector.body129

vector.body129:                                   ; preds = %.preheader50.us, %vector.body129
  %index130 = phi i64 [ %index.next135, %vector.body129 ], [ 0, %.preheader50.us ]
  %48 = getelementptr inbounds [170 x [170 x i32]], ptr @w, i64 0, i64 %indvars.iv93, i64 %index130
  %49 = getelementptr inbounds i8, ptr %48, i64 8
  %wide.load131 = load <2 x i32>, ptr %48, align 8, !tbaa !5
  %wide.load132 = load <2 x i32>, ptr %49, align 8, !tbaa !5
  %50 = sitofp <2 x i32> %wide.load131 to <2 x double>
  %51 = sitofp <2 x i32> %wide.load132 to <2 x double>
  %52 = getelementptr inbounds [170 x [170 x double]], ptr @a, i64 0, i64 %indvars.iv93, i64 %index130
  %53 = getelementptr inbounds i8, ptr %52, i64 16
  %wide.load133 = load <2 x double>, ptr %52, align 16, !tbaa !9
  %wide.load134 = load <2 x double>, ptr %53, align 16, !tbaa !9
  %54 = fsub <2 x double> %50, %wide.load133
  %55 = fsub <2 x double> %51, %wide.load134
  %56 = getelementptr inbounds [170 x [170 x double]], ptr @b, i64 0, i64 %indvars.iv93, i64 %index130
  %57 = getelementptr inbounds i8, ptr %56, i64 16
  store <2 x double> %54, ptr %56, align 16, !tbaa !9
  store <2 x double> %55, ptr %57, align 16, !tbaa !9
  %index.next135 = add nuw i64 %index130, 4
  %58 = icmp eq i64 %index.next135, %n.vec127
  br i1 %58, label %middle.block122, label %vector.body129, !llvm.loop !20

middle.block122:                                  ; preds = %vector.body129
  br i1 %cmp.n136, label %._crit_edge63.us, label %scalar.ph123.preheader

scalar.ph123.preheader:                           ; preds = %middle.block122, %.preheader50.us
  %indvars.iv88.ph = phi i64 [ 0, %.preheader50.us ], [ %n.vec127, %middle.block122 ]
  br label %scalar.ph123

scalar.ph123:                                     ; preds = %scalar.ph123.preheader, %scalar.ph123
  %indvars.iv88 = phi i64 [ %indvars.iv.next89, %scalar.ph123 ], [ %indvars.iv88.ph, %scalar.ph123.preheader ]
  %59 = getelementptr inbounds [170 x [170 x i32]], ptr @w, i64 0, i64 %indvars.iv93, i64 %indvars.iv88
  %60 = load i32, ptr %59, align 4, !tbaa !5
  %61 = sitofp i32 %60 to double
  %62 = getelementptr inbounds [170 x [170 x double]], ptr @a, i64 0, i64 %indvars.iv93, i64 %indvars.iv88
  %63 = load double, ptr %62, align 8, !tbaa !9
  %64 = fsub double %61, %63
  %65 = getelementptr inbounds [170 x [170 x double]], ptr @b, i64 0, i64 %indvars.iv93, i64 %indvars.iv88
  store double %64, ptr %65, align 8, !tbaa !9
  %indvars.iv.next89 = add nuw nsw i64 %indvars.iv88, 1
  %exitcond92.not = icmp eq i64 %indvars.iv.next89, %wide.trip.count96
  br i1 %exitcond92.not, label %._crit_edge63.us, label %scalar.ph123, !llvm.loop !21

._crit_edge63.us:                                 ; preds = %scalar.ph123, %middle.block122
  %indvars.iv.next94 = add nuw nsw i64 %indvars.iv93, 1
  %exitcond97.not = icmp eq i64 %indvars.iv.next94, %wide.trip.count96
  br i1 %exitcond97.not, label %.preheader48.preheader, label %.preheader50.us, !llvm.loop !22

.preheader48.preheader:                           ; preds = %._crit_edge63.us, %.preheader51
  br label %.preheader48

.preheader48:                                     ; preds = %.preheader48.preheader, %._crit_edge67
  %66 = phi i32 [ %70, %._crit_edge67 ], [ %41, %.preheader48.preheader ]
  %indvars.iv101 = phi i64 [ %indvars.iv.next102, %._crit_edge67 ], [ 0, %.preheader48.preheader ]
  %67 = icmp sgt i32 %66, 0
  br i1 %67, label %.lr.ph66, label %._crit_edge67

.preheader47:                                     ; preds = %._crit_edge67
  %68 = icmp sgt i32 %70, 0
  br i1 %68, label %.preheader, label %._crit_edge73

._crit_edge67:                                    ; preds = %.lr.ph66, %.preheader48
  %69 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
  %indvars.iv.next102 = add nuw nsw i64 %indvars.iv101, 1
  %70 = load i32, ptr @n, align 4, !tbaa !5
  %71 = sext i32 %70 to i64
  %72 = icmp slt i64 %indvars.iv.next102, %71
  br i1 %72, label %.preheader48, label %.preheader47, !llvm.loop !23

.lr.ph66:                                         ; preds = %.preheader48, %.lr.ph66
  %indvars.iv98 = phi i64 [ %indvars.iv.next99, %.lr.ph66 ], [ 0, %.preheader48 ]
  %73 = getelementptr inbounds [170 x [170 x double]], ptr @a, i64 0, i64 %indvars.iv101, i64 %indvars.iv98
  %74 = load double, ptr %73, align 8, !tbaa !9
  %75 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, double noundef %74)
  %indvars.iv.next99 = add nuw nsw i64 %indvars.iv98, 1
  %76 = load i32, ptr @n, align 4, !tbaa !5
  %77 = sext i32 %76 to i64
  %78 = icmp slt i64 %indvars.iv.next99, %77
  br i1 %78, label %.lr.ph66, label %._crit_edge67, !llvm.loop !24

.preheader:                                       ; preds = %.preheader47, %._crit_edge71
  %79 = phi i32 [ %82, %._crit_edge71 ], [ %70, %.preheader47 ]
  %indvars.iv107 = phi i64 [ %indvars.iv.next108, %._crit_edge71 ], [ 0, %.preheader47 ]
  %80 = icmp sgt i32 %79, 0
  br i1 %80, label %.lr.ph70, label %._crit_edge71

._crit_edge73:                                    ; preds = %._crit_edge71, %.preheader53, %0, %.preheader47
  ret i32 0

._crit_edge71:                                    ; preds = %.lr.ph70, %.preheader
  %81 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
  %indvars.iv.next108 = add nuw nsw i64 %indvars.iv107, 1
  %82 = load i32, ptr @n, align 4, !tbaa !5
  %83 = sext i32 %82 to i64
  %84 = icmp slt i64 %indvars.iv.next108, %83
  br i1 %84, label %.preheader, label %._crit_edge73, !llvm.loop !25

.lr.ph70:                                         ; preds = %.preheader, %.lr.ph70
  %indvars.iv104 = phi i64 [ %indvars.iv.next105, %.lr.ph70 ], [ 0, %.preheader ]
  %85 = getelementptr inbounds [170 x [170 x double]], ptr @b, i64 0, i64 %indvars.iv107, i64 %indvars.iv104
  %86 = load double, ptr %85, align 8, !tbaa !9
  %87 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, double noundef %86)
  %indvars.iv.next105 = add nuw nsw i64 %indvars.iv104, 1
  %88 = load i32, ptr @n, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %90 = icmp slt i64 %indvars.iv.next105, %89
  br i1 %90, label %.lr.ph70, label %._crit_edge71, !llvm.loop !26
}

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1

; 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 = { "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 = { 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" }

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