; 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.OSQPPolish = type { ptr, i64, i64, ptr, ptr, ptr, ptr, ptr, ptr, ptr, double, double, double }
%struct.OSQPInfo = type { i64, [32 x i8], i64, i64, double, double, double, double, double, double, double, double, i64, double }
%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

; 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 double @compute_obj_val(ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local double @compute_pri_res(ptr noundef, ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local double @compute_dua_res(ptr noundef, ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local void @update_info(ptr noundef %0, i64 noundef %1, i64 noundef %2, i64 noundef %3) #1 {
  %5 = alloca ptr, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store i64 %1, ptr %6, align 8, !tbaa !9
  store i64 %2, ptr %7, align 8, !tbaa !9
  store i64 %3, ptr %8, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #3
  %16 = load i64, ptr %8, align 8, !tbaa !9
  %17 = icmp ne i64 %16, 0
  br i1 %17, label %18, label %50

18:                                               ; preds = %4
  %19 = load ptr, ptr %5, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.OSQPWorkspace, ptr %19, i32 0, i32 2
  %21 = load ptr, ptr %20, align 8, !tbaa !11
  %22 = getelementptr inbounds %struct.OSQPPolish, ptr %21, i32 0, i32 7
  %23 = load ptr, ptr %22, align 8, !tbaa !13
  store ptr %23, ptr %9, align 8, !tbaa !5
  %24 = load ptr, ptr %5, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.OSQPWorkspace, ptr %24, i32 0, i32 2
  %26 = load ptr, ptr %25, align 8, !tbaa !11
  %27 = getelementptr inbounds %struct.OSQPPolish, ptr %26, i32 0, i32 9
  %28 = load ptr, ptr %27, align 8, !tbaa !16
  store ptr %28, ptr %11, align 8, !tbaa !5
  %29 = load ptr, ptr %5, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.OSQPWorkspace, ptr %29, i32 0, i32 2
  %31 = load ptr, ptr %30, align 8, !tbaa !11
  %32 = getelementptr inbounds %struct.OSQPPolish, ptr %31, i32 0, i32 8
  %33 = load ptr, ptr %32, align 8, !tbaa !17
  store ptr %33, ptr %10, align 8, !tbaa !5
  %34 = load ptr, ptr %5, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.OSQPWorkspace, ptr %34, i32 0, i32 2
  %36 = load ptr, ptr %35, align 8, !tbaa !11
  %37 = getelementptr inbounds %struct.OSQPPolish, ptr %36, i32 0, i32 10
  store ptr %37, ptr %12, align 8, !tbaa !5
  %38 = load ptr, ptr %5, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.OSQPWorkspace, ptr %38, i32 0, i32 2
  %40 = load ptr, ptr %39, align 8, !tbaa !11
  %41 = getelementptr inbounds %struct.OSQPPolish, ptr %40, i32 0, i32 11
  store ptr %41, ptr %13, align 8, !tbaa !5
  %42 = load ptr, ptr %5, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.OSQPWorkspace, ptr %42, i32 0, i32 2
  %44 = load ptr, ptr %43, align 8, !tbaa !11
  %45 = getelementptr inbounds %struct.OSQPPolish, ptr %44, i32 0, i32 12
  store ptr %45, ptr %14, align 8, !tbaa !5
  %46 = load ptr, ptr %5, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.OSQPWorkspace, ptr %46, i32 0, i32 26
  %48 = load ptr, ptr %47, align 8, !tbaa !18
  %49 = getelementptr inbounds %struct.OSQPInfo, ptr %48, i32 0, i32 10
  store ptr %49, ptr %15, align 8, !tbaa !5
  br label %81

50:                                               ; preds = %4
  %51 = load ptr, ptr %5, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.OSQPWorkspace, ptr %51, i32 0, i32 6
  %53 = load ptr, ptr %52, align 8, !tbaa !19
  store ptr %53, ptr %9, align 8, !tbaa !5
  %54 = load ptr, ptr %5, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.OSQPWorkspace, ptr %54, i32 0, i32 7
  %56 = load ptr, ptr %55, align 8, !tbaa !20
  store ptr %56, ptr %11, align 8, !tbaa !5
  %57 = load ptr, ptr %5, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.OSQPWorkspace, ptr %57, i32 0, i32 8
  %59 = load ptr, ptr %58, align 8, !tbaa !21
  store ptr %59, ptr %10, align 8, !tbaa !5
  %60 = load ptr, ptr %5, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.OSQPWorkspace, ptr %60, i32 0, i32 26
  %62 = load ptr, ptr %61, align 8, !tbaa !18
  %63 = getelementptr inbounds %struct.OSQPInfo, ptr %62, i32 0, i32 4
  store ptr %63, ptr %12, align 8, !tbaa !5
  %64 = load ptr, ptr %5, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.OSQPWorkspace, ptr %64, i32 0, i32 26
  %66 = load ptr, ptr %65, align 8, !tbaa !18
  %67 = getelementptr inbounds %struct.OSQPInfo, ptr %66, i32 0, i32 5
  store ptr %67, ptr %13, align 8, !tbaa !5
  %68 = load ptr, ptr %5, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.OSQPWorkspace, ptr %68, i32 0, i32 26
  %70 = load ptr, ptr %69, align 8, !tbaa !18
  %71 = getelementptr inbounds %struct.OSQPInfo, ptr %70, i32 0, i32 6
  store ptr %71, ptr %14, align 8, !tbaa !5
  %72 = load i64, ptr %6, align 8, !tbaa !9
  %73 = load ptr, ptr %5, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.OSQPWorkspace, ptr %73, i32 0, i32 26
  %75 = load ptr, ptr %74, align 8, !tbaa !18
  %76 = getelementptr inbounds %struct.OSQPInfo, ptr %75, i32 0, i32 0
  store i64 %72, ptr %76, align 8, !tbaa !22
  %77 = load ptr, ptr %5, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.OSQPWorkspace, ptr %77, i32 0, i32 26
  %79 = load ptr, ptr %78, align 8, !tbaa !18
  %80 = getelementptr inbounds %struct.OSQPInfo, ptr %79, i32 0, i32 8
  store ptr %80, ptr %15, align 8, !tbaa !5
  br label %81

81:                                               ; preds = %50, %18
  %82 = load i64, ptr %7, align 8, !tbaa !9
  %83 = icmp ne i64 %82, 0
  br i1 %83, label %84, label %89

84:                                               ; preds = %81
  %85 = load ptr, ptr %5, align 8, !tbaa !5
  %86 = load ptr, ptr %9, align 8, !tbaa !5
  %87 = call double @compute_obj_val(ptr noundef %85, ptr noundef %86)
  %88 = load ptr, ptr %12, align 8, !tbaa !5
  store double %87, ptr %88, align 8, !tbaa !24
  br label %89

89:                                               ; preds = %84, %81
  %90 = load ptr, ptr %5, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.OSQPWorkspace, ptr %90, i32 0, i32 0
  %92 = load ptr, ptr %91, align 8, !tbaa !25
  %93 = getelementptr inbounds %struct.OSQPData, ptr %92, i32 0, i32 1
  %94 = load i64, ptr %93, align 8, !tbaa !26
  %95 = icmp eq i64 %94, 0
  br i1 %95, label %96, label %98

96:                                               ; preds = %89
  %97 = load ptr, ptr %13, align 8, !tbaa !5
  store double 0.000000e+00, ptr %97, align 8, !tbaa !24
  br label %104

98:                                               ; preds = %89
  %99 = load ptr, ptr %5, align 8, !tbaa !5
  %100 = load ptr, ptr %9, align 8, !tbaa !5
  %101 = load ptr, ptr %10, align 8, !tbaa !5
  %102 = call double @compute_pri_res(ptr noundef %99, ptr noundef %100, ptr noundef %101)
  %103 = load ptr, ptr %13, align 8, !tbaa !5
  store double %102, ptr %103, align 8, !tbaa !24
  br label %104

104:                                              ; preds = %98, %96
  %105 = load ptr, ptr %5, align 8, !tbaa !5
  %106 = load ptr, ptr %9, align 8, !tbaa !5
  %107 = load ptr, ptr %11, align 8, !tbaa !5
  %108 = call double @compute_dua_res(ptr noundef %105, ptr noundef %106, ptr noundef %107)
  %109 = load ptr, ptr %14, align 8, !tbaa !5
  store double %108, ptr %109, align 8, !tbaa !24
  %110 = load ptr, ptr %5, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.OSQPWorkspace, ptr %110, i32 0, i32 27
  %112 = load ptr, ptr %111, align 8, !tbaa !28
  %113 = call double @osqp_toc(ptr noundef %112)
  %114 = load ptr, ptr %15, align 8, !tbaa !5
  store double %113, ptr %114, align 8, !tbaa !24
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  ret void
}

declare double @osqp_toc(ptr noundef) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = !{!12, !6, i64 16}
!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, !10, i64 224, !10, i64 232}
!13 = !{!14, !6, i64 56}
!14 = !{!"", !6, i64 0, !10, i64 8, !10, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !15, i64 80, !15, i64 88, !15, i64 96}
!15 = !{!"double", !7, i64 0}
!16 = !{!14, !6, i64 72}
!17 = !{!14, !6, i64 64}
!18 = !{!12, !6, i64 208}
!19 = !{!12, !6, i64 48}
!20 = !{!12, !6, i64 56}
!21 = !{!12, !6, i64 64}
!22 = !{!23, !10, i64 0}
!23 = !{!"", !10, i64 0, !7, i64 8, !10, i64 40, !10, i64 48, !15, i64 56, !15, i64 64, !15, i64 72, !15, i64 80, !15, i64 88, !15, i64 96, !15, i64 104, !15, i64 112, !10, i64 120, !15, i64 128}
!24 = !{!15, !15, i64 0}
!25 = !{!12, !6, i64 0}
!26 = !{!27, !10, i64 8}
!27 = !{!"", !10, i64 0, !10, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48}
!28 = !{!12, !6, i64 216}


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

; Function Attrs: nounwind uwtable
declare dso_local double @compute_obj_val(ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local double @compute_pri_res(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local double @compute_dua_res(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local void @update_info(ptr noundef %0, i64 noundef %1, i64 noundef %2, i64 noundef %3) local_unnamed_addr #0 {
  %.not = icmp eq i64 %3, 0
  br i1 %.not, label %20, label %5

5:                                                ; preds = %4
  %6 = getelementptr inbounds i8, ptr %0, i64 16
  %7 = load ptr, ptr %6, align 8, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %7, i64 56
  %9 = load ptr, ptr %8, align 8, !tbaa !11
  %10 = getelementptr inbounds i8, ptr %7, i64 72
  %11 = load ptr, ptr %10, align 8, !tbaa !14
  %12 = getelementptr inbounds i8, ptr %7, i64 64
  %13 = load ptr, ptr %12, align 8, !tbaa !15
  %14 = getelementptr inbounds i8, ptr %7, i64 80
  %15 = getelementptr inbounds i8, ptr %7, i64 88
  %16 = getelementptr inbounds i8, ptr %7, i64 96
  %17 = getelementptr inbounds i8, ptr %0, i64 208
  %18 = load ptr, ptr %17, align 8, !tbaa !16
  %19 = getelementptr inbounds i8, ptr %18, i64 104
  br label %33

20:                                               ; preds = %4
  %21 = getelementptr inbounds i8, ptr %0, i64 48
  %22 = load ptr, ptr %21, align 8, !tbaa !17
  %23 = getelementptr inbounds i8, ptr %0, i64 56
  %24 = load ptr, ptr %23, align 8, !tbaa !18
  %25 = getelementptr inbounds i8, ptr %0, i64 64
  %26 = load ptr, ptr %25, align 8, !tbaa !19
  %27 = getelementptr inbounds i8, ptr %0, i64 208
  %28 = load ptr, ptr %27, align 8, !tbaa !16
  %29 = getelementptr inbounds i8, ptr %28, i64 56
  %30 = getelementptr inbounds i8, ptr %28, i64 64
  %31 = getelementptr inbounds i8, ptr %28, i64 72
  store i64 %1, ptr %28, align 8, !tbaa !20
  %32 = getelementptr inbounds i8, ptr %28, i64 88
  br label %33

33:                                               ; preds = %20, %5
  %.037 = phi ptr [ %9, %5 ], [ %22, %20 ]
  %.036 = phi ptr [ %13, %5 ], [ %26, %20 ]
  %.035 = phi ptr [ %11, %5 ], [ %24, %20 ]
  %.034 = phi ptr [ %14, %5 ], [ %29, %20 ]
  %.033 = phi ptr [ %15, %5 ], [ %30, %20 ]
  %.032 = phi ptr [ %16, %5 ], [ %31, %20 ]
  %.0 = phi ptr [ %19, %5 ], [ %32, %20 ]
  %.not38 = icmp eq i64 %2, 0
  br i1 %.not38, label %36, label %34

34:                                               ; preds = %33
  %35 = tail call double @compute_obj_val(ptr noundef nonnull %0, ptr noundef %.037)
  store double %35, ptr %.034, align 8, !tbaa !22
  br label %36

36:                                               ; preds = %34, %33
  %37 = load ptr, ptr %0, align 8, !tbaa !23
  %38 = getelementptr inbounds i8, ptr %37, i64 8
  %39 = load i64, ptr %38, align 8, !tbaa !24
  %40 = icmp eq i64 %39, 0
  br i1 %40, label %43, label %41

41:                                               ; preds = %36
  %42 = tail call double @compute_pri_res(ptr noundef nonnull %0, ptr noundef %.037, ptr noundef %.036)
  br label %43

43:                                               ; preds = %36, %41
  %storemerge = phi double [ %42, %41 ], [ 0.000000e+00, %36 ]
  store double %storemerge, ptr %.033, align 8, !tbaa !22
  %44 = tail call double @compute_dua_res(ptr noundef nonnull %0, ptr noundef %.037, ptr noundef %.035)
  store double %44, ptr %.032, align 8, !tbaa !22
  %45 = getelementptr inbounds i8, ptr %0, i64 216
  %46 = load ptr, ptr %45, align 8, !tbaa !26
  %47 = tail call double @osqp_toc(ptr noundef %46) #2
  store double %47, ptr %.0, align 8, !tbaa !22
  ret void
}

declare double @osqp_toc(ptr noundef) local_unnamed_addr #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 = { "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 }

!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 16}
!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, !7, i64 56}
!12 = !{!"", !7, i64 0, !10, i64 8, !10, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !7, i64 56, !7, i64 64, !7, i64 72, !13, i64 80, !13, i64 88, !13, i64 96}
!13 = !{!"double", !8, i64 0}
!14 = !{!12, !7, i64 72}
!15 = !{!12, !7, i64 64}
!16 = !{!6, !7, i64 208}
!17 = !{!6, !7, i64 48}
!18 = !{!6, !7, i64 56}
!19 = !{!6, !7, i64 64}
!20 = !{!21, !10, i64 0}
!21 = !{!"", !10, i64 0, !8, i64 8, !10, i64 40, !10, i64 48, !13, i64 56, !13, i64 64, !13, i64 72, !13, i64 80, !13, i64 88, !13, i64 96, !13, i64 104, !13, i64 112, !10, i64 120, !13, i64 128}
!22 = !{!13, !13, i64 0}
!23 = !{!6, !7, i64 0}
!24 = !{!25, !10, i64 8}
!25 = !{!"", !10, i64 0, !10, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48}
!26 = !{!6, !7, i64 216}


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