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

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

; Function Attrs: nounwind uwtable
define dso_local void @lu_initialize(i32 noundef %0, ptr noundef %1, ptr noundef %2) #0 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca %struct.lu, align 8
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  store ptr %2, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 696, ptr %7) #3
  %8 = load ptr, ptr %5, align 8, !tbaa !9
  %9 = getelementptr inbounds i32, ptr %8, i64 0
  store i32 7743090, ptr %9, align 4, !tbaa !5
  %10 = load ptr, ptr %6, align 8, !tbaa !9
  %11 = getelementptr inbounds double, ptr %10, i64 0
  store double 7.743090e+06, ptr %11, align 8, !tbaa !11
  %12 = load i32, ptr %4, align 4, !tbaa !5
  %13 = sitofp i32 %12 to double
  %14 = load ptr, ptr %6, align 8, !tbaa !9
  %15 = getelementptr inbounds double, ptr %14, i64 64
  store double %13, ptr %15, align 8, !tbaa !11
  %16 = load ptr, ptr %6, align 8, !tbaa !9
  %17 = getelementptr inbounds double, ptr %16, i64 1
  store double 0.000000e+00, ptr %17, align 8, !tbaa !11
  %18 = load ptr, ptr %6, align 8, !tbaa !9
  %19 = getelementptr inbounds double, ptr %18, i64 2
  store double 0.000000e+00, ptr %19, align 8, !tbaa !11
  %20 = load ptr, ptr %6, align 8, !tbaa !9
  %21 = getelementptr inbounds double, ptr %20, i64 3
  store double 0.000000e+00, ptr %21, align 8, !tbaa !11
  %22 = load ptr, ptr %6, align 8, !tbaa !9
  %23 = getelementptr inbounds double, ptr %22, i64 4
  store double 0x3BC79CA10C924223, ptr %23, align 8, !tbaa !11
  %24 = load ptr, ptr %6, align 8, !tbaa !9
  %25 = getelementptr inbounds double, ptr %24, i64 5
  store double 0x3D06849B86A12B9B, ptr %25, align 8, !tbaa !11
  %26 = load ptr, ptr %6, align 8, !tbaa !9
  %27 = getelementptr inbounds double, ptr %26, i64 6
  store double 1.000000e-01, ptr %27, align 8, !tbaa !11
  %28 = load ptr, ptr %6, align 8, !tbaa !9
  %29 = getelementptr inbounds double, ptr %28, i64 7
  store double 1.000000e+00, ptr %29, align 8, !tbaa !11
  %30 = load ptr, ptr %6, align 8, !tbaa !9
  %31 = getelementptr inbounds double, ptr %30, i64 8
  store double 3.000000e+00, ptr %31, align 8, !tbaa !11
  %32 = load ptr, ptr %6, align 8, !tbaa !9
  %33 = getelementptr inbounds double, ptr %32, i64 9
  store double 4.000000e+00, ptr %33, align 8, !tbaa !11
  %34 = load ptr, ptr %6, align 8, !tbaa !9
  %35 = getelementptr inbounds double, ptr %34, i64 10
  store double 3.000000e-01, ptr %35, align 8, !tbaa !11
  %36 = load ptr, ptr %6, align 8, !tbaa !9
  %37 = getelementptr inbounds double, ptr %36, i64 11
  store double 5.000000e-01, ptr %37, align 8, !tbaa !11
  %38 = load ptr, ptr %6, align 8, !tbaa !9
  %39 = getelementptr inbounds double, ptr %38, i64 12
  store double 5.000000e-02, ptr %39, align 8, !tbaa !11
  %40 = load ptr, ptr %6, align 8, !tbaa !9
  %41 = getelementptr inbounds double, ptr %40, i64 13
  store double 0.000000e+00, ptr %41, align 8, !tbaa !11
  %42 = load ptr, ptr %6, align 8, !tbaa !9
  %43 = getelementptr inbounds double, ptr %42, i64 14
  store double 1.000000e+00, ptr %43, align 8, !tbaa !11
  %44 = load ptr, ptr %6, align 8, !tbaa !9
  %45 = getelementptr inbounds double, ptr %44, i64 72
  store double 0.000000e+00, ptr %45, align 8, !tbaa !11
  %46 = load ptr, ptr %6, align 8, !tbaa !9
  %47 = getelementptr inbounds double, ptr %46, i64 73
  store double 0.000000e+00, ptr %47, align 8, !tbaa !11
  %48 = load ptr, ptr %6, align 8, !tbaa !9
  %49 = getelementptr inbounds double, ptr %48, i64 74
  store double 0.000000e+00, ptr %49, align 8, !tbaa !11
  %50 = load ptr, ptr %6, align 8, !tbaa !9
  %51 = getelementptr inbounds double, ptr %50, i64 75
  store double 0.000000e+00, ptr %51, align 8, !tbaa !11
  %52 = load ptr, ptr %6, align 8, !tbaa !9
  %53 = getelementptr inbounds double, ptr %52, i64 85
  store double 0.000000e+00, ptr %53, align 8, !tbaa !11
  %54 = load ptr, ptr %6, align 8, !tbaa !9
  %55 = getelementptr inbounds double, ptr %54, i64 86
  store double 0.000000e+00, ptr %55, align 8, !tbaa !11
  %56 = load ptr, ptr %6, align 8, !tbaa !9
  %57 = getelementptr inbounds double, ptr %56, i64 87
  store double 0.000000e+00, ptr %57, align 8, !tbaa !11
  %58 = load ptr, ptr %5, align 8, !tbaa !9
  %59 = load ptr, ptr %6, align 8, !tbaa !9
  %60 = call i32 @lu_load(ptr noundef %7, ptr noundef %58, ptr noundef %59, ptr noundef null, ptr noundef null, ptr noundef null, ptr noundef null, ptr noundef null, ptr noundef null)
  call void @lu_reset(ptr noundef %7)
  %61 = load ptr, ptr %5, align 8, !tbaa !9
  %62 = load ptr, ptr %6, align 8, !tbaa !9
  %63 = call i32 @lu_save(ptr noundef %7, ptr noundef %61, ptr noundef %62, i32 noundef 0)
  call void @llvm.lifetime.end.p0(i64 696, ptr %7) #3
  ret void
}

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

declare i32 @lu_load(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #2

declare void @lu_reset(ptr noundef) #2

declare i32 @lu_save(ptr noundef, ptr noundef, ptr noundef, i32 noundef) #2

; 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 = { "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, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !7, 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"

%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 }

; Function Attrs: nounwind uwtable
define dso_local void @lu_initialize(i32 noundef %0, ptr noundef %1, ptr noundef %2) local_unnamed_addr #0 {
  %4 = alloca %struct.lu, align 8
  call void @llvm.lifetime.start.p0(i64 696, ptr nonnull %4) #4
  store i32 7743090, ptr %1, align 4, !tbaa !5
  store double 7.743090e+06, ptr %2, align 8, !tbaa !9
  %5 = sitofp i32 %0 to double
  %6 = getelementptr inbounds i8, ptr %2, i64 512
  store double %5, ptr %6, align 8, !tbaa !9
  %7 = getelementptr inbounds i8, ptr %2, i64 8
  %8 = getelementptr inbounds i8, ptr %2, i64 32
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %7, i8 0, i64 24, i1 false)
  store <2 x double> <double 0x3BC79CA10C924223, double 0x3D06849B86A12B9B>, ptr %8, align 8, !tbaa !9
  %9 = getelementptr inbounds i8, ptr %2, i64 48
  store <2 x double> <double 1.000000e-01, double 1.000000e+00>, ptr %9, align 8, !tbaa !9
  %10 = getelementptr inbounds i8, ptr %2, i64 64
  store <2 x double> <double 3.000000e+00, double 4.000000e+00>, ptr %10, align 8, !tbaa !9
  %11 = getelementptr inbounds i8, ptr %2, i64 80
  store <2 x double> <double 3.000000e-01, double 5.000000e-01>, ptr %11, align 8, !tbaa !9
  %12 = getelementptr inbounds i8, ptr %2, i64 96
  store <2 x double> <double 5.000000e-02, double 0.000000e+00>, ptr %12, align 8, !tbaa !9
  %13 = getelementptr inbounds i8, ptr %2, i64 112
  store double 1.000000e+00, ptr %13, align 8, !tbaa !9
  %14 = getelementptr inbounds i8, ptr %2, i64 576
  %15 = getelementptr inbounds i8, ptr %2, i64 680
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(32) %14, i8 0, i64 32, i1 false)
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %15, i8 0, i64 24, i1 false)
  %16 = call i32 @lu_load(ptr noundef nonnull %4, ptr noundef nonnull %1, ptr noundef nonnull %2, ptr noundef null, ptr noundef null, ptr noundef null, ptr noundef null, ptr noundef null, ptr noundef null) #4
  call void @lu_reset(ptr noundef nonnull %4) #4
  %17 = call i32 @lu_save(ptr noundef nonnull %4, ptr noundef nonnull %1, ptr noundef nonnull %2, i32 noundef 0) #4
  call void @llvm.lifetime.end.p0(i64 696, ptr nonnull %4) #4
  ret void
}

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

declare i32 @lu_load(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

declare void @lu_reset(ptr noundef) local_unnamed_addr #2

declare i32 @lu_save(ptr noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

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

; 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 nounwind willreturn memory(argmem: write) }
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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,MemCpyOptPass,SLPVectorizerPass,SROAPass,TailCallElimPass