; LLVM IR from darnstrom/daqp :: src (api)

; 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.DAQPProblem = type { i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32 }
%struct.DAQPWorkspace = type { ptr, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, double, ptr, ptr, ptr, ptr, i32, ptr, i32, i32, i32, double, ptr, ptr, i32, ptr }

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

; Function Attrs: nounwind uwtable
define dso_local i32 @setup_daqp(ptr noundef %0, ptr noundef %1, ptr noundef %2) #1 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #2
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #2
  store i32 1, ptr %9, align 4, !tbaa !9
  %16 = load ptr, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #2
  store i32 0, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #2
  store i32 0, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #2
  %17 = load ptr, ptr %5, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.DAQPProblem, ptr %17, i32 0, i32 8
  %19 = load ptr, ptr %18, align 8, !tbaa !11
  %20 = icmp ne ptr %19, null
  br i1 %20, label %21, label %59

21:                                               ; preds = %3
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %22

22:                                               ; preds = %55, %21
  %23 = load i32, ptr %12, align 4, !tbaa !9
  %24 = load ptr, ptr %5, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.DAQPProblem, ptr %24, i32 0, i32 1
  %26 = load i32, ptr %25, align 4, !tbaa !13
  %27 = icmp slt i32 %23, %26
  br i1 %27, label %28, label %58

28:                                               ; preds = %22
  %29 = load ptr, ptr %5, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.DAQPProblem, ptr %29, i32 0, i32 8
  %31 = load ptr, ptr %30, align 8, !tbaa !11
  %32 = load i32, ptr %12, align 4, !tbaa !9
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds i32, ptr %31, i64 %33
  %35 = load i32, ptr %34, align 4, !tbaa !9
  %36 = and i32 %35, 8
  %37 = icmp ne i32 %36, 0
  br i1 %37, label %38, label %41

38:                                               ; preds = %28
  %39 = load i32, ptr %10, align 4, !tbaa !9
  %40 = add nsw i32 %39, 1
  store i32 %40, ptr %10, align 4, !tbaa !9
  br label %41

41:                                               ; preds = %38, %28
  %42 = load ptr, ptr %5, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.DAQPProblem, ptr %42, i32 0, i32 8
  %44 = load ptr, ptr %43, align 8, !tbaa !11
  %45 = load i32, ptr %12, align 4, !tbaa !9
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds i32, ptr %44, i64 %46
  %48 = load i32, ptr %47, align 4, !tbaa !9
  %49 = and i32 %48, 16
  %50 = icmp ne i32 %49, 0
  br i1 %50, label %51, label %54

51:                                               ; preds = %41
  %52 = load i32, ptr %11, align 4, !tbaa !9
  %53 = add nsw i32 %52, 1
  store i32 %53, ptr %11, align 4, !tbaa !9
  br label %54

54:                                               ; preds = %51, %41
  br label %55

55:                                               ; preds = %54
  %56 = load i32, ptr %12, align 4, !tbaa !9
  %57 = add nsw i32 %56, 1
  store i32 %57, ptr %12, align 4, !tbaa !9
  br label %22, !llvm.loop !14

58:                                               ; preds = %22
  br label %59

59:                                               ; preds = %58, %3
  %60 = load ptr, ptr %5, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.DAQPProblem, ptr %60, i32 0, i32 10
  %62 = load i32, ptr %61, align 8, !tbaa !16
  %63 = icmp sgt i32 %62, 1
  br i1 %63, label %64, label %109

64:                                               ; preds = %59
  store i32 0, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #2
  store i32 0, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #2
  store i32 0, ptr %14, align 4, !tbaa !9
  br label %65

65:                                               ; preds = %105, %64
  %66 = load i32, ptr %14, align 4, !tbaa !9
  %67 = load ptr, ptr %5, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.DAQPProblem, ptr %67, i32 0, i32 10
  %69 = load i32, ptr %68, align 8, !tbaa !16
  %70 = icmp slt i32 %66, %69
  br i1 %70, label %72, label %71

71:                                               ; preds = %65
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #2
  br label %108

72:                                               ; preds = %65
  %73 = load i32, ptr %10, align 4, !tbaa !9
  %74 = load ptr, ptr %5, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.DAQPProblem, ptr %74, i32 0, i32 9
  %76 = load ptr, ptr %75, align 8, !tbaa !17
  %77 = load i32, ptr %14, align 4, !tbaa !9
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds i32, ptr %76, i64 %78
  %80 = load i32, ptr %79, align 4, !tbaa !9
  %81 = load i32, ptr %13, align 4, !tbaa !9
  %82 = sub nsw i32 %80, %81
  %83 = icmp sgt i32 %73, %82
  br i1 %83, label %84, label %86

84:                                               ; preds = %72
  %85 = load i32, ptr %10, align 4, !tbaa !9
  br label %96

86:                                               ; preds = %72
  %87 = load ptr, ptr %5, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.DAQPProblem, ptr %87, i32 0, i32 9
  %89 = load ptr, ptr %88, align 8, !tbaa !17
  %90 = load i32, ptr %14, align 4, !tbaa !9
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds i32, ptr %89, i64 %91
  %93 = load i32, ptr %92, align 4, !tbaa !9
  %94 = load i32, ptr %13, align 4, !tbaa !9
  %95 = sub nsw i32 %93, %94
  br label %96

96:                                               ; preds = %86, %84
  %97 = phi i32 [ %85, %84 ], [ %95, %86 ]
  store i32 %97, ptr %10, align 4, !tbaa !9
  %98 = load ptr, ptr %5, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.DAQPProblem, ptr %98, i32 0, i32 9
  %100 = load ptr, ptr %99, align 8, !tbaa !17
  %101 = load i32, ptr %14, align 4, !tbaa !9
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds i32, ptr %100, i64 %102
  %104 = load i32, ptr %103, align 4, !tbaa !9
  store i32 %104, ptr %13, align 4, !tbaa !9
  br label %105

105:                                              ; preds = %96
  %106 = load i32, ptr %14, align 4, !tbaa !9
  %107 = add nsw i32 %106, 1
  store i32 %107, ptr %14, align 4, !tbaa !9
  br label %65, !llvm.loop !18

108:                                              ; preds = %71
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #2
  br label %109

109:                                              ; preds = %108, %59
  %110 = load ptr, ptr %6, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.DAQPWorkspace, ptr %110, i32 0, i32 28
  %112 = load ptr, ptr %111, align 8, !tbaa !19
  %113 = icmp eq ptr %112, null
  br i1 %113, label %114, label %116

114:                                              ; preds = %109
  %115 = load ptr, ptr %6, align 8, !tbaa !5
  call void @allocate_daqp_settings(ptr noundef %115)
  br label %117

116:                                              ; preds = %109
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %117

117:                                              ; preds = %116, %114
  %118 = load ptr, ptr %6, align 8, !tbaa !5
  %119 = load ptr, ptr %5, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.DAQPProblem, ptr %119, i32 0, i32 0
  %121 = load i32, ptr %120, align 8, !tbaa !22
  %122 = load i32, ptr %10, align 4, !tbaa !9
  call void @allocate_daqp_workspace(ptr noundef %118, i32 noundef %121, i32 noundef %122)
  %123 = load ptr, ptr %6, align 8, !tbaa !5
  %124 = load ptr, ptr %5, align 8, !tbaa !5
  %125 = call i32 @setup_daqp_ldp(ptr noundef %123, ptr noundef %124)
  store i32 %125, ptr %8, align 4, !tbaa !9
  %126 = load i32, ptr %8, align 4, !tbaa !9
  %127 = icmp slt i32 %126, 0
  br i1 %127, label %128, label %137

128:                                              ; preds = %117
  %129 = load i32, ptr %9, align 4, !tbaa !9
  %130 = icmp eq i32 %129, 0
  br i1 %130, label %131, label %134

131:                                              ; preds = %128
  %132 = load ptr, ptr %6, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.DAQPWorkspace, ptr %132, i32 0, i32 28
  store ptr null, ptr %133, align 8, !tbaa !19
  br label %134

134:                                              ; preds = %131, %128
  %135 = load ptr, ptr %6, align 8, !tbaa !5
  call void @free_daqp_workspace(ptr noundef %135)
  %136 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %136, ptr %4, align 4
  store i32 1, ptr %15, align 4
  br label %154

137:                                              ; preds = %117
  %138 = load ptr, ptr %6, align 8, !tbaa !5
  %139 = load i32, ptr %11, align 4, !tbaa !9
  %140 = load i32, ptr %10, align 4, !tbaa !9
  %141 = call i32 @setup_daqp_bnb(ptr noundef %138, i32 noundef %139, i32 noundef %140)
  store i32 %141, ptr %8, align 4, !tbaa !9
  %142 = load i32, ptr %8, align 4, !tbaa !9
  %143 = icmp slt i32 %142, 0
  br i1 %143, label %144, label %153

144:                                              ; preds = %137
  %145 = load i32, ptr %9, align 4, !tbaa !9
  %146 = icmp eq i32 %145, 0
  br i1 %146, label %147, label %150

147:                                              ; preds = %144
  %148 = load ptr, ptr %6, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct.DAQPWorkspace, ptr %148, i32 0, i32 28
  store ptr null, ptr %149, align 8, !tbaa !19
  br label %150

150:                                              ; preds = %147, %144
  %151 = load ptr, ptr %6, align 8, !tbaa !5
  call void @free_daqp_workspace(ptr noundef %151)
  %152 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %152, ptr %4, align 4
  store i32 1, ptr %15, align 4
  br label %154

153:                                              ; preds = %137
  store i32 1, ptr %4, align 4
  store i32 1, ptr %15, align 4
  br label %154

154:                                              ; preds = %153, %150, %134
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #2
  %155 = load i32, ptr %4, align 4
  ret i32 %155
}

; Function Attrs: nounwind uwtable
declare dso_local void @free_daqp_workspace(ptr 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
declare dso_local void @allocate_daqp_settings(ptr noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local void @allocate_daqp_workspace(ptr noundef, i32 noundef, i32 noundef) #1

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

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

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 = { 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 56}
!12 = !{!"", !10, i64 0, !10, i64 4, !10, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !10, i64 72}
!13 = !{!12, !10, i64 4}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = !{!12, !10, i64 72}
!17 = !{!12, !6, i64 64}
!18 = distinct !{!18, !15}
!19 = !{!20, !6, i64 208}
!20 = !{!"", !6, i64 0, !10, i64 8, !10, i64 12, !10, 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, !21, i64 128, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !10, i64 168, !6, i64 176, !10, i64 184, !10, i64 188, !10, i64 192, !21, i64 200, !6, i64 208, !6, i64 216, !10, i64 224, !6, i64 232}
!21 = !{!"double", !7, i64 0}
!22 = !{!12, !10, 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"

; Function Attrs: nounwind uwtable
define dso_local range(i32 -2147483648, 2) i32 @setup_daqp(ptr noundef %0, ptr noundef %1, ptr nocapture noundef readnone %2) local_unnamed_addr #0 {
  %4 = getelementptr inbounds i8, ptr %0, i64 56
  %5 = load ptr, ptr %4, align 8, !tbaa !5
  %.not = icmp eq ptr %5, null
  br i1 %.not, label %.loopexit60, label %.preheader59

.preheader59:                                     ; preds = %3
  %6 = getelementptr inbounds i8, ptr %0, i64 4
  %7 = load i32, ptr %6, align 4, !tbaa !11
  %8 = icmp sgt i32 %7, 0
  br i1 %8, label %.lr.ph.preheader, label %.loopexit60

.lr.ph.preheader:                                 ; preds = %.preheader59
  %wide.trip.count = zext nneg i32 %7 to i64
  %min.iters.check = icmp ult i32 %7, 8
  br i1 %min.iters.check, label %.lr.ph.preheader97, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph.preheader
  %n.vec = and i64 %wide.trip.count, 2147483640
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %21, %vector.body ]
  %vec.phi74 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %22, %vector.body ]
  %vec.phi75 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %15, %vector.body ]
  %vec.phi76 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %16, %vector.body ]
  %9 = getelementptr inbounds i32, ptr %5, i64 %index
  %10 = getelementptr inbounds i8, ptr %9, i64 16
  %wide.load = load <4 x i32>, ptr %9, align 4, !tbaa !12
  %wide.load77 = load <4 x i32>, ptr %10, align 4, !tbaa !12
  %11 = lshr <4 x i32> %wide.load, <i32 3, i32 3, i32 3, i32 3>
  %12 = lshr <4 x i32> %wide.load77, <i32 3, i32 3, i32 3, i32 3>
  %13 = and <4 x i32> %11, <i32 1, i32 1, i32 1, i32 1>
  %14 = and <4 x i32> %12, <i32 1, i32 1, i32 1, i32 1>
  %15 = add <4 x i32> %13, %vec.phi75
  %16 = add <4 x i32> %14, %vec.phi76
  %17 = lshr <4 x i32> %wide.load, <i32 4, i32 4, i32 4, i32 4>
  %18 = lshr <4 x i32> %wide.load77, <i32 4, i32 4, i32 4, i32 4>
  %19 = and <4 x i32> %17, <i32 1, i32 1, i32 1, i32 1>
  %20 = and <4 x i32> %18, <i32 1, i32 1, i32 1, i32 1>
  %21 = add <4 x i32> %19, %vec.phi
  %22 = add <4 x i32> %20, %vec.phi74
  %index.next = add nuw i64 %index, 8
  %23 = icmp eq i64 %index.next, %n.vec
  br i1 %23, label %middle.block, label %vector.body, !llvm.loop !13

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <4 x i32> %22, %21
  %24 = tail call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
  %bin.rdx78 = add <4 x i32> %16, %15
  %25 = tail call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx78)
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  br i1 %cmp.n, label %.loopexit60, label %.lr.ph.preheader97

.lr.ph.preheader97:                               ; preds = %middle.block, %.lr.ph.preheader
  %indvars.iv.ph = phi i64 [ 0, %.lr.ph.preheader ], [ %n.vec, %middle.block ]
  %.04762.ph = phi i32 [ 0, %.lr.ph.preheader ], [ %24, %middle.block ]
  %.04861.ph = phi i32 [ 0, %.lr.ph.preheader ], [ %25, %middle.block ]
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader97, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ %indvars.iv.ph, %.lr.ph.preheader97 ]
  %.04762 = phi i32 [ %.1, %.lr.ph ], [ %.04762.ph, %.lr.ph.preheader97 ]
  %.04861 = phi i32 [ %spec.select, %.lr.ph ], [ %.04861.ph, %.lr.ph.preheader97 ]
  %26 = getelementptr inbounds i32, ptr %5, i64 %indvars.iv
  %27 = load i32, ptr %26, align 4, !tbaa !12
  %28 = lshr i32 %27, 3
  %29 = and i32 %28, 1
  %spec.select = add i32 %29, %.04861
  %30 = lshr i32 %27, 4
  %31 = and i32 %30, 1
  %.1 = add i32 %31, %.04762
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %.loopexit60, label %.lr.ph, !llvm.loop !17

.loopexit60:                                      ; preds = %.lr.ph, %middle.block, %.preheader59, %3
  %.250 = phi i32 [ 0, %3 ], [ 0, %.preheader59 ], [ %25, %middle.block ], [ %spec.select, %.lr.ph ]
  %.2 = phi i32 [ 0, %3 ], [ 0, %.preheader59 ], [ %24, %middle.block ], [ %.1, %.lr.ph ]
  %32 = getelementptr inbounds i8, ptr %0, i64 72
  %33 = load i32, ptr %32, align 8, !tbaa !18
  %34 = icmp sgt i32 %33, 1
  br i1 %34, label %.preheader, label %.loopexit

.preheader:                                       ; preds = %.loopexit60
  %35 = getelementptr inbounds i8, ptr %0, i64 64
  %36 = load ptr, ptr %35, align 8, !tbaa !19
  %wide.trip.count72 = zext nneg i32 %33 to i64
  %min.iters.check82 = icmp ult i32 %33, 8
  br i1 %min.iters.check82, label %scalar.ph81.preheader, label %vector.ph83

vector.ph83:                                      ; preds = %.preheader
  %n.vec85 = and i64 %wide.trip.count72, 2147483640
  br label %vector.body87

vector.body87:                                    ; preds = %vector.body87, %vector.ph83
  %index88 = phi i64 [ 0, %vector.ph83 ], [ %index.next93, %vector.body87 ]
  %vector.recur = phi <4 x i32> [ <i32 poison, i32 poison, i32 poison, i32 0>, %vector.ph83 ], [ %wide.load92, %vector.body87 ]
  %vec.phi89 = phi <4 x i32> [ zeroinitializer, %vector.ph83 ], [ %43, %vector.body87 ]
  %vec.phi90 = phi <4 x i32> [ zeroinitializer, %vector.ph83 ], [ %44, %vector.body87 ]
  %37 = getelementptr inbounds i32, ptr %36, i64 %index88
  %38 = getelementptr inbounds i8, ptr %37, i64 16
  %wide.load91 = load <4 x i32>, ptr %37, align 4, !tbaa !12
  %wide.load92 = load <4 x i32>, ptr %38, align 4, !tbaa !12
  %39 = shufflevector <4 x i32> %vector.recur, <4 x i32> %wide.load91, <4 x i32> <i32 3, i32 4, i32 5, i32 6>
  %40 = shufflevector <4 x i32> %wide.load91, <4 x i32> %wide.load92, <4 x i32> <i32 3, i32 4, i32 5, i32 6>
  %41 = sub nsw <4 x i32> %wide.load91, %39
  %42 = sub nsw <4 x i32> %wide.load92, %40
  %43 = tail call <4 x i32> @llvm.smax.v4i32(<4 x i32> %vec.phi89, <4 x i32> %41)
  %44 = tail call <4 x i32> @llvm.smax.v4i32(<4 x i32> %vec.phi90, <4 x i32> %42)
  %index.next93 = add nuw i64 %index88, 8
  %45 = icmp eq i64 %index.next93, %n.vec85
  br i1 %45, label %middle.block80, label %vector.body87, !llvm.loop !20

middle.block80:                                   ; preds = %vector.body87
  %rdx.minmax = tail call <4 x i32> @llvm.smax.v4i32(<4 x i32> %43, <4 x i32> %44)
  %46 = tail call i32 @llvm.vector.reduce.smax.v4i32(<4 x i32> %rdx.minmax)
  %vector.recur.extract = extractelement <4 x i32> %wide.load92, i64 3
  %cmp.n94 = icmp eq i64 %n.vec85, %wide.trip.count72
  br i1 %cmp.n94, label %.loopexit, label %scalar.ph81.preheader

scalar.ph81.preheader:                            ; preds = %middle.block80, %.preheader
  %indvars.iv69.ph = phi i64 [ 0, %.preheader ], [ %n.vec85, %middle.block80 ]
  %.04566.ph = phi i32 [ 0, %.preheader ], [ %vector.recur.extract, %middle.block80 ]
  %.365.ph = phi i32 [ 0, %.preheader ], [ %46, %middle.block80 ]
  br label %scalar.ph81

scalar.ph81:                                      ; preds = %scalar.ph81.preheader, %scalar.ph81
  %indvars.iv69 = phi i64 [ %indvars.iv.next70, %scalar.ph81 ], [ %indvars.iv69.ph, %scalar.ph81.preheader ]
  %.04566 = phi i32 [ %48, %scalar.ph81 ], [ %.04566.ph, %scalar.ph81.preheader ]
  %.365 = phi i32 [ %.3., %scalar.ph81 ], [ %.365.ph, %scalar.ph81.preheader ]
  %47 = getelementptr inbounds i32, ptr %36, i64 %indvars.iv69
  %48 = load i32, ptr %47, align 4, !tbaa !12
  %49 = sub nsw i32 %48, %.04566
  %.3. = tail call i32 @llvm.smax.i32(i32 %.365, i32 %49)
  %indvars.iv.next70 = add nuw nsw i64 %indvars.iv69, 1
  %exitcond73.not = icmp eq i64 %indvars.iv.next70, %wide.trip.count72
  br i1 %exitcond73.not, label %.loopexit, label %scalar.ph81, !llvm.loop !21

.loopexit:                                        ; preds = %scalar.ph81, %middle.block80, %.loopexit60
  %.4 = phi i32 [ %.250, %.loopexit60 ], [ %46, %middle.block80 ], [ %.3., %scalar.ph81 ]
  %50 = getelementptr inbounds i8, ptr %1, i64 208
  %51 = load ptr, ptr %50, align 8, !tbaa !22
  %.not56.not = icmp eq ptr %51, null
  br i1 %.not56.not, label %52, label %53

52:                                               ; preds = %.loopexit
  tail call void @allocate_daqp_settings(ptr noundef nonnull %1)
  br label %53

53:                                               ; preds = %.loopexit, %52
  %54 = load i32, ptr %0, align 8, !tbaa !25
  tail call void @allocate_daqp_workspace(ptr noundef nonnull %1, i32 noundef %54, i32 noundef %.4)
  %55 = tail call i32 @setup_daqp_ldp(ptr noundef nonnull %1, ptr noundef nonnull %0)
  %56 = icmp slt i32 %55, 0
  br i1 %56, label %57, label %58

57:                                               ; preds = %53
  br i1 %.not56.not, label %.sink.split, label %.sink.split.sink.split

58:                                               ; preds = %53
  %59 = tail call i32 @setup_daqp_bnb(ptr noundef nonnull %1, i32 noundef %.2, i32 noundef %.4)
  %60 = icmp slt i32 %59, 0
  br i1 %60, label %61, label %62

61:                                               ; preds = %58
  br i1 %.not56.not, label %.sink.split, label %.sink.split.sink.split

.sink.split.sink.split:                           ; preds = %61, %57
  %.052.ph.ph = phi i32 [ %55, %57 ], [ %59, %61 ]
  store ptr null, ptr %50, align 8, !tbaa !22
  br label %.sink.split

.sink.split:                                      ; preds = %.sink.split.sink.split, %61, %57
  %.052.ph = phi i32 [ %55, %57 ], [ %59, %61 ], [ %.052.ph.ph, %.sink.split.sink.split ]
  tail call void @free_daqp_workspace(ptr noundef nonnull %1)
  br label %62

62:                                               ; preds = %.sink.split, %58
  %.052 = phi i32 [ 1, %58 ], [ %.052.ph, %.sink.split ]
  ret i32 %.052
}

; Function Attrs: nounwind uwtable
declare dso_local void @free_daqp_workspace(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @allocate_daqp_settings(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @allocate_daqp_workspace(ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #1

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #1

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <4 x i32> @llvm.smax.v4i32(<4 x i32>, <4 x i32>) #1

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.smax.v4i32(<4 x i32>) #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 speculatable willreturn memory(none) }

!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, !10, i64 56}
!6 = !{!"", !7, i64 0, !7, i64 4, !7, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !7, i64 72}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!6, !7, i64 4}
!12 = !{!7, !7, i64 0}
!13 = distinct !{!13, !14, !15, !16}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!"llvm.loop.isvectorized", i32 1}
!16 = !{!"llvm.loop.unroll.runtime.disable"}
!17 = distinct !{!17, !14, !16, !15}
!18 = !{!6, !7, i64 72}
!19 = !{!6, !10, i64 64}
!20 = distinct !{!20, !14, !15, !16}
!21 = distinct !{!21, !14, !16, !15}
!22 = !{!23, !10, i64 208}
!23 = !{!"", !10, i64 0, !7, i64 8, !7, i64 12, !7, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, 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, !10, i64 120, !24, i64 128, !10, i64 136, !10, i64 144, !10, i64 152, !10, i64 160, !7, i64 168, !10, i64 176, !7, i64 184, !7, i64 188, !7, i64 192, !24, i64 200, !10, i64 208, !10, i64 216, !7, i64 224, !10, i64 232}
!24 = !{!"double", !8, i64 0}
!25 = !{!6, !7, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass