; LLVM IR from ERGO-Code/HiGHS :: src/ipm/basiclu (lu_matrix_norm)

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

@.str = external hidden unnamed_addr constant [19 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [82 x i8], align 1
@__PRETTY_FUNCTION__.lu_matrix_norm = external hidden unnamed_addr constant [97 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @lu_matrix_norm(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4) #0 {
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca double, align 8
  %22 = alloca double, align 8
  %23 = alloca double, align 8
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store ptr %3, ptr %9, align 8, !tbaa !5
  store ptr %4, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  %24 = load ptr, ptr %6, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.lu, ptr %24, i32 0, i32 13
  %26 = load i32, ptr %25, align 4, !tbaa !9
  store i32 %26, ptr %11, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  %27 = load ptr, ptr %6, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.lu, ptr %27, i32 0, i32 50
  %29 = load i32, ptr %28, align 4, !tbaa !14
  store i32 %29, ptr %12, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  %30 = load ptr, ptr %6, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.lu, ptr %30, i32 0, i32 78
  %32 = load ptr, ptr %31, align 8, !tbaa !15
  store ptr %32, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  %33 = load ptr, ptr %6, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.lu, ptr %33, i32 0, i32 80
  %35 = load ptr, ptr %34, align 8, !tbaa !16
  store ptr %35, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  %36 = load ptr, ptr %6, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.lu, ptr %36, i32 0, i32 103
  %38 = load ptr, ptr %37, align 8, !tbaa !17
  store ptr %38, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #4
  %39 = load ptr, ptr %6, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.lu, ptr %39, i32 0, i32 17
  %41 = load i32, ptr %40, align 4, !tbaa !18
  %42 = icmp eq i32 %41, 0
  br i1 %42, label %43, label %44

43:                                               ; preds = %5
  br label %45

44:                                               ; preds = %5
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 25, ptr noundef @__PRETTY_FUNCTION__.lu_matrix_norm) #5
  unreachable

45:                                               ; preds = %43
  store i32 0, ptr %18, align 4, !tbaa !13
  br label %46

46:                                               ; preds = %55, %45
  %47 = load i32, ptr %18, align 4, !tbaa !13
  %48 = load i32, ptr %11, align 4, !tbaa !13
  %49 = icmp slt i32 %47, %48
  br i1 %49, label %50, label %58

50:                                               ; preds = %46
  %51 = load ptr, ptr %15, align 8, !tbaa !5
  %52 = load i32, ptr %18, align 4, !tbaa !13
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds double, ptr %51, i64 %53
  store double 0.000000e+00, ptr %54, align 8, !tbaa !19
  br label %55

55:                                               ; preds = %50
  %56 = load i32, ptr %18, align 4, !tbaa !13
  %57 = add nsw i32 %56, 1
  store i32 %57, ptr %18, align 4, !tbaa !13
  br label %46, !llvm.loop !20

58:                                               ; preds = %46
  store double 0.000000e+00, ptr %21, align 8, !tbaa !19
  store double 0.000000e+00, ptr %22, align 8, !tbaa !19
  store i32 0, ptr %19, align 4, !tbaa !13
  br label %59

59:                                               ; preds = %114, %58
  %60 = load i32, ptr %19, align 4, !tbaa !13
  %61 = load i32, ptr %12, align 4, !tbaa !13
  %62 = icmp slt i32 %60, %61
  br i1 %62, label %63, label %117

63:                                               ; preds = %59
  %64 = load ptr, ptr %13, align 8, !tbaa !5
  %65 = load i32, ptr %19, align 4, !tbaa !13
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds i32, ptr %64, i64 %66
  %68 = load i32, ptr %67, align 4, !tbaa !13
  store i32 %68, ptr %17, align 4, !tbaa !13
  store double 0.000000e+00, ptr %23, align 8, !tbaa !19
  %69 = load ptr, ptr %7, align 8, !tbaa !5
  %70 = load i32, ptr %17, align 4, !tbaa !13
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds i32, ptr %69, i64 %71
  %73 = load i32, ptr %72, align 4, !tbaa !13
  store i32 %73, ptr %20, align 4, !tbaa !13
  br label %74

74:                                               ; preds = %107, %63
  %75 = load i32, ptr %20, align 4, !tbaa !13
  %76 = load ptr, ptr %8, align 8, !tbaa !5
  %77 = load i32, ptr %17, align 4, !tbaa !13
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds i32, ptr %76, i64 %78
  %80 = load i32, ptr %79, align 4, !tbaa !13
  %81 = icmp slt i32 %75, %80
  br i1 %81, label %82, label %110

82:                                               ; preds = %74
  %83 = load ptr, ptr %10, align 8, !tbaa !5
  %84 = load i32, ptr %20, align 4, !tbaa !13
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds double, ptr %83, i64 %85
  %87 = load double, ptr %86, align 8, !tbaa !19
  %88 = call double @llvm.fabs.f64(double %87)
  %89 = load double, ptr %23, align 8, !tbaa !19
  %90 = fadd double %89, %88
  store double %90, ptr %23, align 8, !tbaa !19
  %91 = load ptr, ptr %10, align 8, !tbaa !5
  %92 = load i32, ptr %20, align 4, !tbaa !13
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds double, ptr %91, i64 %93
  %95 = load double, ptr %94, align 8, !tbaa !19
  %96 = call double @llvm.fabs.f64(double %95)
  %97 = load ptr, ptr %15, align 8, !tbaa !5
  %98 = load ptr, ptr %9, align 8, !tbaa !5
  %99 = load i32, ptr %20, align 4, !tbaa !13
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds i32, ptr %98, i64 %100
  %102 = load i32, ptr %101, align 4, !tbaa !13
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds double, ptr %97, i64 %103
  %105 = load double, ptr %104, align 8, !tbaa !19
  %106 = fadd double %105, %96
  store double %106, ptr %104, align 8, !tbaa !19
  br label %107

107:                                              ; preds = %82
  %108 = load i32, ptr %20, align 4, !tbaa !13
  %109 = add nsw i32 %108, 1
  store i32 %109, ptr %20, align 4, !tbaa !13
  br label %74, !llvm.loop !22

110:                                              ; preds = %74
  %111 = load double, ptr %21, align 8, !tbaa !19
  %112 = load double, ptr %23, align 8, !tbaa !19
  %113 = call double @llvm.maxnum.f64(double %111, double %112)
  store double %113, ptr %21, align 8, !tbaa !19
  br label %114

114:                                              ; preds = %110
  %115 = load i32, ptr %19, align 4, !tbaa !13
  %116 = add nsw i32 %115, 1
  store i32 %116, ptr %19, align 4, !tbaa !13
  br label %59, !llvm.loop !23

117:                                              ; preds = %59
  %118 = load i32, ptr %12, align 4, !tbaa !13
  store i32 %118, ptr %19, align 4, !tbaa !13
  br label %119

119:                                              ; preds = %137, %117
  %120 = load i32, ptr %19, align 4, !tbaa !13
  %121 = load i32, ptr %11, align 4, !tbaa !13
  %122 = icmp slt i32 %120, %121
  br i1 %122, label %123, label %140

123:                                              ; preds = %119
  %124 = load ptr, ptr %14, align 8, !tbaa !5
  %125 = load i32, ptr %19, align 4, !tbaa !13
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds i32, ptr %124, i64 %126
  %128 = load i32, ptr %127, align 4, !tbaa !13
  store i32 %128, ptr %16, align 4, !tbaa !13
  %129 = load ptr, ptr %15, align 8, !tbaa !5
  %130 = load i32, ptr %16, align 4, !tbaa !13
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds double, ptr %129, i64 %131
  %133 = load double, ptr %132, align 8, !tbaa !19
  %134 = fadd double %133, 1.000000e+00
  store double %134, ptr %132, align 8, !tbaa !19
  %135 = load double, ptr %21, align 8, !tbaa !19
  %136 = call double @llvm.maxnum.f64(double %135, double 1.000000e+00)
  store double %136, ptr %21, align 8, !tbaa !19
  br label %137

137:                                              ; preds = %123
  %138 = load i32, ptr %19, align 4, !tbaa !13
  %139 = add nsw i32 %138, 1
  store i32 %139, ptr %19, align 4, !tbaa !13
  br label %119, !llvm.loop !24

140:                                              ; preds = %119
  store i32 0, ptr %18, align 4, !tbaa !13
  br label %141

141:                                              ; preds = %153, %140
  %142 = load i32, ptr %18, align 4, !tbaa !13
  %143 = load i32, ptr %11, align 4, !tbaa !13
  %144 = icmp slt i32 %142, %143
  br i1 %144, label %145, label %156

145:                                              ; preds = %141
  %146 = load double, ptr %22, align 8, !tbaa !19
  %147 = load ptr, ptr %15, align 8, !tbaa !5
  %148 = load i32, ptr %18, align 4, !tbaa !13
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds double, ptr %147, i64 %149
  %151 = load double, ptr %150, align 8, !tbaa !19
  %152 = call double @llvm.maxnum.f64(double %146, double %151)
  store double %152, ptr %22, align 8, !tbaa !19
  br label %153

153:                                              ; preds = %145
  %154 = load i32, ptr %18, align 4, !tbaa !13
  %155 = add nsw i32 %154, 1
  store i32 %155, ptr %18, align 4, !tbaa !13
  br label %141, !llvm.loop !25

156:                                              ; preds = %141
  %157 = load double, ptr %21, align 8, !tbaa !19
  %158 = load ptr, ptr %6, align 8, !tbaa !5
  %159 = getelementptr inbounds %struct.lu, ptr %158, i32 0, i32 46
  store double %157, ptr %159, align 8, !tbaa !26
  %160 = load double, ptr %22, align 8, !tbaa !19
  %161 = load ptr, ptr %6, align 8, !tbaa !5
  %162 = getelementptr inbounds %struct.lu, ptr %161, i32 0, i32 47
  store double %160, ptr %162, align 8, !tbaa !27
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  ret void
}

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fabs.f64(double) #3

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.maxnum.f64(double, double) #3

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

attributes #0 = { 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { noreturn 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
attributes #5 = { noreturn 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !11, i64 84}
!10 = !{!"lu", !11, i64 0, !11, i64 4, !11, i64 8, !12, i64 16, !12, i64 24, !12, i64 32, !11, i64 40, !11, i64 44, !11, i64 48, !12, i64 56, !12, i64 64, !12, i64 72, !11, i64 80, !11, i64 84, !11, i64 88, !11, i64 92, !11, i64 96, !11, i64 100, !11, i64 104, !11, i64 108, !11, i64 112, !11, i64 116, !11, i64 120, !11, i64 124, !11, i64 128, !11, i64 132, !12, i64 136, !12, i64 144, !12, i64 152, !12, i64 160, !12, i64 168, !12, i64 176, !12, i64 184, !12, i64 192, !12, i64 200, !12, i64 208, !12, i64 216, !11, i64 224, !11, i64 228, !11, i64 232, !12, i64 240, !12, i64 248, !12, i64 256, !12, i64 264, !12, i64 272, !12, i64 280, !12, i64 288, !12, i64 296, !12, i64 304, !11, i64 312, !11, i64 316, !11, i64 320, !11, i64 324, !11, i64 328, !11, i64 332, !11, i64 336, !11, i64 340, !12, i64 344, !12, i64 352, !12, i64 360, !12, i64 368, !11, i64 376, !11, i64 380, !11, i64 384, !11, i64 388, !11, i64 392, !11, i64 396, !11, i64 400, !11, i64 404, !11, i64 408, !11, i64 412, !6, i64 416, !6, i64 424, !6, i64 432, !6, i64 440, !6, i64 448, !6, i64 456, !6, i64 464, !6, i64 472, !6, i64 480, !6, i64 488, !6, i64 496, !6, i64 504, !6, i64 512, !6, i64 520, !6, i64 528, !6, i64 536, !6, i64 544, !6, i64 552, !6, i64 560, !6, i64 568, !6, i64 576, !6, i64 584, !6, i64 592, !6, i64 600, !6, i64 608, !6, i64 616, !6, i64 624, !6, i64 632, !6, i64 640, !6, i64 648, !6, i64 656, !6, i64 664, !6, i64 672, !6, i64 680, !6, i64 688}
!11 = !{!"int", !7, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = !{!11, !11, i64 0}
!14 = !{!10, !11, i64 316}
!15 = !{!10, !6, i64 472}
!16 = !{!10, !6, i64 488}
!17 = !{!10, !6, i64 672}
!18 = !{!10, !11, i64 100}
!19 = !{!12, !12, i64 0}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = distinct !{!22, !21}
!23 = distinct !{!23, !21}
!24 = distinct !{!24, !21}
!25 = distinct !{!25, !21}
!26 = !{!10, !12, i64 288}
!27 = !{!10, !12, i64 296}


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

@.str = external hidden unnamed_addr constant [19 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [82 x i8], align 1
@__PRETTY_FUNCTION__.lu_matrix_norm = external hidden unnamed_addr constant [97 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @lu_matrix_norm(ptr nocapture noundef %0, ptr nocapture noundef readonly %1, ptr nocapture noundef readonly %2, ptr nocapture noundef readonly %3, ptr nocapture noundef readonly %4) local_unnamed_addr #0 {
  %6 = getelementptr inbounds i8, ptr %0, i64 84
  %7 = load i32, ptr %6, align 4, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %0, i64 316
  %9 = load i32, ptr %8, align 4, !tbaa !12
  %10 = getelementptr inbounds i8, ptr %0, i64 472
  %11 = load ptr, ptr %10, align 8, !tbaa !13
  %12 = getelementptr inbounds i8, ptr %0, i64 488
  %13 = load ptr, ptr %12, align 8, !tbaa !14
  %14 = getelementptr inbounds i8, ptr %0, i64 672
  %15 = load ptr, ptr %14, align 8, !tbaa !15
  %16 = getelementptr inbounds i8, ptr %0, i64 100
  %17 = load i32, ptr %16, align 4, !tbaa !16
  %18 = icmp eq i32 %17, 0
  br i1 %18, label %.preheader61, label %22

.preheader61:                                     ; preds = %5
  %19 = icmp sgt i32 %7, 0
  br i1 %19, label %.lr.ph.preheader, label %.preheader60

.lr.ph.preheader:                                 ; preds = %.preheader61
  %20 = zext nneg i32 %7 to i64
  %21 = shl nuw nsw i64 %20, 3
  tail call void @llvm.memset.p0.i64(ptr align 8 %15, i8 0, i64 %21, i1 false), !tbaa !17
  br label %.preheader60

22:                                               ; preds = %5
  tail call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 25, ptr noundef nonnull @__PRETTY_FUNCTION__.lu_matrix_norm) #4
  unreachable

.preheader60:                                     ; preds = %.lr.ph.preheader, %.preheader61
  %23 = icmp sgt i32 %9, 0
  br i1 %23, label %.lr.ph68.preheader, label %.preheader59

.lr.ph68.preheader:                               ; preds = %.preheader60
  %wide.trip.count87 = zext nneg i32 %9 to i64
  br label %.lr.ph68

.preheader59:                                     ; preds = %._crit_edge, %.preheader60
  %.051.lcssa = phi double [ 0.000000e+00, %.preheader60 ], [ %77, %._crit_edge ]
  %24 = icmp slt i32 %9, %7
  br i1 %24, label %.lr.ph72.preheader, label %.preheader

.lr.ph72.preheader:                               ; preds = %.preheader59
  %25 = sext i32 %9 to i64
  %wide.trip.count92 = sext i32 %7 to i64
  %26 = sub nsw i64 %wide.trip.count92, %25
  %xtraiter108 = and i64 %26, 1
  %lcmp.mod109.not = icmp eq i64 %xtraiter108, 0
  br i1 %lcmp.mod109.not, label %.lr.ph72.prol.loopexit, label %.lr.ph72.prol

.lr.ph72.prol:                                    ; preds = %.lr.ph72.preheader
  %27 = getelementptr inbounds i32, ptr %13, i64 %25
  %28 = load i32, ptr %27, align 4, !tbaa !18
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds double, ptr %15, i64 %29
  %31 = load double, ptr %30, align 8, !tbaa !17
  %32 = fadd double %31, 1.000000e+00
  store double %32, ptr %30, align 8, !tbaa !17
  %33 = tail call double @llvm.maxnum.f64(double %.051.lcssa, double 1.000000e+00)
  %indvars.iv.next90.prol = add nsw i64 %25, 1
  br label %.lr.ph72.prol.loopexit

.lr.ph72.prol.loopexit:                           ; preds = %.lr.ph72.prol, %.lr.ph72.preheader
  %.lcssa105.unr = phi double [ poison, %.lr.ph72.preheader ], [ %33, %.lr.ph72.prol ]
  %indvars.iv89.unr = phi i64 [ %25, %.lr.ph72.preheader ], [ %indvars.iv.next90.prol, %.lr.ph72.prol ]
  %.171.unr = phi double [ %.051.lcssa, %.lr.ph72.preheader ], [ %33, %.lr.ph72.prol ]
  %34 = add nsw i64 %wide.trip.count92, -1
  %35 = icmp eq i64 %34, %25
  br i1 %35, label %.preheader, label %.lr.ph72.preheader.new

.lr.ph72.preheader.new:                           ; preds = %.lr.ph72.prol.loopexit
  %invariant.gep = getelementptr i8, ptr %13, i64 4
  br label %.lr.ph72

.lr.ph68:                                         ; preds = %.lr.ph68.preheader, %._crit_edge
  %indvars.iv84 = phi i64 [ 0, %.lr.ph68.preheader ], [ %indvars.iv.next85, %._crit_edge ]
  %.05167 = phi double [ 0.000000e+00, %.lr.ph68.preheader ], [ %77, %._crit_edge ]
  %36 = getelementptr inbounds i32, ptr %11, i64 %indvars.iv84
  %37 = load i32, ptr %36, align 4, !tbaa !18
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds i32, ptr %1, i64 %38
  %40 = load i32, ptr %39, align 4, !tbaa !18
  %41 = getelementptr inbounds i32, ptr %2, i64 %38
  %42 = load i32, ptr %41, align 4, !tbaa !18
  %43 = icmp slt i32 %40, %42
  br i1 %43, label %.lr.ph65.preheader, label %._crit_edge

.lr.ph65.preheader:                               ; preds = %.lr.ph68
  %44 = sext i32 %40 to i64
  %wide.trip.count = sext i32 %42 to i64
  %45 = sub nsw i64 %wide.trip.count, %44
  %xtraiter = and i64 %45, 1
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.lr.ph65.prol.loopexit, label %.lr.ph65.prol

.lr.ph65.prol:                                    ; preds = %.lr.ph65.preheader
  %46 = getelementptr inbounds double, ptr %4, i64 %44
  %47 = load double, ptr %46, align 8, !tbaa !17
  %48 = tail call double @llvm.fabs.f64(double %47)
  %49 = getelementptr inbounds i32, ptr %3, i64 %44
  %50 = load i32, ptr %49, align 4, !tbaa !18
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds double, ptr %15, i64 %51
  %53 = load double, ptr %52, align 8, !tbaa !17
  %54 = fadd double %48, %53
  store double %54, ptr %52, align 8, !tbaa !17
  %indvars.iv.next.prol = add nsw i64 %44, 1
  br label %.lr.ph65.prol.loopexit

.lr.ph65.prol.loopexit:                           ; preds = %.lr.ph65.prol, %.lr.ph65.preheader
  %.lcssa106.unr = phi double [ poison, %.lr.ph65.preheader ], [ %48, %.lr.ph65.prol ]
  %indvars.iv.unr = phi i64 [ %44, %.lr.ph65.preheader ], [ %indvars.iv.next.prol, %.lr.ph65.prol ]
  %.064.unr = phi double [ 0.000000e+00, %.lr.ph65.preheader ], [ %48, %.lr.ph65.prol ]
  %55 = add nsw i64 %wide.trip.count, -1
  %56 = icmp eq i64 %55, %44
  br i1 %56, label %._crit_edge, label %.lr.ph65

.lr.ph65:                                         ; preds = %.lr.ph65.prol.loopexit, %.lr.ph65
  %indvars.iv = phi i64 [ %indvars.iv.next.1, %.lr.ph65 ], [ %indvars.iv.unr, %.lr.ph65.prol.loopexit ]
  %.064 = phi double [ %70, %.lr.ph65 ], [ %.064.unr, %.lr.ph65.prol.loopexit ]
  %57 = getelementptr inbounds double, ptr %4, i64 %indvars.iv
  %58 = load double, ptr %57, align 8, !tbaa !17
  %59 = tail call double @llvm.fabs.f64(double %58)
  %60 = fadd double %.064, %59
  %61 = getelementptr inbounds i32, ptr %3, i64 %indvars.iv
  %62 = load i32, ptr %61, align 4, !tbaa !18
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds double, ptr %15, i64 %63
  %65 = load double, ptr %64, align 8, !tbaa !17
  %66 = fadd double %59, %65
  store double %66, ptr %64, align 8, !tbaa !17
  %indvars.iv.next = add nsw i64 %indvars.iv, 1
  %67 = getelementptr inbounds double, ptr %4, i64 %indvars.iv.next
  %68 = load double, ptr %67, align 8, !tbaa !17
  %69 = tail call double @llvm.fabs.f64(double %68)
  %70 = fadd double %60, %69
  %71 = getelementptr inbounds i32, ptr %3, i64 %indvars.iv.next
  %72 = load i32, ptr %71, align 4, !tbaa !18
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds double, ptr %15, i64 %73
  %75 = load double, ptr %74, align 8, !tbaa !17
  %76 = fadd double %69, %75
  store double %76, ptr %74, align 8, !tbaa !17
  %indvars.iv.next.1 = add nsw i64 %indvars.iv, 2
  %exitcond.not.1 = icmp eq i64 %indvars.iv.next.1, %wide.trip.count
  br i1 %exitcond.not.1, label %._crit_edge, label %.lr.ph65, !llvm.loop !19

._crit_edge:                                      ; preds = %.lr.ph65.prol.loopexit, %.lr.ph65, %.lr.ph68
  %.0.lcssa = phi double [ 0.000000e+00, %.lr.ph68 ], [ %.lcssa106.unr, %.lr.ph65.prol.loopexit ], [ %70, %.lr.ph65 ]
  %77 = tail call double @llvm.maxnum.f64(double %.05167, double %.0.lcssa)
  %indvars.iv.next85 = add nuw nsw i64 %indvars.iv84, 1
  %exitcond88.not = icmp eq i64 %indvars.iv.next85, %wide.trip.count87
  br i1 %exitcond88.not, label %.preheader59, label %.lr.ph68, !llvm.loop !21

.preheader:                                       ; preds = %.lr.ph72.prol.loopexit, %.lr.ph72, %.preheader59
  %.1.lcssa = phi double [ %.051.lcssa, %.preheader59 ], [ %.lcssa105.unr, %.lr.ph72.prol.loopexit ], [ %85, %.lr.ph72 ]
  br i1 %19, label %.lr.ph76.preheader, label %._crit_edge77

.lr.ph76.preheader:                               ; preds = %.preheader
  %wide.trip.count97 = zext nneg i32 %7 to i64
  %xtraiter110 = and i64 %wide.trip.count97, 1
  %78 = icmp eq i32 %7, 1
  br i1 %78, label %._crit_edge77.loopexit.unr-lcssa, label %.lr.ph76.preheader.new

.lr.ph76.preheader.new:                           ; preds = %.lr.ph76.preheader
  %unroll_iter = and i64 %wide.trip.count97, 2147483646
  br label %.lr.ph76

.lr.ph72:                                         ; preds = %.lr.ph72, %.lr.ph72.preheader.new
  %indvars.iv89 = phi i64 [ %indvars.iv89.unr, %.lr.ph72.preheader.new ], [ %indvars.iv.next90.1, %.lr.ph72 ]
  %.171 = phi double [ %.171.unr, %.lr.ph72.preheader.new ], [ %85, %.lr.ph72 ]
  %79 = getelementptr inbounds i32, ptr %13, i64 %indvars.iv89
  %80 = load i32, ptr %79, align 4, !tbaa !18
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds double, ptr %15, i64 %81
  %83 = load double, ptr %82, align 8, !tbaa !17
  %84 = fadd double %83, 1.000000e+00
  store double %84, ptr %82, align 8, !tbaa !17
  %85 = tail call double @llvm.maxnum.f64(double %.171, double 1.000000e+00)
  %gep = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv89
  %86 = load i32, ptr %gep, align 4, !tbaa !18
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds double, ptr %15, i64 %87
  %89 = load double, ptr %88, align 8, !tbaa !17
  %90 = fadd double %89, 1.000000e+00
  store double %90, ptr %88, align 8, !tbaa !17
  %indvars.iv.next90.1 = add nsw i64 %indvars.iv89, 2
  %exitcond93.not.1 = icmp eq i64 %indvars.iv.next90.1, %wide.trip.count92
  br i1 %exitcond93.not.1, label %.preheader, label %.lr.ph72, !llvm.loop !22

.lr.ph76:                                         ; preds = %.lr.ph76, %.lr.ph76.preheader.new
  %indvars.iv94 = phi i64 [ 0, %.lr.ph76.preheader.new ], [ %indvars.iv.next95.1, %.lr.ph76 ]
  %.05075 = phi double [ 0.000000e+00, %.lr.ph76.preheader.new ], [ %96, %.lr.ph76 ]
  %niter = phi i64 [ 0, %.lr.ph76.preheader.new ], [ %niter.next.1, %.lr.ph76 ]
  %91 = getelementptr inbounds double, ptr %15, i64 %indvars.iv94
  %92 = load double, ptr %91, align 8, !tbaa !17
  %93 = tail call double @llvm.maxnum.f64(double %.05075, double %92)
  %indvars.iv.next95 = or disjoint i64 %indvars.iv94, 1
  %94 = getelementptr inbounds double, ptr %15, i64 %indvars.iv.next95
  %95 = load double, ptr %94, align 8, !tbaa !17
  %96 = tail call double @llvm.maxnum.f64(double %93, double %95)
  %indvars.iv.next95.1 = add nuw nsw i64 %indvars.iv94, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge77.loopexit.unr-lcssa, label %.lr.ph76, !llvm.loop !23

._crit_edge77.loopexit.unr-lcssa:                 ; preds = %.lr.ph76, %.lr.ph76.preheader
  %.lcssa.ph = phi double [ poison, %.lr.ph76.preheader ], [ %96, %.lr.ph76 ]
  %indvars.iv94.unr = phi i64 [ 0, %.lr.ph76.preheader ], [ %indvars.iv.next95.1, %.lr.ph76 ]
  %.05075.unr = phi double [ 0.000000e+00, %.lr.ph76.preheader ], [ %96, %.lr.ph76 ]
  %lcmp.mod111.not = icmp eq i64 %xtraiter110, 0
  br i1 %lcmp.mod111.not, label %._crit_edge77, label %.lr.ph76.epil

.lr.ph76.epil:                                    ; preds = %._crit_edge77.loopexit.unr-lcssa
  %97 = getelementptr inbounds double, ptr %15, i64 %indvars.iv94.unr
  %98 = load double, ptr %97, align 8, !tbaa !17
  %99 = tail call double @llvm.maxnum.f64(double %.05075.unr, double %98)
  br label %._crit_edge77

._crit_edge77:                                    ; preds = %.lr.ph76.epil, %._crit_edge77.loopexit.unr-lcssa, %.preheader
  %.050.lcssa = phi double [ 0.000000e+00, %.preheader ], [ %.lcssa.ph, %._crit_edge77.loopexit.unr-lcssa ], [ %99, %.lr.ph76.epil ]
  %100 = getelementptr inbounds i8, ptr %0, i64 288
  store double %.1.lcssa, ptr %100, align 8, !tbaa !24
  %101 = getelementptr inbounds i8, ptr %0, i64 296
  store double %.050.lcssa, ptr %101, align 8, !tbaa !25
  ret void
}

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fabs.f64(double) #2

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.maxnum.f64(double, double) #2

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

attributes #0 = { 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 = { noreturn 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 #2 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { noreturn 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, !7, i64 84}
!6 = !{!"lu", !7, i64 0, !7, i64 4, !7, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !7, i64 40, !7, i64 44, !7, i64 48, !10, i64 56, !10, i64 64, !10, i64 72, !7, i64 80, !7, i64 84, !7, i64 88, !7, i64 92, !7, i64 96, !7, i64 100, !7, i64 104, !7, i64 108, !7, i64 112, !7, i64 116, !7, i64 120, !7, i64 124, !7, i64 128, !7, i64 132, !10, i64 136, !10, i64 144, !10, i64 152, !10, i64 160, !10, i64 168, !10, i64 176, !10, i64 184, !10, i64 192, !10, i64 200, !10, i64 208, !10, i64 216, !7, i64 224, !7, i64 228, !7, i64 232, !10, i64 240, !10, i64 248, !10, i64 256, !10, i64 264, !10, i64 272, !10, i64 280, !10, i64 288, !10, i64 296, !10, i64 304, !7, i64 312, !7, i64 316, !7, i64 320, !7, i64 324, !7, i64 328, !7, i64 332, !7, i64 336, !7, i64 340, !10, i64 344, !10, i64 352, !10, i64 360, !10, i64 368, !7, i64 376, !7, i64 380, !7, i64 384, !7, i64 388, !7, i64 392, !7, i64 396, !7, i64 400, !7, i64 404, !7, i64 408, !7, i64 412, !11, i64 416, !11, i64 424, !11, i64 432, !11, i64 440, !11, i64 448, !11, i64 456, !11, i64 464, !11, i64 472, !11, i64 480, !11, i64 488, !11, i64 496, !11, i64 504, !11, i64 512, !11, i64 520, !11, i64 528, !11, i64 536, !11, i64 544, !11, i64 552, !11, i64 560, !11, i64 568, !11, i64 576, !11, i64 584, !11, i64 592, !11, i64 600, !11, i64 608, !11, i64 616, !11, i64 624, !11, i64 632, !11, i64 640, !11, i64 648, !11, i64 656, !11, i64 664, !11, i64 672, !11, i64 680, !11, i64 688}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"double", !8, i64 0}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!6, !7, i64 316}
!13 = !{!6, !11, i64 472}
!14 = !{!6, !11, i64 488}
!15 = !{!6, !11, i64 672}
!16 = !{!6, !7, i64 100}
!17 = !{!10, !10, i64 0}
!18 = !{!7, !7, i64 0}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = distinct !{!21, !20}
!22 = distinct !{!22, !20}
!23 = distinct !{!23, !20}
!24 = !{!6, !10, i64 288}
!25 = !{!6, !10, i64 296}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopIdiomRecognizePass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass