; LLVM IR from stan-dev/math :: lib/sundials_6.1.1/src/kinsol (kinsol_ls)

; 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._generic_N_Vector = type { ptr, ptr, ptr }
%struct._generic_N_Vector_Ops = 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, 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 }
%struct.KINMemRec = type { ptr, double, ptr, ptr, double, double, i32, i32, i64, i64, i64, i64, i32, i32, i32, i32, i32, i32, i32, i32, double, double, double, double, double, double, double, double, double, i32, double, i64, i64, i64, i64, i64, i64, i64, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, double, ptr, ptr, ptr, ptr, ptr, double, ptr, ptr, ptr, ptr, i64, i64, i32, ptr, ptr, i32, ptr, ptr, i64, i64, i64, i64, ptr, ptr, ptr, ptr, i32, ptr, double, double, double, double, double, i32, double, double, double, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.KINLsMemRec = type { i32, i32, i32, ptr, ptr, ptr, ptr, double, i64, i64, i64, i64, i64, i64, i64, i32, i32, ptr, ptr, ptr, ptr, i32, ptr, ptr, ptr }

@.str = external hidden unnamed_addr constant [6 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.46 = external hidden unnamed_addr constant [14 x i8], align 1

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

declare void @KINProcessError(ptr noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef, ...) #1

; Function Attrs: nounwind uwtable
define dso_local i32 @kinLsDQJtimes(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4) #2 {
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca double, align 8
  %13 = alloca double, align 8
  %14 = alloca double, align 8
  %15 = alloca double, align 8
  %16 = alloca double, align 8
  %17 = alloca double, align 8
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  store ptr %2, ptr %9, align 8, !tbaa !5
  store ptr %3, ptr %10, align 8, !tbaa !5
  store ptr %4, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #4
  %22 = load ptr, ptr %11, align 8, !tbaa !5
  %23 = call i32 @kinLs_AccessLMem(ptr noundef %22, ptr noundef @.str.46, ptr noundef %18, ptr noundef %19)
  store i32 %23, ptr %20, align 4, !tbaa !9
  %24 = load i32, ptr %20, align 4, !tbaa !9
  %25 = icmp ne i32 %24, 0
  br i1 %25, label %26, label %28

26:                                               ; preds = %5
  %27 = load i32, ptr %20, align 4, !tbaa !9
  store i32 %27, ptr %6, align 4
  store i32 1, ptr %21, align 4
  br label %150

28:                                               ; preds = %5
  %29 = load ptr, ptr %7, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct._generic_N_Vector, ptr %29, i32 0, i32 1
  %31 = load ptr, ptr %30, align 8, !tbaa !11
  %32 = getelementptr inbounds %struct._generic_N_Vector_Ops, ptr %31, i32 0, i32 12
  %33 = load ptr, ptr %32, align 8, !tbaa !13
  %34 = icmp eq ptr %33, null
  br i1 %34, label %56, label %35

35:                                               ; preds = %28
  %36 = load ptr, ptr %7, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct._generic_N_Vector, ptr %36, i32 0, i32 1
  %38 = load ptr, ptr %37, align 8, !tbaa !11
  %39 = getelementptr inbounds %struct._generic_N_Vector_Ops, ptr %38, i32 0, i32 18
  %40 = load ptr, ptr %39, align 8, !tbaa !15
  %41 = icmp eq ptr %40, null
  br i1 %41, label %56, label %42

42:                                               ; preds = %35
  %43 = load ptr, ptr %7, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct._generic_N_Vector, ptr %43, i32 0, i32 1
  %45 = load ptr, ptr %44, align 8, !tbaa !11
  %46 = getelementptr inbounds %struct._generic_N_Vector_Ops, ptr %45, i32 0, i32 24
  %47 = load ptr, ptr %46, align 8, !tbaa !16
  %48 = icmp eq ptr %47, null
  br i1 %48, label %56, label %49

49:                                               ; preds = %42
  %50 = load ptr, ptr %7, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct._generic_N_Vector, ptr %50, i32 0, i32 1
  %52 = load ptr, ptr %51, align 8, !tbaa !11
  %53 = getelementptr inbounds %struct._generic_N_Vector_Ops, ptr %52, i32 0, i32 10
  %54 = load ptr, ptr %53, align 8, !tbaa !17
  %55 = icmp eq ptr %54, null
  br i1 %55, label %56, label %58

56:                                               ; preds = %49, %42, %35, %28
  %57 = load ptr, ptr %18, align 8, !tbaa !5
  call void (ptr, i32, ptr, ptr, ptr, ...) @KINProcessError(ptr noundef %57, i32 noundef -3, ptr noundef @.str, ptr noundef @.str.46, ptr noundef @.str.6)
  store i32 -3, ptr %6, align 4
  store i32 1, ptr %21, align 4
  br label %150

58:                                               ; preds = %49
  %59 = load ptr, ptr %7, align 8, !tbaa !5
  %60 = load ptr, ptr %18, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.KINMemRec, ptr %60, i32 0, i32 42
  %62 = load ptr, ptr %61, align 8, !tbaa !18
  %63 = load ptr, ptr %18, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.KINMemRec, ptr %63, i32 0, i32 46
  %65 = load ptr, ptr %64, align 8, !tbaa !22
  call void @N_VProd(ptr noundef %59, ptr noundef %62, ptr noundef %65)
  %66 = load ptr, ptr %9, align 8, !tbaa !5
  %67 = load ptr, ptr %18, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.KINMemRec, ptr %67, i32 0, i32 42
  %69 = load ptr, ptr %68, align 8, !tbaa !18
  %70 = load ptr, ptr %8, align 8, !tbaa !5
  call void @N_VProd(ptr noundef %66, ptr noundef %69, ptr noundef %70)
  %71 = load ptr, ptr %8, align 8, !tbaa !5
  %72 = load ptr, ptr %18, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.KINMemRec, ptr %72, i32 0, i32 46
  %74 = load ptr, ptr %73, align 8, !tbaa !22
  %75 = call double @N_VDotProd(ptr noundef %71, ptr noundef %74)
  store double %75, ptr %14, align 8, !tbaa !23
  %76 = load ptr, ptr %18, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.KINMemRec, ptr %76, i32 0, i32 46
  %78 = load ptr, ptr %77, align 8, !tbaa !22
  %79 = load ptr, ptr %18, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.KINMemRec, ptr %79, i32 0, i32 46
  %81 = load ptr, ptr %80, align 8, !tbaa !22
  %82 = call double @N_VDotProd(ptr noundef %78, ptr noundef %81)
  store double %82, ptr %17, align 8, !tbaa !23
  %83 = load ptr, ptr %18, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.KINMemRec, ptr %83, i32 0, i32 46
  %85 = load ptr, ptr %84, align 8, !tbaa !22
  %86 = call double @N_VL1Norm(ptr noundef %85)
  store double %86, ptr %15, align 8, !tbaa !23
  %87 = load double, ptr %14, align 8, !tbaa !23
  %88 = fcmp oge double %87, 0.000000e+00
  %89 = zext i1 %88 to i64
  %90 = select i1 %88, double 1.000000e+00, double -1.000000e+00
  store double %90, ptr %16, align 8, !tbaa !23
  %91 = load double, ptr %16, align 8, !tbaa !23
  %92 = load ptr, ptr %18, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.KINMemRec, ptr %92, i32 0, i32 22
  %94 = load double, ptr %93, align 8, !tbaa !24
  %95 = fmul double %91, %94
  %96 = load double, ptr %14, align 8, !tbaa !23
  %97 = call double @llvm.fabs.f64(double %96)
  %98 = load double, ptr %15, align 8, !tbaa !23
  %99 = fcmp ogt double %97, %98
  br i1 %99, label %100, label %103

100:                                              ; preds = %58
  %101 = load double, ptr %14, align 8, !tbaa !23
  %102 = call double @llvm.fabs.f64(double %101)
  br label %105

103:                                              ; preds = %58
  %104 = load double, ptr %15, align 8, !tbaa !23
  br label %105

105:                                              ; preds = %103, %100
  %106 = phi double [ %102, %100 ], [ %104, %103 ]
  %107 = fmul double %95, %106
  %108 = load double, ptr %17, align 8, !tbaa !23
  %109 = fdiv double %107, %108
  store double %109, ptr %12, align 8, !tbaa !23
  %110 = load double, ptr %12, align 8, !tbaa !23
  %111 = fdiv double 1.000000e+00, %110
  store double %111, ptr %13, align 8, !tbaa !23
  %112 = load ptr, ptr %9, align 8, !tbaa !5
  %113 = load double, ptr %12, align 8, !tbaa !23
  %114 = load ptr, ptr %7, align 8, !tbaa !5
  %115 = load ptr, ptr %18, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.KINMemRec, ptr %115, i32 0, i32 46
  %117 = load ptr, ptr %116, align 8, !tbaa !22
  call void @N_VLinearSum(double noundef 1.000000e+00, ptr noundef %112, double noundef %113, ptr noundef %114, ptr noundef %117)
  %118 = load ptr, ptr %19, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct.KINLsMemRec, ptr %118, i32 0, i32 23
  %120 = load ptr, ptr %119, align 8, !tbaa !25
  %121 = load ptr, ptr %18, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.KINMemRec, ptr %121, i32 0, i32 46
  %123 = load ptr, ptr %122, align 8, !tbaa !22
  %124 = load ptr, ptr %18, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct.KINMemRec, ptr %124, i32 0, i32 47
  %126 = load ptr, ptr %125, align 8, !tbaa !27
  %127 = load ptr, ptr %18, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.KINMemRec, ptr %127, i32 0, i32 3
  %129 = load ptr, ptr %128, align 8, !tbaa !28
  %130 = call i32 %120(ptr noundef %123, ptr noundef %126, ptr noundef %129)
  store i32 %130, ptr %20, align 4, !tbaa !9
  %131 = load ptr, ptr %19, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct.KINLsMemRec, ptr %131, i32 0, i32 9
  %133 = load i64, ptr %132, align 8, !tbaa !29
  %134 = add nsw i64 %133, 1
  store i64 %134, ptr %132, align 8, !tbaa !29
  %135 = load i32, ptr %20, align 4, !tbaa !9
  %136 = icmp ne i32 %135, 0
  br i1 %136, label %137, label %139

137:                                              ; preds = %105
  %138 = load i32, ptr %20, align 4, !tbaa !9
  store i32 %138, ptr %6, align 4
  store i32 1, ptr %21, align 4
  br label %150

139:                                              ; preds = %105
  %140 = load double, ptr %13, align 8, !tbaa !23
  %141 = load ptr, ptr %18, align 8, !tbaa !5
  %142 = getelementptr inbounds %struct.KINMemRec, ptr %141, i32 0, i32 47
  %143 = load ptr, ptr %142, align 8, !tbaa !27
  %144 = load double, ptr %13, align 8, !tbaa !23
  %145 = fneg double %144
  %146 = load ptr, ptr %18, align 8, !tbaa !5
  %147 = getelementptr inbounds %struct.KINMemRec, ptr %146, i32 0, i32 40
  %148 = load ptr, ptr %147, align 8, !tbaa !30
  %149 = load ptr, ptr %8, align 8, !tbaa !5
  call void @N_VLinearSum(double noundef %140, ptr noundef %143, double noundef %145, ptr noundef %148, ptr noundef %149)
  store i32 0, ptr %6, align 4
  store i32 1, ptr %21, align 4
  br label %150

150:                                              ; preds = %139, %137, %56, %26
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 8, 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 8, ptr %12) #4
  %151 = load i32, ptr %6, align 4
  ret i32 %151
}

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @kinLs_AccessLMem(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #2

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

declare void @N_VLinearSum(double noundef, ptr noundef, double noundef, ptr noundef, ptr noundef) #1

declare void @N_VProd(ptr noundef, ptr noundef, ptr noundef) #1

declare double @N_VDotProd(ptr noundef, ptr noundef) #1

declare double @N_VL1Norm(ptr 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 = { 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 8}
!12 = !{!"_generic_N_Vector", !6, i64 0, !6, i64 8, !6, i64 16}
!13 = !{!14, !6, i64 96}
!14 = !{!"_generic_N_Vector_Ops", !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, !6, i64 224, !6, i64 232, !6, i64 240, !6, i64 248, !6, i64 256, !6, i64 264, !6, i64 272, !6, i64 280, !6, i64 288, !6, i64 296, !6, i64 304, !6, i64 312, !6, i64 320, !6, i64 328, !6, i64 336, !6, i64 344, !6, i64 352, !6, i64 360, !6, i64 368, !6, i64 376, !6, i64 384, !6, i64 392, !6, i64 400, !6, i64 408, !6, i64 416, !6, i64 424, !6, i64 432}
!15 = !{!14, !6, i64 144}
!16 = !{!14, !6, i64 192}
!17 = !{!14, !6, i64 80}
!18 = !{!19, !6, i64 296}
!19 = !{!"KINMemRec", !6, i64 0, !20, i64 8, !6, i64 16, !6, i64 24, !20, i64 32, !20, i64 40, !10, i64 48, !10, i64 52, !21, i64 56, !21, i64 64, !21, i64 72, !21, i64 80, !10, i64 88, !10, i64 92, !10, i64 96, !10, i64 100, !10, i64 104, !10, i64 108, !10, i64 112, !10, i64 116, !20, i64 120, !20, i64 128, !20, i64 136, !20, i64 144, !20, i64 152, !20, i64 160, !20, i64 168, !20, i64 176, !20, i64 184, !10, i64 192, !20, i64 200, !21, i64 208, !21, i64 216, !21, i64 224, !21, i64 232, !21, i64 240, !21, i64 248, !21, i64 256, !6, i64 264, !6, i64 272, !6, i64 280, !6, i64 288, !6, i64 296, !6, i64 304, !6, i64 312, !6, i64 320, !6, i64 328, !6, i64 336, !6, i64 344, !10, i64 352, !10, i64 356, !20, i64 360, !6, i64 368, !6, i64 376, !6, i64 384, !6, i64 392, !6, i64 400, !20, i64 408, !6, i64 416, !6, i64 424, !6, i64 432, !6, i64 440, !21, i64 448, !21, i64 456, !10, i64 464, !6, i64 472, !6, i64 480, !10, i64 488, !6, i64 496, !6, i64 504, !21, i64 512, !21, i64 520, !21, i64 528, !21, i64 536, !6, i64 544, !6, i64 552, !6, i64 560, !6, i64 568, !10, i64 576, !6, i64 584, !20, i64 592, !20, i64 600, !20, i64 608, !20, i64 616, !20, i64 624, !10, i64 632, !20, i64 640, !20, i64 648, !20, i64 656, !10, i64 664, !6, i64 672, !6, i64 680, !6, i64 688, !6, i64 696, !6, i64 704, !6, i64 712, !6, i64 720}
!20 = !{!"double", !7, i64 0}
!21 = !{!"long", !7, i64 0}
!22 = !{!19, !6, i64 328}
!23 = !{!20, !20, i64 0}
!24 = !{!19, !20, i64 136}
!25 = !{!26, !6, i64 168}
!26 = !{!"KINLsMemRec", !10, i64 0, !10, i64 4, !10, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !20, i64 48, !21, i64 56, !21, i64 64, !21, i64 72, !21, i64 80, !21, i64 88, !21, i64 96, !21, i64 104, !10, i64 112, !10, i64 116, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !10, i64 152, !6, i64 160, !6, i64 168, !6, i64 176}
!27 = !{!19, !6, i64 336}
!28 = !{!19, !6, i64 24}
!29 = !{!26, !21, i64 64}
!30 = !{!19, !6, i64 280}


; 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 [6 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.46 = external hidden unnamed_addr constant [14 x i8], align 1

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

declare void @KINProcessError(ptr noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef, ...) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local i32 @kinLsDQJtimes(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr nocapture noundef readnone %3, ptr noundef %4) local_unnamed_addr #2 {
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #4
  %8 = call i32 @kinLs_AccessLMem(ptr noundef %4, ptr noundef nonnull @.str.46, ptr noundef nonnull %6, ptr noundef nonnull %7)
  %.not = icmp eq i32 %8, 0
  br i1 %.not, label %9, label %86

9:                                                ; preds = %5
  %10 = getelementptr inbounds i8, ptr %0, i64 8
  %11 = load ptr, ptr %10, align 8, !tbaa !5
  %12 = getelementptr inbounds i8, ptr %11, i64 96
  %13 = load ptr, ptr %12, align 8, !tbaa !10
  %14 = icmp eq ptr %13, null
  br i1 %14, label %27, label %15

15:                                               ; preds = %9
  %16 = getelementptr inbounds i8, ptr %11, i64 144
  %17 = load ptr, ptr %16, align 8, !tbaa !12
  %18 = icmp eq ptr %17, null
  br i1 %18, label %27, label %19

19:                                               ; preds = %15
  %20 = getelementptr inbounds i8, ptr %11, i64 192
  %21 = load ptr, ptr %20, align 8, !tbaa !13
  %22 = icmp eq ptr %21, null
  br i1 %22, label %27, label %23

23:                                               ; preds = %19
  %24 = getelementptr inbounds i8, ptr %11, i64 80
  %25 = load ptr, ptr %24, align 8, !tbaa !14
  %26 = icmp eq ptr %25, null
  br i1 %26, label %27, label %29

27:                                               ; preds = %23, %19, %15, %9
  %28 = load ptr, ptr %6, align 8, !tbaa !15
  call void (ptr, i32, ptr, ptr, ptr, ...) @KINProcessError(ptr noundef %28, i32 noundef -3, ptr noundef nonnull @.str, ptr noundef nonnull @.str.46, ptr noundef nonnull @.str.6) #4
  br label %86

29:                                               ; preds = %23
  %30 = load ptr, ptr %6, align 8, !tbaa !15
  %31 = getelementptr inbounds i8, ptr %30, i64 296
  %32 = load ptr, ptr %31, align 8, !tbaa !16
  %33 = getelementptr inbounds i8, ptr %30, i64 328
  %34 = load ptr, ptr %33, align 8, !tbaa !21
  call void @N_VProd(ptr noundef nonnull %0, ptr noundef %32, ptr noundef %34) #4
  %35 = load ptr, ptr %6, align 8, !tbaa !15
  %36 = getelementptr inbounds i8, ptr %35, i64 296
  %37 = load ptr, ptr %36, align 8, !tbaa !16
  call void @N_VProd(ptr noundef %2, ptr noundef %37, ptr noundef %1) #4
  %38 = load ptr, ptr %6, align 8, !tbaa !15
  %39 = getelementptr inbounds i8, ptr %38, i64 328
  %40 = load ptr, ptr %39, align 8, !tbaa !21
  %41 = call double @N_VDotProd(ptr noundef %1, ptr noundef %40) #4
  %42 = load ptr, ptr %6, align 8, !tbaa !15
  %43 = getelementptr inbounds i8, ptr %42, i64 328
  %44 = load ptr, ptr %43, align 8, !tbaa !21
  %45 = call double @N_VDotProd(ptr noundef %44, ptr noundef %44) #4
  %46 = load ptr, ptr %6, align 8, !tbaa !15
  %47 = getelementptr inbounds i8, ptr %46, i64 328
  %48 = load ptr, ptr %47, align 8, !tbaa !21
  %49 = call double @N_VL1Norm(ptr noundef %48) #4
  %50 = fcmp oge double %41, 0.000000e+00
  %51 = load ptr, ptr %6, align 8, !tbaa !15
  %52 = getelementptr inbounds i8, ptr %51, i64 136
  %53 = load double, ptr %52, align 8, !tbaa !22
  %54 = fneg double %53
  %55 = select i1 %50, double %53, double %54
  %56 = call double @llvm.fabs.f64(double %41)
  %57 = fcmp ogt double %56, %49
  %58 = select i1 %57, double %56, double %49
  %59 = fmul double %58, %55
  %60 = fdiv double %59, %45
  %61 = getelementptr inbounds i8, ptr %51, i64 328
  %62 = load ptr, ptr %61, align 8, !tbaa !21
  call void @N_VLinearSum(double noundef 1.000000e+00, ptr noundef %2, double noundef %60, ptr noundef nonnull %0, ptr noundef %62) #4
  %63 = load ptr, ptr %7, align 8, !tbaa !15
  %64 = getelementptr inbounds i8, ptr %63, i64 168
  %65 = load ptr, ptr %64, align 8, !tbaa !23
  %66 = load ptr, ptr %6, align 8, !tbaa !15
  %67 = getelementptr inbounds i8, ptr %66, i64 328
  %68 = load ptr, ptr %67, align 8, !tbaa !21
  %69 = getelementptr inbounds i8, ptr %66, i64 336
  %70 = load ptr, ptr %69, align 8, !tbaa !25
  %71 = getelementptr inbounds i8, ptr %66, i64 24
  %72 = load ptr, ptr %71, align 8, !tbaa !26
  %73 = call i32 %65(ptr noundef %68, ptr noundef %70, ptr noundef %72) #4
  %74 = load ptr, ptr %7, align 8, !tbaa !15
  %75 = getelementptr inbounds i8, ptr %74, i64 64
  %76 = load i64, ptr %75, align 8, !tbaa !27
  %77 = add nsw i64 %76, 1
  store i64 %77, ptr %75, align 8, !tbaa !27
  %.not29 = icmp eq i32 %73, 0
  br i1 %.not29, label %78, label %86

78:                                               ; preds = %29
  %79 = fdiv double 1.000000e+00, %60
  %80 = load ptr, ptr %6, align 8, !tbaa !15
  %81 = getelementptr inbounds i8, ptr %80, i64 336
  %82 = load ptr, ptr %81, align 8, !tbaa !25
  %83 = fneg double %79
  %84 = getelementptr inbounds i8, ptr %80, i64 280
  %85 = load ptr, ptr %84, align 8, !tbaa !28
  call void @N_VLinearSum(double noundef %79, ptr noundef %82, double noundef %83, ptr noundef %85, ptr noundef %1) #4
  br label %86

86:                                               ; preds = %29, %5, %78, %27
  %.0 = phi i32 [ -3, %27 ], [ 0, %78 ], [ %8, %5 ], [ %73, %29 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  ret i32 %.0
}

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @kinLs_AccessLMem(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

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

declare void @N_VLinearSum(double noundef, ptr noundef, double noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare void @N_VProd(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare double @N_VDotProd(ptr noundef, ptr noundef) local_unnamed_addr #1

declare double @N_VL1Norm(ptr noundef) local_unnamed_addr #1

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


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass