; LLVM IR from Zhefan-Xu/Intent-MPC :: trajectory_planner/include/trajectory_planner/mpc_solver (acado_solver)

; 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.ACADOvariables_ = type { i32, [248 x double], [150 x double], [5611 x double], [240 x double], [3 x double], [8 x double], [150 x double], [150 x double], [1230 x double], [1230 x double] }
%struct.ACADOworkspace_ = type { double, [298 x double], [448 x double], [298 x double], [240 x double], [3 x double], [1920 x double], [1200 x double], [194 x double], [8 x double], [1183 x double], [194 x double], [574 x double], [1230 x double], [9840 x double], [6150 x double], [8 x double], [64 x double], [18600 x double], [18600 x double], [248 x double], [1200 x double], [9840 x double], [1230 x double], [22500 x double], [184500 x double], [150 x double], [150 x double], [150 x double], [1230 x double], [1230 x double], [150 x double], [1380 x double] }

@acadoVariables = external global %struct.ACADOvariables_, align 8
@acadoWorkspace = external global %struct.ACADOworkspace_, align 8

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

declare i32 @acado_integrate(ptr noundef, i32 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: nounwind uwtable
define dso_local void @acado_shiftStates(i32 noundef %0, ptr noundef %1, ptr noundef %2) #2 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  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 4, ptr %7) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %9

9:                                                ; preds = %100, %3
  %10 = load i32, ptr %7, align 4, !tbaa !5
  %11 = icmp slt i32 %10, 30
  br i1 %11, label %12, label %103

12:                                               ; preds = %9
  %13 = load i32, ptr %7, align 4, !tbaa !5
  %14 = mul nsw i32 %13, 8
  %15 = add nsw i32 %14, 8
  %16 = sext i32 %15 to i64
  %17 = getelementptr inbounds [248 x double], ptr getelementptr inbounds (%struct.ACADOvariables_, ptr @acadoVariables, i32 0, i32 1), i64 0, i64 %16
  %18 = load double, ptr %17, align 8, !tbaa !11
  %19 = load i32, ptr %7, align 4, !tbaa !5
  %20 = mul nsw i32 %19, 8
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds [248 x double], ptr getelementptr inbounds (%struct.ACADOvariables_, ptr @acadoVariables, i32 0, i32 1), i64 0, i64 %21
  store double %18, ptr %22, align 8, !tbaa !11
  %23 = load i32, ptr %7, align 4, !tbaa !5
  %24 = mul nsw i32 %23, 8
  %25 = add nsw i32 %24, 9
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds [248 x double], ptr getelementptr inbounds (%struct.ACADOvariables_, ptr @acadoVariables, i32 0, i32 1), i64 0, i64 %26
  %28 = load double, ptr %27, align 8, !tbaa !11
  %29 = load i32, ptr %7, align 4, !tbaa !5
  %30 = mul nsw i32 %29, 8
  %31 = add nsw i32 %30, 1
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [248 x double], ptr getelementptr inbounds (%struct.ACADOvariables_, ptr @acadoVariables, i32 0, i32 1), i64 0, i64 %32
  store double %28, ptr %33, align 8, !tbaa !11
  %34 = load i32, ptr %7, align 4, !tbaa !5
  %35 = mul nsw i32 %34, 8
  %36 = add nsw i32 %35, 10
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [248 x double], ptr getelementptr inbounds (%struct.ACADOvariables_, ptr @acadoVariables, i32 0, i32 1), i64 0, i64 %37
  %39 = load double, ptr %38, align 8, !tbaa !11
  %40 = load i32, ptr %7, align 4, !tbaa !5
  %41 = mul nsw i32 %40, 8
  %42 = add nsw i32 %41, 2
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds [248 x double], ptr getelementptr inbounds (%struct.ACADOvariables_, ptr @acadoVariables, i32 0, i32 1), i64 0, i64 %43
  store double %39, ptr %44, align 8, !tbaa !11
  %45 = load i32, ptr %7, align 4, !tbaa !5
  %46 = mul nsw i32 %45, 8
  %47 = add nsw i32 %46, 11
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [248 x double], ptr getelementptr inbounds (%struct.ACADOvariables_, ptr @acadoVariables, i32 0, i32 1), i64 0, i64 %48
  %50 = load double, ptr %49, align 8, !tbaa !11
  %51 = load i32, ptr %7, align 4, !tbaa !5
  %52 = mul nsw i32 %51, 8
  %53 = add nsw i32 %52, 3
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [248 x double], ptr getelementptr inbounds (%struct.ACADOvariables_, ptr @acadoVariables, i32 0, i32 1), i64 0, i64 %54
  store double %50, ptr %55, align 8, !tbaa !11
  %56 = load i32, ptr %7, align 4, !tbaa !5
  %57 = mul nsw i32 %56, 8
  %58 = add nsw i32 %57, 12
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [248 x double], ptr getelementptr inbounds (%struct.ACADOvariables_, ptr @acadoVariables, i32 0, i32 1), i64 0, i64 %59
  %61 = load double, ptr %60, align 8, !tbaa !11
  %62 = load i32, ptr %7, align 4, !tbaa !5
  %63 = mul nsw i32 %62, 8
  %64 = add nsw i32 %63, 4
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [248 x double], ptr getelementptr inbounds (%struct.ACADOvariables_, ptr @acadoVariables, i32 0, i32 1), i64 0, i64 %65
  store double %61, ptr %66, align 8, !tbaa !11
  %67 = load i32, ptr %7, align 4, !tbaa !5
  %68 = mul nsw i32 %67, 8
  %69 = add nsw i32 %68, 13
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [248 x double], ptr getelementptr inbounds (%struct.ACADOvariables_, ptr @acadoVariables, i32 0, i32 1), i64 0, i64 %70
  %72 = load double, ptr %71, align 8, !tbaa !11
  %73 = load i32, ptr %7, align 4, !tbaa !5
  %74 = mul nsw i32 %73, 8
  %75 = add nsw i32 %74, 5
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [248 x double], ptr getelementptr inbounds (%struct.ACADOvariables_, ptr @acadoVariables, i32 0, i32 1), i64 0, i64 %76
  store double %72, ptr %77, align 8, !tbaa !11
  %78 = load i32, ptr %7, align 4, !tbaa !5
  %79 = mul nsw i32 %78, 8
  %80 = add nsw i32 %79, 14
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [248 x double], ptr getelementptr inbounds (%struct.ACADOvariables_, ptr @acadoVariables, i32 0, i32 1), i64 0, i64 %81
  %83 = load double, ptr %82, align 8, !tbaa !11
  %84 = load i32, ptr %7, align 4, !tbaa !5
  %85 = mul nsw i32 %84, 8
  %86 = add nsw i32 %85, 6
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [248 x double], ptr getelementptr inbounds (%struct.ACADOvariables_, ptr @acadoVariables, i32 0, i32 1), i64 0, i64 %87
  store double %83, ptr %88, align 8, !tbaa !11
  %89 = load i32, ptr %7, align 4, !tbaa !5
  %90 = mul nsw i32 %89, 8
  %91 = add nsw i32 %90, 15
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [248 x double], ptr getelementptr inbounds (%struct.ACADOvariables_, ptr @acadoVariables, i32 0, i32 1), i64 0, i64 %92
  %94 = load double, ptr %93, align 8, !tbaa !11
  %95 = load i32, ptr %7, align 4, !tbaa !5
  %96 = mul nsw i32 %95, 8
  %97 = add nsw i32 %96, 7
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [248 x double], ptr getelementptr inbounds (%struct.ACADOvariables_, ptr @acadoVariables, i32 0, i32 1), i64 0, i64 %98
  store double %94, ptr %99, align 8, !tbaa !11
  br label %100

100:                                              ; preds = %12
  %101 = load i32, ptr %7, align 4, !tbaa !5
  %102 = add nsw i32 %101, 1
  store i32 %102, ptr %7, align 4, !tbaa !5
  br label %9, !llvm.loop !13

103:                                              ; preds = %9
  %104 = load i32, ptr %4, align 4, !tbaa !5
  %105 = icmp eq i32 %104, 1
  br i1 %105, label %106, label %134

106:                                              ; preds = %103
  %107 = load ptr, ptr %5, align 8, !tbaa !9
  %108 = icmp ne ptr %107, null
  br i1 %108, label %109, label %134

109:                                              ; preds = %106
  %110 = load ptr, ptr %5, align 8, !tbaa !9
  %111 = getelementptr inbounds double, ptr %110, i64 0
  %112 = load double, ptr %111, align 8, !tbaa !11
  store double %112, ptr getelementptr inbounds ([248 x double], ptr getelementptr inbounds (%struct.ACADOvariables_, ptr @acadoVariables, i32 0, i32 1), i64 0, i64 240), align 8, !tbaa !11
  %113 = load ptr, ptr %5, align 8, !tbaa !9
  %114 = getelementptr inbounds double, ptr %113, i64 1
  %115 = load double, ptr %114, align 8, !tbaa !11
  store double %115, ptr getelementptr inbounds ([248 x double], ptr getelementptr inbounds (%struct.ACADOvariables_, ptr @acadoVariables, i32 0, i32 1), i64 0, i64 241), align 8, !tbaa !11
  %116 = load ptr, ptr %5, align 8, !tbaa !9
  %117 = getelementptr inbounds double, ptr %116, i64 2
  %118 = load double, ptr %117, align 8, !tbaa !11
  store double %118, ptr getelementptr inbounds ([248 x double], ptr getelementptr inbounds (%struct.ACADOvariables_, ptr @acadoVariables, i32 0, i32 1), i64 0, i64 242), align 8, !tbaa !11
  %119 = load ptr, ptr %5, align 8, !tbaa !9
  %120 = getelementptr inbounds double, ptr %119, i64 3
  %121 = load double, ptr %120, align 8, !tbaa !11
  store double %121, ptr getelementptr inbounds ([248 x double], ptr getelementptr inbounds (%struct.ACADOvariables_, ptr @acadoVariables, i32 0, i32 1), i64 0, i64 243), align 8, !tbaa !11
  %122 = load ptr, ptr %5, align 8, !tbaa !9
  %123 = getelementptr inbounds double, ptr %122, i64 4
  %124 = load double, ptr %123, align 8, !tbaa !11
  store double %124, ptr getelementptr inbounds ([248 x double], ptr getelementptr inbounds (%struct.ACADOvariables_, ptr @acadoVariables, i32 0, i32 1), i64 0, i64 244), align 8, !tbaa !11
  %125 = load ptr, ptr %5, align 8, !tbaa !9
  %126 = getelementptr inbounds double, ptr %125, i64 5
  %127 = load double, ptr %126, align 8, !tbaa !11
  store double %127, ptr getelementptr inbounds ([248 x double], ptr getelementptr inbounds (%struct.ACADOvariables_, ptr @acadoVariables, i32 0, i32 1), i64 0, i64 245), align 8, !tbaa !11
  %128 = load ptr, ptr %5, align 8, !tbaa !9
  %129 = getelementptr inbounds double, ptr %128, i64 6
  %130 = load double, ptr %129, align 8, !tbaa !11
  store double %130, ptr getelementptr inbounds ([248 x double], ptr getelementptr inbounds (%struct.ACADOvariables_, ptr @acadoVariables, i32 0, i32 1), i64 0, i64 246), align 8, !tbaa !11
  %131 = load ptr, ptr %5, align 8, !tbaa !9
  %132 = getelementptr inbounds double, ptr %131, i64 7
  %133 = load double, ptr %132, align 8, !tbaa !11
  store double %133, ptr getelementptr inbounds ([248 x double], ptr getelementptr inbounds (%struct.ACADOvariables_, ptr @acadoVariables, i32 0, i32 1), i64 0, i64 247), align 8, !tbaa !11
  br label %198

134:                                              ; preds = %106, %103
  %135 = load i32, ptr %4, align 4, !tbaa !5
  %136 = icmp eq i32 %135, 2
  br i1 %136, label %137, label %197

137:                                              ; preds = %134
  %138 = load double, ptr getelementptr inbounds ([248 x double], ptr getelementptr inbounds (%struct.ACADOvariables_, ptr @acadoVariables, i32 0, i32 1), i64 0, i64 240), align 8, !tbaa !11
  store double %138, ptr getelementptr inbounds (%struct.ACADOworkspace_, ptr @acadoWorkspace, i32 0, i32 3), align 8, !tbaa !11
  %139 = load double, ptr getelementptr inbounds ([248 x double], ptr getelementptr inbounds (%struct.ACADOvariables_, ptr @acadoVariables, i32 0, i32 1), i64 0, i64 241), align 8, !tbaa !11
  store double %139, ptr getelementptr inbounds ([298 x double], ptr getelementptr inbounds (%struct.ACADOworkspace_, ptr @acadoWorkspace, i32 0, i32 3), i64 0, i64 1), align 8, !tbaa !11
  %140 = load double, ptr getelementptr inbounds ([248 x double], ptr getelementptr inbounds (%struct.ACADOvariables_, ptr @acadoVariables, i32 0, i32 1), i64 0, i64 242), align 8, !tbaa !11
  store double %140, ptr getelementptr inbounds ([298 x double], ptr getelementptr inbounds (%struct.ACADOworkspace_, ptr @acadoWorkspace, i32 0, i32 3), i64 0, i64 2), align 8, !tbaa !11
  %141 = load double, ptr getelementptr inbounds ([248 x double], ptr getelementptr inbounds (%struct.ACADOvariables_, ptr @acadoVariables, i32 0, i32 1), i64 0, i64 243), align 8, !tbaa !11
  store double %141, ptr getelementptr inbounds ([298 x double], ptr getelementptr inbounds (%struct.ACADOworkspace_, ptr @acadoWorkspace, i32 0, i32 3), i64 0, i64 3), align 8, !tbaa !11
  %142 = load double, ptr getelementptr inbounds ([248 x double], ptr getelementptr inbounds (%struct.ACADOvariables_, ptr @acadoVariables, i32 0, i32 1), i64 0, i64 244), align 8, !tbaa !11
  store double %142, ptr getelementptr inbounds ([298 x double], ptr getelementptr inbounds (%struct.ACADOworkspace_, ptr @acadoWorkspace, i32 0, i32 3), i64 0, i64 4), align 8, !tbaa !11
  %143 = load double, ptr getelementptr inbounds ([248 x double], ptr getelementptr inbounds (%struct.ACADOvariables_, ptr @acadoVariables, i32 0, i32 1), i64 0, i64 245), align 8, !tbaa !11
  store double %143, ptr getelementptr inbounds ([298 x double], ptr getelementptr inbounds (%struct.ACADOworkspace_, ptr @acadoWorkspace, i32 0, i32 3), i64 0, i64 5), align 8, !tbaa !11
  %144 = load double, ptr getelementptr inbounds ([248 x double], ptr getelementptr inbounds (%struct.ACADOvariables_, ptr @acadoVariables, i32 0, i32 1), i64 0, i64 246), align 8, !tbaa !11
  store double %144, ptr getelementptr inbounds ([298 x double], ptr getelementptr inbounds (%struct.ACADOworkspace_, ptr @acadoWorkspace, i32 0, i32 3), i64 0, i64 6), align 8, !tbaa !11
  %145 = load double, ptr getelementptr inbounds ([248 x double], ptr getelementptr inbounds (%struct.ACADOvariables_, ptr @acadoVariables, i32 0, i32 1), i64 0, i64 247), align 8, !tbaa !11
  store double %145, ptr getelementptr inbounds ([298 x double], ptr getelementptr inbounds (%struct.ACADOworkspace_, ptr @acadoWorkspace, i32 0, i32 3), i64 0, i64 7), align 8, !tbaa !11
  %146 = load ptr, ptr %6, align 8, !tbaa !9
  %147 = icmp ne ptr %146, null
  br i1 %147, label %148, label %164

148:                                              ; preds = %137
  %149 = load ptr, ptr %6, align 8, !tbaa !9
  %150 = getelementptr inbounds double, ptr %149, i64 0
  %151 = load double, ptr %150, align 8, !tbaa !11
  store double %151, ptr getelementptr inbounds ([298 x double], ptr getelementptr inbounds (%struct.ACADOworkspace_, ptr @acadoWorkspace, i32 0, i32 3), i64 0, i64 112), align 8, !tbaa !11
  %152 = load ptr, ptr %6, align 8, !tbaa !9
  %153 = getelementptr inbounds double, ptr %152, i64 1
  %154 = load double, ptr %153, align 8, !tbaa !11
  store double %154, ptr getelementptr inbounds ([298 x double], ptr getelementptr inbounds (%struct.ACADOworkspace_, ptr @acadoWorkspace, i32 0, i32 3), i64 0, i64 113), align 8, !tbaa !11
  %155 = load ptr, ptr %6, align 8, !tbaa !9
  %156 = getelementptr inbounds double, ptr %155, i64 2
  %157 = load double, ptr %156, align 8, !tbaa !11
  store double %157, ptr getelementptr inbounds ([298 x double], ptr getelementptr inbounds (%struct.ACADOworkspace_, ptr @acadoWorkspace, i32 0, i32 3), i64 0, i64 114), align 8, !tbaa !11
  %158 = load ptr, ptr %6, align 8, !tbaa !9
  %159 = getelementptr inbounds double, ptr %158, i64 3
  %160 = load double, ptr %159, align 8, !tbaa !11
  store double %160, ptr getelementptr inbounds ([298 x double], ptr getelementptr inbounds (%struct.ACADOworkspace_, ptr @acadoWorkspace, i32 0, i32 3), i64 0, i64 115), align 8, !tbaa !11
  %161 = load ptr, ptr %6, align 8, !tbaa !9
  %162 = getelementptr inbounds double, ptr %161, i64 4
  %163 = load double, ptr %162, align 8, !tbaa !11
  store double %163, ptr getelementptr inbounds ([298 x double], ptr getelementptr inbounds (%struct.ACADOworkspace_, ptr @acadoWorkspace, i32 0, i32 3), i64 0, i64 116), align 8, !tbaa !11
  br label %170

164:                                              ; preds = %137
  %165 = load double, ptr getelementptr inbounds ([150 x double], ptr getelementptr inbounds (%struct.ACADOvariables_, ptr @acadoVariables, i32 0, i32 2), i64 0, i64 145), align 8, !tbaa !11
  store double %165, ptr getelementptr inbounds ([298 x double], ptr getelementptr inbounds (%struct.ACADOworkspace_, ptr @acadoWorkspace, i32 0, i32 3), i64 0, i64 112), align 8, !tbaa !11
  %166 = load double, ptr getelementptr inbounds ([150 x double], ptr getelementptr inbounds (%struct.ACADOvariables_, ptr @acadoVariables, i32 0, i32 2), i64 0, i64 146), align 8, !tbaa !11
  store double %166, ptr getelementptr inbounds ([298 x double], ptr getelementptr inbounds (%struct.ACADOworkspace_, ptr @acadoWorkspace, i32 0, i32 3), i64 0, i64 113), align 8, !tbaa !11
  %167 = load double, ptr getelementptr inbounds ([150 x double], ptr getelementptr inbounds (%struct.ACADOvariables_, ptr @acadoVariables, i32 0, i32 2), i64 0, i64 147), align 8, !tbaa !11
  store double %167, ptr getelementptr inbounds ([298 x double], ptr getelementptr inbounds (%struct.ACADOworkspace_, ptr @acadoWorkspace, i32 0, i32 3), i64 0, i64 114), align 8, !tbaa !11
  %168 = load double, ptr getelementptr inbounds ([150 x double], ptr getelementptr inbounds (%struct.ACADOvariables_, ptr @acadoVariables, i32 0, i32 2), i64 0, i64 148), align 8, !tbaa !11
  store double %168, ptr getelementptr inbounds ([298 x double], ptr getelementptr inbounds (%struct.ACADOworkspace_, ptr @acadoWorkspace, i32 0, i32 3), i64 0, i64 115), align 8, !tbaa !11
  %169 = load double, ptr getelementptr inbounds ([150 x double], ptr getelementptr inbounds (%struct.ACADOvariables_, ptr @acadoVariables, i32 0, i32 2), i64 0, i64 149), align 8, !tbaa !11
  store double %169, ptr getelementptr inbounds ([298 x double], ptr getelementptr inbounds (%struct.ACADOworkspace_, ptr @acadoWorkspace, i32 0, i32 3), i64 0, i64 116), align 8, !tbaa !11
  br label %170

170:                                              ; preds = %164, %148
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %171

171:                                              ; preds = %184, %170
  %172 = load i32, ptr %8, align 4, !tbaa !5
  %173 = icmp slt i32 %172, 181
  br i1 %173, label %174, label %187

174:                                              ; preds = %171
  %175 = load i32, ptr %8, align 4, !tbaa !5
  %176 = add nsw i32 %175, 5430
  %177 = sext i32 %176 to i64
  %178 = getelementptr inbounds [5611 x double], ptr getelementptr inbounds (%struct.ACADOvariables_, ptr @acadoVariables, i32 0, i32 3), i64 0, i64 %177
  %179 = load double, ptr %178, align 8, !tbaa !11
  %180 = load i32, ptr %8, align 4, !tbaa !5
  %181 = add nsw i32 %180, 117
  %182 = sext i32 %181 to i64
  %183 = getelementptr inbounds [298 x double], ptr getelementptr inbounds (%struct.ACADOworkspace_, ptr @acadoWorkspace, i32 0, i32 3), i64 0, i64 %182
  store double %179, ptr %183, align 8, !tbaa !11
  br label %184

184:                                              ; preds = %174
  %185 = load i32, ptr %8, align 4, !tbaa !5
  %186 = add nsw i32 %185, 1
  store i32 %186, ptr %8, align 4, !tbaa !5
  br label %171, !llvm.loop !15

187:                                              ; preds = %171
  %188 = call i32 @acado_integrate(ptr noundef getelementptr inbounds (%struct.ACADOworkspace_, ptr @acadoWorkspace, i32 0, i32 3), i32 noundef 1)
  %189 = load double, ptr getelementptr inbounds (%struct.ACADOworkspace_, ptr @acadoWorkspace, i32 0, i32 3), align 8, !tbaa !11
  store double %189, ptr getelementptr inbounds ([248 x double], ptr getelementptr inbounds (%struct.ACADOvariables_, ptr @acadoVariables, i32 0, i32 1), i64 0, i64 240), align 8, !tbaa !11
  %190 = load double, ptr getelementptr inbounds ([298 x double], ptr getelementptr inbounds (%struct.ACADOworkspace_, ptr @acadoWorkspace, i32 0, i32 3), i64 0, i64 1), align 8, !tbaa !11
  store double %190, ptr getelementptr inbounds ([248 x double], ptr getelementptr inbounds (%struct.ACADOvariables_, ptr @acadoVariables, i32 0, i32 1), i64 0, i64 241), align 8, !tbaa !11
  %191 = load double, ptr getelementptr inbounds ([298 x double], ptr getelementptr inbounds (%struct.ACADOworkspace_, ptr @acadoWorkspace, i32 0, i32 3), i64 0, i64 2), align 8, !tbaa !11
  store double %191, ptr getelementptr inbounds ([248 x double], ptr getelementptr inbounds (%struct.ACADOvariables_, ptr @acadoVariables, i32 0, i32 1), i64 0, i64 242), align 8, !tbaa !11
  %192 = load double, ptr getelementptr inbounds ([298 x double], ptr getelementptr inbounds (%struct.ACADOworkspace_, ptr @acadoWorkspace, i32 0, i32 3), i64 0, i64 3), align 8, !tbaa !11
  store double %192, ptr getelementptr inbounds ([248 x double], ptr getelementptr inbounds (%struct.ACADOvariables_, ptr @acadoVariables, i32 0, i32 1), i64 0, i64 243), align 8, !tbaa !11
  %193 = load double, ptr getelementptr inbounds ([298 x double], ptr getelementptr inbounds (%struct.ACADOworkspace_, ptr @acadoWorkspace, i32 0, i32 3), i64 0, i64 4), align 8, !tbaa !11
  store double %193, ptr getelementptr inbounds ([248 x double], ptr getelementptr inbounds (%struct.ACADOvariables_, ptr @acadoVariables, i32 0, i32 1), i64 0, i64 244), align 8, !tbaa !11
  %194 = load double, ptr getelementptr inbounds ([298 x double], ptr getelementptr inbounds (%struct.ACADOworkspace_, ptr @acadoWorkspace, i32 0, i32 3), i64 0, i64 5), align 8, !tbaa !11
  store double %194, ptr getelementptr inbounds ([248 x double], ptr getelementptr inbounds (%struct.ACADOvariables_, ptr @acadoVariables, i32 0, i32 1), i64 0, i64 245), align 8, !tbaa !11
  %195 = load double, ptr getelementptr inbounds ([298 x double], ptr getelementptr inbounds (%struct.ACADOworkspace_, ptr @acadoWorkspace, i32 0, i32 3), i64 0, i64 6), align 8, !tbaa !11
  store double %195, ptr getelementptr inbounds ([248 x double], ptr getelementptr inbounds (%struct.ACADOvariables_, ptr @acadoVariables, i32 0, i32 1), i64 0, i64 246), align 8, !tbaa !11
  %196 = load double, ptr getelementptr inbounds ([298 x double], ptr getelementptr inbounds (%struct.ACADOworkspace_, ptr @acadoWorkspace, i32 0, i32 3), i64 0, i64 7), align 8, !tbaa !11
  store double %196, ptr getelementptr inbounds ([248 x double], ptr getelementptr inbounds (%struct.ACADOvariables_, ptr @acadoVariables, i32 0, i32 1), i64 0, i64 247), align 8, !tbaa !11
  br label %197

197:                                              ; preds = %187, %134
  br label %198

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

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 = { 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}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}


; 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.ACADOvariables_ = type { i32, [248 x double], [150 x double], [5611 x double], [240 x double], [3 x double], [8 x double], [150 x double], [150 x double], [1230 x double], [1230 x double] }
%struct.ACADOworkspace_ = type { double, [298 x double], [448 x double], [298 x double], [240 x double], [3 x double], [1920 x double], [1200 x double], [194 x double], [8 x double], [1183 x double], [194 x double], [574 x double], [1230 x double], [9840 x double], [6150 x double], [8 x double], [64 x double], [18600 x double], [18600 x double], [248 x double], [1200 x double], [9840 x double], [1230 x double], [22500 x double], [184500 x double], [150 x double], [150 x double], [150 x double], [1230 x double], [1230 x double], [150 x double], [1380 x double] }

@acadoVariables = external local_unnamed_addr global %struct.ACADOvariables_, align 8
@acadoWorkspace = external global %struct.ACADOworkspace_, align 8

declare i32 @acado_integrate(ptr noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local void @acado_shiftStates(i32 noundef %0, ptr noundef readonly %1, ptr noundef readonly %2) local_unnamed_addr #1 {
vector.ph:
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %3 = shl nuw nsw i64 %index, 3
  %4 = or disjoint i64 %3, 8
  %5 = getelementptr inbounds [248 x double], ptr getelementptr inbounds (i8, ptr @acadoVariables, i64 8), i64 0, i64 %4
  %wide.vec = load <16 x double>, ptr %5, align 8, !tbaa !5
  %strided.vec = shufflevector <16 x double> %wide.vec, <16 x double> poison, <2 x i32> <i32 0, i32 8>
  %strided.vec50 = shufflevector <16 x double> %wide.vec, <16 x double> poison, <2 x i32> <i32 1, i32 9>
  %strided.vec51 = shufflevector <16 x double> %wide.vec, <16 x double> poison, <2 x i32> <i32 2, i32 10>
  %strided.vec52 = shufflevector <16 x double> %wide.vec, <16 x double> poison, <2 x i32> <i32 3, i32 11>
  %strided.vec53 = shufflevector <16 x double> %wide.vec, <16 x double> poison, <2 x i32> <i32 4, i32 12>
  %strided.vec54 = shufflevector <16 x double> %wide.vec, <16 x double> poison, <2 x i32> <i32 5, i32 13>
  %strided.vec55 = shufflevector <16 x double> %wide.vec, <16 x double> poison, <2 x i32> <i32 6, i32 14>
  %strided.vec56 = shufflevector <16 x double> %wide.vec, <16 x double> poison, <2 x i32> <i32 7, i32 15>
  %6 = or disjoint i64 %3, 7
  %gep = getelementptr [248 x double], ptr getelementptr (i8, ptr getelementptr inbounds (i8, ptr @acadoVariables, i64 8), i64 -56), i64 0, i64 %6
  %7 = shufflevector <2 x double> %strided.vec, <2 x double> %strided.vec50, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
  %8 = shufflevector <2 x double> %strided.vec51, <2 x double> %strided.vec52, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
  %9 = shufflevector <2 x double> %strided.vec53, <2 x double> %strided.vec54, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
  %10 = shufflevector <2 x double> %strided.vec55, <2 x double> %strided.vec56, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
  %11 = shufflevector <4 x double> %7, <4 x double> %8, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
  %12 = shufflevector <4 x double> %9, <4 x double> %10, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
  %interleaved.vec = shufflevector <8 x double> %11, <8 x double> %12, <16 x i32> <i32 0, i32 2, i32 4, i32 6, i32 8, i32 10, i32 12, i32 14, i32 1, i32 3, i32 5, i32 7, i32 9, i32 11, i32 13, i32 15>
  store <16 x double> %interleaved.vec, ptr %gep, align 8, !tbaa !5
  %index.next = add nuw i64 %index, 2
  %13 = icmp eq i64 %index.next, 30
  br i1 %13, label %middle.block, label %vector.body, !llvm.loop !9

middle.block:                                     ; preds = %vector.body
  %14 = icmp eq i32 %0, 1
  %15 = icmp ne ptr %1, null
  %or.cond = and i1 %14, %15
  br i1 %or.cond, label %16, label %31

16:                                               ; preds = %middle.block
  %17 = load double, ptr %1, align 8, !tbaa !5
  store double %17, ptr getelementptr inbounds (i8, ptr @acadoVariables, i64 1928), align 8, !tbaa !5
  %18 = getelementptr inbounds i8, ptr %1, i64 8
  %19 = load double, ptr %18, align 8, !tbaa !5
  store double %19, ptr getelementptr inbounds (i8, ptr @acadoVariables, i64 1936), align 8, !tbaa !5
  %20 = getelementptr inbounds i8, ptr %1, i64 16
  %21 = load double, ptr %20, align 8, !tbaa !5
  store double %21, ptr getelementptr inbounds (i8, ptr @acadoVariables, i64 1944), align 8, !tbaa !5
  %22 = getelementptr inbounds i8, ptr %1, i64 24
  %23 = load double, ptr %22, align 8, !tbaa !5
  store double %23, ptr getelementptr inbounds (i8, ptr @acadoVariables, i64 1952), align 8, !tbaa !5
  %24 = getelementptr inbounds i8, ptr %1, i64 32
  %25 = load double, ptr %24, align 8, !tbaa !5
  store double %25, ptr getelementptr inbounds (i8, ptr @acadoVariables, i64 1960), align 8, !tbaa !5
  %26 = getelementptr inbounds i8, ptr %1, i64 40
  %27 = load double, ptr %26, align 8, !tbaa !5
  store double %27, ptr getelementptr inbounds (i8, ptr @acadoVariables, i64 1968), align 8, !tbaa !5
  %28 = getelementptr inbounds i8, ptr %1, i64 48
  %29 = load double, ptr %28, align 8, !tbaa !5
  store double %29, ptr getelementptr inbounds (i8, ptr @acadoVariables, i64 1976), align 8, !tbaa !5
  %30 = getelementptr inbounds i8, ptr %1, i64 56
  br label %.sink.split

31:                                               ; preds = %middle.block
  %32 = icmp eq i32 %0, 2
  br i1 %32, label %33, label %56

33:                                               ; preds = %31
  %34 = load <2 x double>, ptr getelementptr inbounds (i8, ptr @acadoVariables, i64 1928), align 8, !tbaa !5
  store <2 x double> %34, ptr getelementptr inbounds (i8, ptr @acadoWorkspace, i64 5976), align 8, !tbaa !5
  %35 = load <2 x double>, ptr getelementptr inbounds (i8, ptr @acadoVariables, i64 1944), align 8, !tbaa !5
  store <2 x double> %35, ptr getelementptr inbounds (i8, ptr @acadoWorkspace, i64 5992), align 8, !tbaa !5
  %36 = load <2 x double>, ptr getelementptr inbounds (i8, ptr @acadoVariables, i64 1960), align 8, !tbaa !5
  store <2 x double> %36, ptr getelementptr inbounds (i8, ptr @acadoWorkspace, i64 6008), align 8, !tbaa !5
  %37 = load <2 x double>, ptr getelementptr inbounds (i8, ptr @acadoVariables, i64 1976), align 8, !tbaa !5
  store <2 x double> %37, ptr getelementptr inbounds (i8, ptr @acadoWorkspace, i64 6024), align 8, !tbaa !5
  %.not = icmp eq ptr %2, null
  br i1 %.not, label %46, label %38

38:                                               ; preds = %33
  %39 = load double, ptr %2, align 8, !tbaa !5
  store double %39, ptr getelementptr inbounds (i8, ptr @acadoWorkspace, i64 6872), align 8, !tbaa !5
  %40 = getelementptr inbounds i8, ptr %2, i64 8
  %41 = load double, ptr %40, align 8, !tbaa !5
  store double %41, ptr getelementptr inbounds (i8, ptr @acadoWorkspace, i64 6880), align 8, !tbaa !5
  %42 = getelementptr inbounds i8, ptr %2, i64 16
  %43 = load double, ptr %42, align 8, !tbaa !5
  store double %43, ptr getelementptr inbounds (i8, ptr @acadoWorkspace, i64 6888), align 8, !tbaa !5
  %44 = getelementptr inbounds i8, ptr %2, i64 24
  %45 = getelementptr inbounds i8, ptr %2, i64 32
  br label %49

46:                                               ; preds = %33
  %47 = load <2 x double>, ptr getelementptr inbounds (i8, ptr @acadoVariables, i64 3152), align 8, !tbaa !5
  store <2 x double> %47, ptr getelementptr inbounds (i8, ptr @acadoWorkspace, i64 6872), align 8, !tbaa !5
  %48 = load double, ptr getelementptr inbounds (i8, ptr @acadoVariables, i64 3168), align 8, !tbaa !5
  store double %48, ptr getelementptr inbounds (i8, ptr @acadoWorkspace, i64 6888), align 8, !tbaa !5
  br label %49

49:                                               ; preds = %46, %38
  %.sink.in = phi ptr [ getelementptr inbounds (i8, ptr @acadoVariables, i64 3176), %46 ], [ %44, %38 ]
  %storemerge.in = phi ptr [ getelementptr inbounds (i8, ptr @acadoVariables, i64 3184), %46 ], [ %45, %38 ]
  %.sink = load double, ptr %.sink.in, align 8, !tbaa !5
  store double %.sink, ptr getelementptr inbounds (i8, ptr @acadoWorkspace, i64 6896), align 8
  %storemerge = load double, ptr %storemerge.in, align 8, !tbaa !5
  store double %storemerge, ptr getelementptr inbounds (i8, ptr @acadoWorkspace, i64 6904), align 8, !tbaa !5
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(1448) getelementptr inbounds (i8, ptr @acadoWorkspace, i64 6912), ptr noundef nonnull align 8 dereferenceable(1448) getelementptr inbounds (i8, ptr @acadoVariables, i64 46632), i64 1448, i1 false), !tbaa !5
  %50 = tail call i32 @acado_integrate(ptr noundef nonnull getelementptr inbounds (i8, ptr @acadoWorkspace, i64 5976), i32 noundef 1) #3
  %51 = load <2 x double>, ptr getelementptr inbounds (i8, ptr @acadoWorkspace, i64 5976), align 8, !tbaa !5
  store <2 x double> %51, ptr getelementptr inbounds (i8, ptr @acadoVariables, i64 1928), align 8, !tbaa !5
  %52 = load <2 x double>, ptr getelementptr inbounds (i8, ptr @acadoWorkspace, i64 5992), align 8, !tbaa !5
  store <2 x double> %52, ptr getelementptr inbounds (i8, ptr @acadoVariables, i64 1944), align 8, !tbaa !5
  %53 = load <2 x double>, ptr getelementptr inbounds (i8, ptr @acadoWorkspace, i64 6008), align 8, !tbaa !5
  store <2 x double> %53, ptr getelementptr inbounds (i8, ptr @acadoVariables, i64 1960), align 8, !tbaa !5
  %54 = load double, ptr getelementptr inbounds (i8, ptr @acadoWorkspace, i64 6024), align 8, !tbaa !5
  store double %54, ptr getelementptr inbounds (i8, ptr @acadoVariables, i64 1976), align 8, !tbaa !5
  br label %.sink.split

.sink.split:                                      ; preds = %16, %49
  %.sink49 = phi ptr [ getelementptr inbounds (i8, ptr @acadoWorkspace, i64 6032), %49 ], [ %30, %16 ]
  %55 = load double, ptr %.sink49, align 8, !tbaa !5
  store double %55, ptr getelementptr inbounds (i8, ptr @acadoVariables, i64 1984), align 8, !tbaa !5
  br label %56

56:                                               ; preds = %.sink.split, %31
  ret void
}

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

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 = { 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,LICMPass,LoopIdiomRecognizePass,LoopLoadEliminationPass,LoopRotatePass,LoopVectorizePass,MergedLoadStoreMotionPass,PostOrderFunctionAttrsPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass