; LLVM IR from Derek-TH-Wang/quadruped_ctrl :: src/osqp/src (auxil)

; 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.OSQPWorkspace = type { 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, i64, i64 }
%struct.OSQPSettings = type { double, double, i64, i64, i64, double, double, i64, double, double, double, double, double, i32, double, i64, i64, i64, i64, i64, i64, double }
%struct.OSQPScaling = type { double, ptr, ptr, double, ptr, ptr }
%struct.OSQPData = type { i64, i64, ptr, ptr, ptr, ptr, ptr }

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

declare double @vec_norm_inf(ptr noundef, i64 noundef) #1

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

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

declare void @mat_tpose_vec(ptr noundef, ptr noundef, ptr noundef, i64 noundef, i64 noundef) #1

; Function Attrs: nounwind uwtable
define dso_local i64 @is_primal_infeasible(ptr noundef %0, double noundef %1) #3 {
  %3 = alloca i64, align 8
  %4 = alloca ptr, align 8
  %5 = alloca double, align 8
  %6 = alloca i64, align 8
  %7 = alloca double, align 8
  %8 = alloca double, align 8
  %9 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store double %1, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %10 = load ptr, ptr %4, align 8, !tbaa !5
  %11 = getelementptr inbounds %struct.OSQPWorkspace, ptr %10, i32 0, i32 23
  %12 = load ptr, ptr %11, align 8, !tbaa !11
  %13 = getelementptr inbounds %struct.OSQPSettings, ptr %12, i32 0, i32 2
  %14 = load i64, ptr %13, align 8, !tbaa !14
  %15 = icmp ne i64 %14, 0
  br i1 %15, label %16, label %49

16:                                               ; preds = %2
  %17 = load ptr, ptr %4, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.OSQPWorkspace, ptr %17, i32 0, i32 23
  %19 = load ptr, ptr %18, align 8, !tbaa !11
  %20 = getelementptr inbounds %struct.OSQPSettings, ptr %19, i32 0, i32 18
  %21 = load i64, ptr %20, align 8, !tbaa !17
  %22 = icmp ne i64 %21, 0
  br i1 %22, label %49, label %23

23:                                               ; preds = %16
  %24 = load ptr, ptr %4, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.OSQPWorkspace, ptr %24, i32 0, i32 24
  %26 = load ptr, ptr %25, align 8, !tbaa !18
  %27 = getelementptr inbounds %struct.OSQPScaling, ptr %26, i32 0, i32 2
  %28 = load ptr, ptr %27, align 8, !tbaa !19
  %29 = load ptr, ptr %4, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.OSQPWorkspace, ptr %29, i32 0, i32 15
  %31 = load ptr, ptr %30, align 8, !tbaa !21
  %32 = load ptr, ptr %4, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.OSQPWorkspace, ptr %32, i32 0, i32 19
  %34 = load ptr, ptr %33, align 8, !tbaa !22
  %35 = load ptr, ptr %4, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.OSQPWorkspace, ptr %35, i32 0, i32 0
  %37 = load ptr, ptr %36, align 8, !tbaa !23
  %38 = getelementptr inbounds %struct.OSQPData, ptr %37, i32 0, i32 1
  %39 = load i64, ptr %38, align 8, !tbaa !24
  call void @vec_ew_prod(ptr noundef %28, ptr noundef %31, ptr noundef %34, i64 noundef %39)
  %40 = load ptr, ptr %4, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.OSQPWorkspace, ptr %40, i32 0, i32 19
  %42 = load ptr, ptr %41, align 8, !tbaa !22
  %43 = load ptr, ptr %4, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.OSQPWorkspace, ptr %43, i32 0, i32 0
  %45 = load ptr, ptr %44, align 8, !tbaa !23
  %46 = getelementptr inbounds %struct.OSQPData, ptr %45, i32 0, i32 1
  %47 = load i64, ptr %46, align 8, !tbaa !24
  %48 = call double @vec_norm_inf(ptr noundef %42, i64 noundef %47)
  store double %48, ptr %7, align 8, !tbaa !9
  br label %59

49:                                               ; preds = %16, %2
  %50 = load ptr, ptr %4, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.OSQPWorkspace, ptr %50, i32 0, i32 15
  %52 = load ptr, ptr %51, align 8, !tbaa !21
  %53 = load ptr, ptr %4, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.OSQPWorkspace, ptr %53, i32 0, i32 0
  %55 = load ptr, ptr %54, align 8, !tbaa !23
  %56 = getelementptr inbounds %struct.OSQPData, ptr %55, i32 0, i32 1
  %57 = load i64, ptr %56, align 8, !tbaa !24
  %58 = call double @vec_norm_inf(ptr noundef %52, i64 noundef %57)
  store double %58, ptr %7, align 8, !tbaa !9
  br label %59

59:                                               ; preds = %49, %23
  %60 = load double, ptr %7, align 8, !tbaa !9
  %61 = load double, ptr %5, align 8, !tbaa !9
  %62 = fcmp ogt double %60, %61
  br i1 %62, label %63, label %196

63:                                               ; preds = %59
  store double 0.000000e+00, ptr %8, align 8, !tbaa !9
  store i64 0, ptr %6, align 8, !tbaa !26
  br label %64

64:                                               ; preds = %127, %63
  %65 = load i64, ptr %6, align 8, !tbaa !26
  %66 = load ptr, ptr %4, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.OSQPWorkspace, ptr %66, i32 0, i32 0
  %68 = load ptr, ptr %67, align 8, !tbaa !23
  %69 = getelementptr inbounds %struct.OSQPData, ptr %68, i32 0, i32 1
  %70 = load i64, ptr %69, align 8, !tbaa !24
  %71 = icmp slt i64 %65, %70
  br i1 %71, label %72, label %130

72:                                               ; preds = %64
  %73 = load ptr, ptr %4, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.OSQPWorkspace, ptr %73, i32 0, i32 0
  %75 = load ptr, ptr %74, align 8, !tbaa !23
  %76 = getelementptr inbounds %struct.OSQPData, ptr %75, i32 0, i32 6
  %77 = load ptr, ptr %76, align 8, !tbaa !27
  %78 = load i64, ptr %6, align 8, !tbaa !26
  %79 = getelementptr inbounds double, ptr %77, i64 %78
  %80 = load double, ptr %79, align 8, !tbaa !9
  %81 = load ptr, ptr %4, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.OSQPWorkspace, ptr %81, i32 0, i32 15
  %83 = load ptr, ptr %82, align 8, !tbaa !21
  %84 = load i64, ptr %6, align 8, !tbaa !26
  %85 = getelementptr inbounds double, ptr %83, i64 %84
  %86 = load double, ptr %85, align 8, !tbaa !9
  %87 = fcmp ogt double %86, 0.000000e+00
  br i1 %87, label %88, label %95

88:                                               ; preds = %72
  %89 = load ptr, ptr %4, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.OSQPWorkspace, ptr %89, i32 0, i32 15
  %91 = load ptr, ptr %90, align 8, !tbaa !21
  %92 = load i64, ptr %6, align 8, !tbaa !26
  %93 = getelementptr inbounds double, ptr %91, i64 %92
  %94 = load double, ptr %93, align 8, !tbaa !9
  br label %96

95:                                               ; preds = %72
  br label %96

96:                                               ; preds = %95, %88
  %97 = phi double [ %94, %88 ], [ 0.000000e+00, %95 ]
  %98 = load ptr, ptr %4, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.OSQPWorkspace, ptr %98, i32 0, i32 0
  %100 = load ptr, ptr %99, align 8, !tbaa !23
  %101 = getelementptr inbounds %struct.OSQPData, ptr %100, i32 0, i32 5
  %102 = load ptr, ptr %101, align 8, !tbaa !28
  %103 = load i64, ptr %6, align 8, !tbaa !26
  %104 = getelementptr inbounds double, ptr %102, i64 %103
  %105 = load double, ptr %104, align 8, !tbaa !9
  %106 = load ptr, ptr %4, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.OSQPWorkspace, ptr %106, i32 0, i32 15
  %108 = load ptr, ptr %107, align 8, !tbaa !21
  %109 = load i64, ptr %6, align 8, !tbaa !26
  %110 = getelementptr inbounds double, ptr %108, i64 %109
  %111 = load double, ptr %110, align 8, !tbaa !9
  %112 = fcmp olt double %111, 0.000000e+00
  br i1 %112, label %113, label %120

113:                                              ; preds = %96
  %114 = load ptr, ptr %4, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.OSQPWorkspace, ptr %114, i32 0, i32 15
  %116 = load ptr, ptr %115, align 8, !tbaa !21
  %117 = load i64, ptr %6, align 8, !tbaa !26
  %118 = getelementptr inbounds double, ptr %116, i64 %117
  %119 = load double, ptr %118, align 8, !tbaa !9
  br label %121

120:                                              ; preds = %96
  br label %121

121:                                              ; preds = %120, %113
  %122 = phi double [ %119, %113 ], [ 0.000000e+00, %120 ]
  %123 = fmul double %105, %122
  %124 = call double @llvm.fmuladd.f64(double %80, double %97, double %123)
  %125 = load double, ptr %8, align 8, !tbaa !9
  %126 = fadd double %125, %124
  store double %126, ptr %8, align 8, !tbaa !9
  br label %127

127:                                              ; preds = %121
  %128 = load i64, ptr %6, align 8, !tbaa !26
  %129 = add nsw i64 %128, 1
  store i64 %129, ptr %6, align 8, !tbaa !26
  br label %64, !llvm.loop !29

130:                                              ; preds = %64
  %131 = load double, ptr %8, align 8, !tbaa !9
  %132 = load double, ptr %5, align 8, !tbaa !9
  %133 = fneg double %132
  %134 = load double, ptr %7, align 8, !tbaa !9
  %135 = fmul double %133, %134
  %136 = fcmp olt double %131, %135
  br i1 %136, label %137, label %195

137:                                              ; preds = %130
  %138 = load ptr, ptr %4, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct.OSQPWorkspace, ptr %138, i32 0, i32 0
  %140 = load ptr, ptr %139, align 8, !tbaa !23
  %141 = getelementptr inbounds %struct.OSQPData, ptr %140, i32 0, i32 3
  %142 = load ptr, ptr %141, align 8, !tbaa !31
  %143 = load ptr, ptr %4, align 8, !tbaa !5
  %144 = getelementptr inbounds %struct.OSQPWorkspace, ptr %143, i32 0, i32 15
  %145 = load ptr, ptr %144, align 8, !tbaa !21
  %146 = load ptr, ptr %4, align 8, !tbaa !5
  %147 = getelementptr inbounds %struct.OSQPWorkspace, ptr %146, i32 0, i32 16
  %148 = load ptr, ptr %147, align 8, !tbaa !32
  call void @mat_tpose_vec(ptr noundef %142, ptr noundef %145, ptr noundef %148, i64 noundef 0, i64 noundef 0)
  %149 = load ptr, ptr %4, align 8, !tbaa !5
  %150 = getelementptr inbounds %struct.OSQPWorkspace, ptr %149, i32 0, i32 23
  %151 = load ptr, ptr %150, align 8, !tbaa !11
  %152 = getelementptr inbounds %struct.OSQPSettings, ptr %151, i32 0, i32 2
  %153 = load i64, ptr %152, align 8, !tbaa !14
  %154 = icmp ne i64 %153, 0
  br i1 %154, label %155, label %179

155:                                              ; preds = %137
  %156 = load ptr, ptr %4, align 8, !tbaa !5
  %157 = getelementptr inbounds %struct.OSQPWorkspace, ptr %156, i32 0, i32 23
  %158 = load ptr, ptr %157, align 8, !tbaa !11
  %159 = getelementptr inbounds %struct.OSQPSettings, ptr %158, i32 0, i32 18
  %160 = load i64, ptr %159, align 8, !tbaa !17
  %161 = icmp ne i64 %160, 0
  br i1 %161, label %179, label %162

162:                                              ; preds = %155
  %163 = load ptr, ptr %4, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct.OSQPWorkspace, ptr %163, i32 0, i32 24
  %165 = load ptr, ptr %164, align 8, !tbaa !18
  %166 = getelementptr inbounds %struct.OSQPScaling, ptr %165, i32 0, i32 4
  %167 = load ptr, ptr %166, align 8, !tbaa !33
  %168 = load ptr, ptr %4, align 8, !tbaa !5
  %169 = getelementptr inbounds %struct.OSQPWorkspace, ptr %168, i32 0, i32 16
  %170 = load ptr, ptr %169, align 8, !tbaa !32
  %171 = load ptr, ptr %4, align 8, !tbaa !5
  %172 = getelementptr inbounds %struct.OSQPWorkspace, ptr %171, i32 0, i32 16
  %173 = load ptr, ptr %172, align 8, !tbaa !32
  %174 = load ptr, ptr %4, align 8, !tbaa !5
  %175 = getelementptr inbounds %struct.OSQPWorkspace, ptr %174, i32 0, i32 0
  %176 = load ptr, ptr %175, align 8, !tbaa !23
  %177 = getelementptr inbounds %struct.OSQPData, ptr %176, i32 0, i32 0
  %178 = load i64, ptr %177, align 8, !tbaa !34
  call void @vec_ew_prod(ptr noundef %167, ptr noundef %170, ptr noundef %173, i64 noundef %178)
  br label %179

179:                                              ; preds = %162, %155, %137
  %180 = load ptr, ptr %4, align 8, !tbaa !5
  %181 = getelementptr inbounds %struct.OSQPWorkspace, ptr %180, i32 0, i32 16
  %182 = load ptr, ptr %181, align 8, !tbaa !32
  %183 = load ptr, ptr %4, align 8, !tbaa !5
  %184 = getelementptr inbounds %struct.OSQPWorkspace, ptr %183, i32 0, i32 0
  %185 = load ptr, ptr %184, align 8, !tbaa !23
  %186 = getelementptr inbounds %struct.OSQPData, ptr %185, i32 0, i32 0
  %187 = load i64, ptr %186, align 8, !tbaa !34
  %188 = call double @vec_norm_inf(ptr noundef %182, i64 noundef %187)
  %189 = load double, ptr %5, align 8, !tbaa !9
  %190 = load double, ptr %7, align 8, !tbaa !9
  %191 = fmul double %189, %190
  %192 = fcmp olt double %188, %191
  %193 = zext i1 %192 to i32
  %194 = sext i32 %193 to i64
  store i64 %194, ptr %3, align 8
  store i32 1, ptr %9, align 4
  br label %197

195:                                              ; preds = %130
  br label %196

196:                                              ; preds = %195, %59
  store i64 0, ptr %3, align 8
  store i32 1, ptr %9, align 4
  br label %197

197:                                              ; preds = %196, %179
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  %198 = load i64, ptr %3, align 8
  ret i64 %198
}

declare void @vec_ew_prod(ptr noundef, ptr noundef, ptr noundef, i64 noundef) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 speculatable willreturn memory(none) }
attributes #3 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = !{!12, !6, i64 184}
!12 = !{!"", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !6, i64 184, !6, i64 192, !6, i64 200, !6, i64 208, !6, i64 216, !13, i64 224, !13, i64 232}
!13 = !{!"long long", !7, i64 0}
!14 = !{!15, !13, i64 16}
!15 = !{!"", !10, i64 0, !10, i64 8, !13, i64 16, !13, i64 24, !13, i64 32, !10, i64 40, !10, i64 48, !13, i64 56, !10, i64 64, !10, i64 72, !10, i64 80, !10, i64 88, !10, i64 96, !16, i64 104, !10, i64 112, !13, i64 120, !13, i64 128, !13, i64 136, !13, i64 144, !13, i64 152, !13, i64 160, !10, i64 168}
!16 = !{!"int", !7, i64 0}
!17 = !{!15, !13, i64 144}
!18 = !{!12, !6, i64 192}
!19 = !{!20, !6, i64 16}
!20 = !{!"", !10, i64 0, !6, i64 8, !6, i64 16, !10, i64 24, !6, i64 32, !6, i64 40}
!21 = !{!12, !6, i64 120}
!22 = !{!12, !6, i64 152}
!23 = !{!12, !6, i64 0}
!24 = !{!25, !13, i64 8}
!25 = !{!"", !13, i64 0, !13, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48}
!26 = !{!13, !13, i64 0}
!27 = !{!25, !6, i64 48}
!28 = !{!25, !6, i64 40}
!29 = distinct !{!29, !30}
!30 = !{!"llvm.loop.mustprogress"}
!31 = !{!25, !6, i64 24}
!32 = !{!12, !6, i64 128}
!33 = !{!20, !6, i64 32}
!34 = !{!25, !13, i64 0}


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

declare double @vec_norm_inf(ptr noundef, i64 noundef) local_unnamed_addr #0

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

declare void @mat_tpose_vec(ptr noundef, ptr noundef, ptr noundef, i64 noundef, i64 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local range(i64 0, 2) i64 @is_primal_infeasible(ptr nocapture noundef readonly %0, double noundef %1) local_unnamed_addr #2 {
  %3 = getelementptr inbounds i8, ptr %0, i64 184
  %4 = load ptr, ptr %3, align 8, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %4, i64 16
  %6 = load i64, ptr %5, align 8, !tbaa !11
  %.not = icmp eq i64 %6, 0
  br i1 %.not, label %22, label %7

7:                                                ; preds = %2
  %8 = getelementptr inbounds i8, ptr %4, i64 144
  %9 = load i64, ptr %8, align 8, !tbaa !15
  %.not50 = icmp eq i64 %9, 0
  br i1 %.not50, label %10, label %22

10:                                               ; preds = %7
  %11 = getelementptr inbounds i8, ptr %0, i64 192
  %12 = load ptr, ptr %11, align 8, !tbaa !16
  %13 = getelementptr inbounds i8, ptr %12, i64 16
  %14 = load ptr, ptr %13, align 8, !tbaa !17
  %15 = getelementptr inbounds i8, ptr %0, i64 120
  %16 = load ptr, ptr %15, align 8, !tbaa !19
  %17 = getelementptr inbounds i8, ptr %0, i64 152
  %18 = load ptr, ptr %17, align 8, !tbaa !20
  %19 = load ptr, ptr %0, align 8, !tbaa !21
  %20 = getelementptr inbounds i8, ptr %19, i64 8
  %21 = load i64, ptr %20, align 8, !tbaa !22
  tail call void @vec_ew_prod(ptr noundef %14, ptr noundef %16, ptr noundef %18, i64 noundef %21) #3
  br label %24

22:                                               ; preds = %7, %2
  %23 = getelementptr inbounds i8, ptr %0, i64 120
  br label %24

24:                                               ; preds = %22, %10
  %.sink59 = phi ptr [ %23, %22 ], [ %17, %10 ]
  %25 = load ptr, ptr %.sink59, align 8, !tbaa !24
  %26 = load ptr, ptr %0, align 8, !tbaa !21
  %27 = getelementptr inbounds i8, ptr %26, i64 8
  %28 = load i64, ptr %27, align 8, !tbaa !22
  %29 = tail call double @vec_norm_inf(ptr noundef %25, i64 noundef %28) #3
  %30 = fcmp ogt double %29, %1
  br i1 %30, label %.preheader, label %88

.preheader:                                       ; preds = %24
  %31 = load ptr, ptr %0, align 8, !tbaa !21
  %32 = getelementptr inbounds i8, ptr %31, i64 8
  %33 = load i64, ptr %32, align 8, !tbaa !22
  %34 = icmp sgt i64 %33, 0
  br i1 %34, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader
  %35 = getelementptr inbounds i8, ptr %31, i64 48
  %36 = load ptr, ptr %35, align 8, !tbaa !25
  %37 = getelementptr inbounds i8, ptr %0, i64 120
  %38 = load ptr, ptr %37, align 8, !tbaa !19
  %39 = getelementptr inbounds i8, ptr %31, i64 40
  %40 = load ptr, ptr %39, align 8, !tbaa !26
  br label %41

41:                                               ; preds = %.lr.ph, %41
  %.054 = phi double [ 0.000000e+00, %.lr.ph ], [ %54, %41 ]
  %.04553 = phi i64 [ 0, %.lr.ph ], [ %55, %41 ]
  %42 = getelementptr inbounds double, ptr %36, i64 %.04553
  %43 = load double, ptr %42, align 8, !tbaa !27
  %44 = getelementptr inbounds double, ptr %38, i64 %.04553
  %45 = load double, ptr %44, align 8, !tbaa !27
  %46 = fcmp ogt double %45, 0.000000e+00
  %47 = select i1 %46, double %45, double 0.000000e+00
  %48 = getelementptr inbounds double, ptr %40, i64 %.04553
  %49 = load double, ptr %48, align 8, !tbaa !27
  %50 = fcmp olt double %45, 0.000000e+00
  %51 = select i1 %50, double %45, double 0.000000e+00
  %52 = fmul double %49, %51
  %53 = tail call double @llvm.fmuladd.f64(double %43, double %47, double %52)
  %54 = fadd double %.054, %53
  %55 = add nuw nsw i64 %.04553, 1
  %exitcond.not = icmp eq i64 %55, %33
  br i1 %exitcond.not, label %._crit_edge, label %41, !llvm.loop !28

._crit_edge:                                      ; preds = %41, %.preheader
  %.0.lcssa = phi double [ 0.000000e+00, %.preheader ], [ %54, %41 ]
  %56 = fneg double %1
  %57 = fmul double %29, %56
  %58 = fcmp olt double %.0.lcssa, %57
  br i1 %58, label %59, label %88

59:                                               ; preds = %._crit_edge
  %60 = getelementptr inbounds i8, ptr %31, i64 24
  %61 = load ptr, ptr %60, align 8, !tbaa !30
  %62 = getelementptr inbounds i8, ptr %0, i64 120
  %63 = load ptr, ptr %62, align 8, !tbaa !19
  %64 = getelementptr inbounds i8, ptr %0, i64 128
  %65 = load ptr, ptr %64, align 8, !tbaa !31
  tail call void @mat_tpose_vec(ptr noundef %61, ptr noundef %63, ptr noundef %65, i64 noundef 0, i64 noundef 0) #3
  %66 = load ptr, ptr %3, align 8, !tbaa !5
  %67 = getelementptr inbounds i8, ptr %66, i64 16
  %68 = load i64, ptr %67, align 8, !tbaa !11
  %.not51 = icmp eq i64 %68, 0
  br i1 %.not51, label %80, label %69

69:                                               ; preds = %59
  %70 = getelementptr inbounds i8, ptr %66, i64 144
  %71 = load i64, ptr %70, align 8, !tbaa !15
  %.not52 = icmp eq i64 %71, 0
  br i1 %.not52, label %72, label %80

72:                                               ; preds = %69
  %73 = getelementptr inbounds i8, ptr %0, i64 192
  %74 = load ptr, ptr %73, align 8, !tbaa !16
  %75 = getelementptr inbounds i8, ptr %74, i64 32
  %76 = load ptr, ptr %75, align 8, !tbaa !32
  %77 = load ptr, ptr %64, align 8, !tbaa !31
  %78 = load ptr, ptr %0, align 8, !tbaa !21
  %79 = load i64, ptr %78, align 8, !tbaa !33
  tail call void @vec_ew_prod(ptr noundef %76, ptr noundef %77, ptr noundef %77, i64 noundef %79) #3
  br label %80

80:                                               ; preds = %72, %69, %59
  %81 = load ptr, ptr %64, align 8, !tbaa !31
  %82 = load ptr, ptr %0, align 8, !tbaa !21
  %83 = load i64, ptr %82, align 8, !tbaa !33
  %84 = tail call double @vec_norm_inf(ptr noundef %81, i64 noundef %83) #3
  %85 = fmul double %29, %1
  %86 = fcmp olt double %84, %85
  %87 = zext i1 %86 to i64
  br label %88

88:                                               ; preds = %24, %._crit_edge, %80
  %.046 = phi i64 [ %87, %80 ], [ 0, %._crit_edge ], [ 0, %24 ]
  ret i64 %.046
}

declare void @vec_ew_prod(ptr noundef, ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #0

attributes #0 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { 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 #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, !7, i64 184}
!6 = !{!"", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !7, i64 56, !7, i64 64, !7, i64 72, !7, i64 80, !7, i64 88, !7, i64 96, !7, i64 104, !7, i64 112, !7, i64 120, !7, i64 128, !7, i64 136, !7, i64 144, !7, i64 152, !7, i64 160, !7, i64 168, !7, i64 176, !7, i64 184, !7, i64 192, !7, i64 200, !7, i64 208, !7, i64 216, !10, i64 224, !10, i64 232}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"long long", !8, i64 0}
!11 = !{!12, !10, i64 16}
!12 = !{!"", !13, i64 0, !13, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !13, i64 40, !13, i64 48, !10, i64 56, !13, i64 64, !13, i64 72, !13, i64 80, !13, i64 88, !13, i64 96, !14, i64 104, !13, i64 112, !10, i64 120, !10, i64 128, !10, i64 136, !10, i64 144, !10, i64 152, !10, i64 160, !13, i64 168}
!13 = !{!"double", !8, i64 0}
!14 = !{!"int", !8, i64 0}
!15 = !{!12, !10, i64 144}
!16 = !{!6, !7, i64 192}
!17 = !{!18, !7, i64 16}
!18 = !{!"", !13, i64 0, !7, i64 8, !7, i64 16, !13, i64 24, !7, i64 32, !7, i64 40}
!19 = !{!6, !7, i64 120}
!20 = !{!6, !7, i64 152}
!21 = !{!6, !7, i64 0}
!22 = !{!23, !10, i64 8}
!23 = !{!"", !10, i64 0, !10, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48}
!24 = !{!7, !7, i64 0}
!25 = !{!23, !7, i64 48}
!26 = !{!23, !7, i64 40}
!27 = !{!13, !13, i64 0}
!28 = distinct !{!28, !29}
!29 = !{!"llvm.loop.mustprogress"}
!30 = !{!23, !7, i64 24}
!31 = !{!6, !7, i64 128}
!32 = !{!18, !7, i64 32}
!33 = !{!23, !10, i64 0}


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