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

@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [19 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @update_status(ptr noundef %0, i64 noundef %1) #0 {
  %3 = alloca ptr, align 8
  %4 = alloca i64, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store i64 %1, ptr %4, align 8, !tbaa !9
  %5 = load i64, ptr %4, align 8, !tbaa !9
  %6 = load ptr, ptr %3, align 8, !tbaa !5
  %7 = getelementptr inbounds %struct.OSQPInfo, ptr %6, i32 0, i32 2
  store i64 %5, ptr %7, align 8, !tbaa !11
  %8 = load i64, ptr %4, align 8, !tbaa !9
  %9 = icmp eq i64 %8, 1
  br i1 %9, label %10, label %14

10:                                               ; preds = %2
  %11 = load ptr, ptr %3, align 8, !tbaa !5
  %12 = getelementptr inbounds %struct.OSQPInfo, ptr %11, i32 0, i32 1
  %13 = getelementptr inbounds [32 x i8], ptr %12, i64 0, i64 0
  call void @c_strcpy(ptr noundef %13, ptr noundef @.str)
  br label %14

14:                                               ; preds = %10, %2
  %15 = load i64, ptr %4, align 8, !tbaa !9
  %16 = icmp eq i64 %15, 2
  br i1 %16, label %17, label %21

17:                                               ; preds = %14
  %18 = load ptr, ptr %3, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.OSQPInfo, ptr %18, i32 0, i32 1
  %20 = getelementptr inbounds [32 x i8], ptr %19, i64 0, i64 0
  call void @c_strcpy(ptr noundef %20, ptr noundef @.str.1)
  br label %93

21:                                               ; preds = %14
  %22 = load i64, ptr %4, align 8, !tbaa !9
  %23 = icmp eq i64 %22, -3
  br i1 %23, label %24, label %28

24:                                               ; preds = %21
  %25 = load ptr, ptr %3, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.OSQPInfo, ptr %25, i32 0, i32 1
  %27 = getelementptr inbounds [32 x i8], ptr %26, i64 0, i64 0
  call void @c_strcpy(ptr noundef %27, ptr noundef @.str.2)
  br label %92

28:                                               ; preds = %21
  %29 = load i64, ptr %4, align 8, !tbaa !9
  %30 = icmp eq i64 %29, 3
  br i1 %30, label %31, label %35

31:                                               ; preds = %28
  %32 = load ptr, ptr %3, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.OSQPInfo, ptr %32, i32 0, i32 1
  %34 = getelementptr inbounds [32 x i8], ptr %33, i64 0, i64 0
  call void @c_strcpy(ptr noundef %34, ptr noundef @.str.3)
  br label %91

35:                                               ; preds = %28
  %36 = load i64, ptr %4, align 8, !tbaa !9
  %37 = icmp eq i64 %36, -10
  br i1 %37, label %38, label %42

38:                                               ; preds = %35
  %39 = load ptr, ptr %3, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.OSQPInfo, ptr %39, i32 0, i32 1
  %41 = getelementptr inbounds [32 x i8], ptr %40, i64 0, i64 0
  call void @c_strcpy(ptr noundef %41, ptr noundef @.str.4)
  br label %90

42:                                               ; preds = %35
  %43 = load i64, ptr %4, align 8, !tbaa !9
  %44 = icmp eq i64 %43, -4
  br i1 %44, label %45, label %49

45:                                               ; preds = %42
  %46 = load ptr, ptr %3, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.OSQPInfo, ptr %46, i32 0, i32 1
  %48 = getelementptr inbounds [32 x i8], ptr %47, i64 0, i64 0
  call void @c_strcpy(ptr noundef %48, ptr noundef @.str.5)
  br label %89

49:                                               ; preds = %42
  %50 = load i64, ptr %4, align 8, !tbaa !9
  %51 = icmp eq i64 %50, 4
  br i1 %51, label %52, label %56

52:                                               ; preds = %49
  %53 = load ptr, ptr %3, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.OSQPInfo, ptr %53, i32 0, i32 1
  %55 = getelementptr inbounds [32 x i8], ptr %54, i64 0, i64 0
  call void @c_strcpy(ptr noundef %55, ptr noundef @.str.6)
  br label %88

56:                                               ; preds = %49
  %57 = load i64, ptr %4, align 8, !tbaa !9
  %58 = icmp eq i64 %57, -2
  br i1 %58, label %59, label %63

59:                                               ; preds = %56
  %60 = load ptr, ptr %3, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.OSQPInfo, ptr %60, i32 0, i32 1
  %62 = getelementptr inbounds [32 x i8], ptr %61, i64 0, i64 0
  call void @c_strcpy(ptr noundef %62, ptr noundef @.str.7)
  br label %87

63:                                               ; preds = %56
  %64 = load i64, ptr %4, align 8, !tbaa !9
  %65 = icmp eq i64 %64, -6
  br i1 %65, label %66, label %70

66:                                               ; preds = %63
  %67 = load ptr, ptr %3, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.OSQPInfo, ptr %67, i32 0, i32 1
  %69 = getelementptr inbounds [32 x i8], ptr %68, i64 0, i64 0
  call void @c_strcpy(ptr noundef %69, ptr noundef @.str.8)
  br label %86

70:                                               ; preds = %63
  %71 = load i64, ptr %4, align 8, !tbaa !9
  %72 = icmp eq i64 %71, -5
  br i1 %72, label %73, label %77

73:                                               ; preds = %70
  %74 = load ptr, ptr %3, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.OSQPInfo, ptr %74, i32 0, i32 1
  %76 = getelementptr inbounds [32 x i8], ptr %75, i64 0, i64 0
  call void @c_strcpy(ptr noundef %76, ptr noundef @.str.9)
  br label %85

77:                                               ; preds = %70
  %78 = load i64, ptr %4, align 8, !tbaa !9
  %79 = icmp eq i64 %78, -7
  br i1 %79, label %80, label %84

80:                                               ; preds = %77
  %81 = load ptr, ptr %3, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.OSQPInfo, ptr %81, i32 0, i32 1
  %83 = getelementptr inbounds [32 x i8], ptr %82, i64 0, i64 0
  call void @c_strcpy(ptr noundef %83, ptr noundef @.str.10)
  br label %84

84:                                               ; preds = %80, %77
  br label %85

85:                                               ; preds = %84, %73
  br label %86

86:                                               ; preds = %85, %66
  br label %87

87:                                               ; preds = %86, %59
  br label %88

88:                                               ; preds = %87, %52
  br label %89

89:                                               ; preds = %88, %45
  br label %90

90:                                               ; preds = %89, %38
  br label %91

91:                                               ; preds = %90, %31
  br label %92

92:                                               ; preds = %91, %24
  br label %93

93:                                               ; preds = %92, %17
  ret void
}

declare void @c_strcpy(ptr noundef, ptr noundef) #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" }

!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, !10, i64 40}
!12 = !{!"", !10, i64 0, !7, 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}
!13 = !{!"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"

@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [19 x i8], align 1
@switch.table.update_status = private unnamed_addr constant [15 x ptr] [ptr @.str.4, ptr @.str, ptr @.str, ptr @.str.10, ptr @.str.8, ptr @.str.9, ptr @.str.5, ptr @.str.2, ptr @.str.7, ptr @.str, ptr @.str, ptr @.str, ptr @.str.1, ptr @.str.3, ptr @.str.6], align 8

; Function Attrs: nounwind uwtable
define dso_local void @update_status(ptr noundef %0, i64 noundef %1) local_unnamed_addr #0 {
  %3 = getelementptr inbounds i8, ptr %0, i64 40
  store i64 %1, ptr %3, align 8, !tbaa !5
  %switch.tableidx = add i64 %1, 10
  %4 = icmp ult i64 %switch.tableidx, 15
  br i1 %4, label %switch.hole_check, label %6

switch.hole_check:                                ; preds = %2
  %switch.maskindex = trunc nuw i64 %switch.tableidx to i16
  %switch.shifted = lshr i16 31225, %switch.maskindex
  %switch.lobit = trunc i16 %switch.shifted to i1
  br i1 %switch.lobit, label %switch.lookup, label %6

switch.lookup:                                    ; preds = %switch.hole_check
  %switch.gep = getelementptr inbounds [15 x ptr], ptr @switch.table.update_status, i64 0, i64 %switch.tableidx
  %switch.load = load ptr, ptr %switch.gep, align 8
  %5 = getelementptr inbounds i8, ptr %0, i64 8
  tail call void @c_strcpy(ptr noundef nonnull %5, ptr noundef nonnull %switch.load) #2
  br label %6

6:                                                ; preds = %switch.hole_check, %2, %switch.lookup
  ret void
}

declare void @c_strcpy(ptr noundef, 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 40}
!6 = !{!"", !7, i64 0, !8, i64 8, !7, i64 40, !7, i64 48, !10, i64 56, !10, i64 64, !10, i64 72, !10, i64 80, !10, i64 88, !10, i64 96, !10, i64 104, !10, i64 112, !7, i64 120, !10, i64 128}
!7 = !{!"long long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"double", !8, i64 0}


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