; LLVM IR from opensim-org/opensim-moco :: tropter/external/snopt-interface/src (snoptProblem)

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

%class.snoptProblem = type { [30 x i8], i32, i32, i32, i32, i32, ptr, ptr, i32, i32, ptr, ptr }
%class.snoptProblemABC = type { %class.snoptProblem, ptr, ptr, ptr, ptr }

@.str.2 = external hidden unnamed_addr constant [112 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [16 x i8], align 1
@__PRETTY_FUNCTION__._ZN13snoptProblemC5solveEiiiiiiiiidPFvPiS0_S0_S0_S0_S0_PdS1_S1_S1_S1_S0_PcS0_S0_S0_S1_S0_ES1_S0_S0_S1_S1_S0_S1_S1_S1_RiS5_RdS6_ = external hidden unnamed_addr constant [201 x i8], align 1

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #0

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN13snoptProblemC12setWorkspaceEiiiiiii(ptr noundef nonnull align 8 dereferenceable(128), i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN13snoptProblemC5solveEiiiiiiiiidPFvPiS0_S0_S0_S0_S0_PdS1_S1_S1_S1_S0_PcS0_S0_S0_S1_S0_ES1_S0_S0_S1_S1_S0_S1_S1_S1_RiS5_RdS6_(ptr noundef nonnull align 8 dereferenceable(128) %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4, i32 noundef %5, i32 noundef %6, i32 noundef %7, i32 noundef %8, i32 noundef %9, double noundef %10, ptr noundef %11, ptr noundef %12, ptr noundef %13, ptr noundef %14, ptr noundef %15, ptr noundef %16, ptr noundef %17, ptr noundef %18, ptr noundef %19, ptr noundef %20, ptr noundef nonnull align 4 dereferenceable(4) %21, ptr noundef nonnull align 4 dereferenceable(4) %22, ptr noundef nonnull align 8 dereferenceable(8) %23, ptr noundef nonnull align 8 dereferenceable(8) %24) #2 align 2 {
  %26 = alloca ptr, align 8
  %27 = alloca i32, align 4
  %28 = alloca i32, align 4
  %29 = alloca i32, align 4
  %30 = alloca i32, align 4
  %31 = alloca i32, align 4
  %32 = alloca i32, align 4
  %33 = alloca i32, align 4
  %34 = alloca i32, align 4
  %35 = alloca i32, align 4
  %36 = alloca double, align 8
  %37 = alloca ptr, align 8
  %38 = alloca ptr, align 8
  %39 = alloca ptr, align 8
  %40 = alloca ptr, align 8
  %41 = alloca ptr, align 8
  %42 = alloca ptr, align 8
  %43 = alloca ptr, align 8
  %44 = alloca ptr, align 8
  %45 = alloca ptr, align 8
  %46 = alloca ptr, align 8
  %47 = alloca ptr, align 8
  %48 = alloca ptr, align 8
  %49 = alloca ptr, align 8
  %50 = alloca ptr, align 8
  %51 = alloca i32, align 4
  %52 = alloca i32, align 4
  %53 = alloca i32, align 4
  %54 = alloca i32, align 4
  %55 = alloca i32, align 4
  %56 = alloca i32, align 4
  %57 = alloca i32, align 4
  %58 = alloca i32, align 4
  store ptr %0, ptr %26, align 8, !tbaa !5
  store i32 %1, ptr %27, align 4, !tbaa !9
  store i32 %2, ptr %28, align 4, !tbaa !9
  store i32 %3, ptr %29, align 4, !tbaa !9
  store i32 %4, ptr %30, align 4, !tbaa !9
  store i32 %5, ptr %31, align 4, !tbaa !9
  store i32 %6, ptr %32, align 4, !tbaa !9
  store i32 %7, ptr %33, align 4, !tbaa !9
  store i32 %8, ptr %34, align 4, !tbaa !9
  store i32 %9, ptr %35, align 4, !tbaa !9
  store double %10, ptr %36, align 8, !tbaa !11
  store ptr %11, ptr %37, align 8, !tbaa !5
  store ptr %12, ptr %38, align 8, !tbaa !5
  store ptr %13, ptr %39, align 8, !tbaa !5
  store ptr %14, ptr %40, align 8, !tbaa !5
  store ptr %15, ptr %41, align 8, !tbaa !5
  store ptr %16, ptr %42, align 8, !tbaa !5
  store ptr %17, ptr %43, align 8, !tbaa !5
  store ptr %18, ptr %44, align 8, !tbaa !5
  store ptr %19, ptr %45, align 8, !tbaa !5
  store ptr %20, ptr %46, align 8, !tbaa !5
  store ptr %21, ptr %47, align 8, !tbaa !5
  store ptr %22, ptr %48, align 8, !tbaa !5
  store ptr %23, ptr %49, align 8, !tbaa !5
  store ptr %24, ptr %50, align 8, !tbaa !5
  %59 = load ptr, ptr %26, align 8
  %60 = getelementptr inbounds %class.snoptProblem, ptr %59, i32 0, i32 1
  %61 = load i32, ptr %60, align 8, !tbaa !13
  %62 = icmp eq i32 %61, 1
  br i1 %62, label %63, label %64

63:                                               ; preds = %25
  br label %66

64:                                               ; preds = %25
  call void @__assert_fail(ptr noundef @.str.6, ptr noundef @.str.2, i32 noundef 478, ptr noundef @__PRETTY_FUNCTION__._ZN13snoptProblemC5solveEiiiiiiiiidPFvPiS0_S0_S0_S0_S0_PdS1_S1_S1_S1_S0_PcS0_S0_S0_S1_S0_ES1_S0_S0_S1_S1_S0_S1_S1_S1_RiS5_RdS6_) #4
  unreachable

65:                                               ; No predecessors!
  br label %66

66:                                               ; preds = %65, %63
  call void @llvm.lifetime.start.p0(i64 4, ptr %51) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %52) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %53) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %54) #5
  %67 = getelementptr inbounds %class.snoptProblem, ptr %59, i32 0, i32 2
  %68 = load i32, ptr %67, align 4, !tbaa !15
  %69 = icmp eq i32 %68, 0
  br i1 %69, label %70, label %78

70:                                               ; preds = %66
  %71 = load i32, ptr %28, align 4, !tbaa !9
  %72 = load i32, ptr %29, align 4, !tbaa !9
  %73 = load i32, ptr %30, align 4, !tbaa !9
  %74 = load i32, ptr %31, align 4, !tbaa !9
  %75 = load i32, ptr %32, align 4, !tbaa !9
  %76 = load i32, ptr %33, align 4, !tbaa !9
  %77 = load i32, ptr %34, align 4, !tbaa !9
  call void @_ZN13snoptProblemC12setWorkspaceEiiiiiii(ptr noundef nonnull align 8 dereferenceable(128) %59, i32 noundef %71, i32 noundef %72, i32 noundef %73, i32 noundef %74, i32 noundef %75, i32 noundef %76, i32 noundef %77)
  br label %78

78:                                               ; preds = %70, %66
  call void @llvm.lifetime.start.p0(i64 4, ptr %55) #5
  store i32 0, ptr %55, align 4, !tbaa !9
  br label %79

79:                                               ; preds = %91, %78
  %80 = load i32, ptr %55, align 4, !tbaa !9
  %81 = load i32, ptr %30, align 4, !tbaa !9
  %82 = icmp slt i32 %80, %81
  br i1 %82, label %84, label %83

83:                                               ; preds = %79
  call void @llvm.lifetime.end.p0(i64 4, ptr %55) #5
  br label %94

84:                                               ; preds = %79
  %85 = load ptr, ptr %39, align 8, !tbaa !5
  %86 = load i32, ptr %55, align 4, !tbaa !9
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds i32, ptr %85, i64 %87
  %89 = load i32, ptr %88, align 4, !tbaa !9
  %90 = add nsw i32 %89, 1
  store i32 %90, ptr %88, align 4, !tbaa !9
  br label %91

91:                                               ; preds = %84
  %92 = load i32, ptr %55, align 4, !tbaa !9
  %93 = add nsw i32 %92, 1
  store i32 %93, ptr %55, align 4, !tbaa !9
  br label %79, !llvm.loop !16

94:                                               ; preds = %83
  call void @llvm.lifetime.start.p0(i64 4, ptr %56) #5
  store i32 0, ptr %56, align 4, !tbaa !9
  br label %95

95:                                               ; preds = %107, %94
  %96 = load i32, ptr %56, align 4, !tbaa !9
  %97 = load i32, ptr %29, align 4, !tbaa !9
  %98 = icmp sle i32 %96, %97
  br i1 %98, label %100, label %99

99:                                               ; preds = %95
  call void @llvm.lifetime.end.p0(i64 4, ptr %56) #5
  br label %110

100:                                              ; preds = %95
  %101 = load ptr, ptr %40, align 8, !tbaa !5
  %102 = load i32, ptr %56, align 4, !tbaa !9
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds i32, ptr %101, i64 %103
  %105 = load i32, ptr %104, align 4, !tbaa !9
  %106 = add nsw i32 %105, 1
  store i32 %106, ptr %104, align 4, !tbaa !9
  br label %107

107:                                              ; preds = %100
  %108 = load i32, ptr %56, align 4, !tbaa !9
  %109 = add nsw i32 %108, 1
  store i32 %109, ptr %56, align 4, !tbaa !9
  br label %95, !llvm.loop !18

110:                                              ; preds = %99
  %111 = load i32, ptr %35, align 4, !tbaa !9
  %112 = add nsw i32 %111, 1
  store i32 %112, ptr %52, align 4, !tbaa !9
  %113 = load i32, ptr %27, align 4, !tbaa !9
  %114 = getelementptr inbounds %class.snoptProblem, ptr %59, i32 0, i32 0
  %115 = getelementptr inbounds [30 x i8], ptr %114, i64 0, i64 0
  %116 = load i32, ptr %28, align 4, !tbaa !9
  %117 = load i32, ptr %29, align 4, !tbaa !9
  %118 = load i32, ptr %30, align 4, !tbaa !9
  %119 = load i32, ptr %32, align 4, !tbaa !9
  %120 = load i32, ptr %33, align 4, !tbaa !9
  %121 = load i32, ptr %34, align 4, !tbaa !9
  %122 = load i32, ptr %52, align 4, !tbaa !9
  %123 = load double, ptr %36, align 8, !tbaa !11
  %124 = load ptr, ptr %37, align 8, !tbaa !5
  %125 = getelementptr inbounds %class.snoptProblemABC, ptr %59, i32 0, i32 1
  %126 = load ptr, ptr %125, align 8, !tbaa !19
  %127 = getelementptr inbounds %class.snoptProblemABC, ptr %59, i32 0, i32 2
  %128 = load ptr, ptr %127, align 8, !tbaa !21
  %129 = getelementptr inbounds %class.snoptProblemABC, ptr %59, i32 0, i32 3
  %130 = load ptr, ptr %129, align 8, !tbaa !22
  %131 = getelementptr inbounds %class.snoptProblemABC, ptr %59, i32 0, i32 4
  %132 = load ptr, ptr %131, align 8, !tbaa !23
  %133 = load ptr, ptr %38, align 8, !tbaa !5
  %134 = load ptr, ptr %39, align 8, !tbaa !5
  %135 = load ptr, ptr %40, align 8, !tbaa !5
  %136 = load ptr, ptr %41, align 8, !tbaa !5
  %137 = load ptr, ptr %42, align 8, !tbaa !5
  %138 = load ptr, ptr %43, align 8, !tbaa !5
  %139 = load ptr, ptr %44, align 8, !tbaa !5
  %140 = load ptr, ptr %45, align 8, !tbaa !5
  %141 = load ptr, ptr %46, align 8, !tbaa !5
  %142 = load ptr, ptr %47, align 8, !tbaa !5
  %143 = load ptr, ptr %48, align 8, !tbaa !5
  %144 = load ptr, ptr %49, align 8, !tbaa !5
  %145 = load ptr, ptr %50, align 8, !tbaa !5
  %146 = getelementptr inbounds %class.snoptProblem, ptr %59, i32 0, i32 11
  %147 = load ptr, ptr %146, align 8, !tbaa !24
  %148 = getelementptr inbounds %class.snoptProblem, ptr %59, i32 0, i32 9
  %149 = load i32, ptr %148, align 4, !tbaa !25
  %150 = getelementptr inbounds %class.snoptProblem, ptr %59, i32 0, i32 10
  %151 = load ptr, ptr %150, align 8, !tbaa !26
  %152 = getelementptr inbounds %class.snoptProblem, ptr %59, i32 0, i32 8
  %153 = load i32, ptr %152, align 8, !tbaa !27
  %154 = getelementptr inbounds %class.snoptProblem, ptr %59, i32 0, i32 7
  %155 = load ptr, ptr %154, align 8, !tbaa !28
  %156 = getelementptr inbounds %class.snoptProblem, ptr %59, i32 0, i32 4
  %157 = load i32, ptr %156, align 4, !tbaa !29
  %158 = getelementptr inbounds %class.snoptProblem, ptr %59, i32 0, i32 6
  %159 = load ptr, ptr %158, align 8, !tbaa !30
  %160 = getelementptr inbounds %class.snoptProblem, ptr %59, i32 0, i32 5
  %161 = load i32, ptr %160, align 8, !tbaa !31
  call void @f_snkerc(i32 noundef %113, ptr noundef %115, i32 noundef %116, i32 noundef %117, i32 noundef %118, i32 noundef %119, i32 noundef %120, i32 noundef %121, i32 noundef %122, double noundef %123, ptr noundef %124, ptr noundef %126, ptr noundef %128, ptr noundef %130, ptr noundef %132, ptr noundef %133, ptr noundef %134, ptr noundef %135, ptr noundef %136, ptr noundef %137, ptr noundef %138, ptr noundef %139, ptr noundef %140, ptr noundef %141, ptr noundef %51, ptr noundef %142, ptr noundef %143, ptr noundef %144, ptr noundef %145, ptr noundef %53, ptr noundef %54, ptr noundef %147, i32 noundef %149, ptr noundef %151, i32 noundef %153, ptr noundef %155, i32 noundef %157, ptr noundef %159, i32 noundef %161)
  call void @llvm.lifetime.start.p0(i64 4, ptr %57) #5
  store i32 0, ptr %57, align 4, !tbaa !9
  br label %162

162:                                              ; preds = %174, %110
  %163 = load i32, ptr %57, align 4, !tbaa !9
  %164 = load i32, ptr %30, align 4, !tbaa !9
  %165 = icmp slt i32 %163, %164
  br i1 %165, label %167, label %166

166:                                              ; preds = %162
  call void @llvm.lifetime.end.p0(i64 4, ptr %57) #5
  br label %177

167:                                              ; preds = %162
  %168 = load ptr, ptr %39, align 8, !tbaa !5
  %169 = load i32, ptr %57, align 4, !tbaa !9
  %170 = sext i32 %169 to i64
  %171 = getelementptr inbounds i32, ptr %168, i64 %170
  %172 = load i32, ptr %171, align 4, !tbaa !9
  %173 = add nsw i32 %172, -1
  store i32 %173, ptr %171, align 4, !tbaa !9
  br label %174

174:                                              ; preds = %167
  %175 = load i32, ptr %57, align 4, !tbaa !9
  %176 = add nsw i32 %175, 1
  store i32 %176, ptr %57, align 4, !tbaa !9
  br label %162, !llvm.loop !32

177:                                              ; preds = %166
  call void @llvm.lifetime.start.p0(i64 4, ptr %58) #5
  store i32 0, ptr %58, align 4, !tbaa !9
  br label %178

178:                                              ; preds = %190, %177
  %179 = load i32, ptr %58, align 4, !tbaa !9
  %180 = load i32, ptr %29, align 4, !tbaa !9
  %181 = icmp sle i32 %179, %180
  br i1 %181, label %183, label %182

182:                                              ; preds = %178
  call void @llvm.lifetime.end.p0(i64 4, ptr %58) #5
  br label %193

183:                                              ; preds = %178
  %184 = load ptr, ptr %40, align 8, !tbaa !5
  %185 = load i32, ptr %58, align 4, !tbaa !9
  %186 = sext i32 %185 to i64
  %187 = getelementptr inbounds i32, ptr %184, i64 %186
  %188 = load i32, ptr %187, align 4, !tbaa !9
  %189 = add nsw i32 %188, -1
  store i32 %189, ptr %187, align 4, !tbaa !9
  br label %190

190:                                              ; preds = %183
  %191 = load i32, ptr %58, align 4, !tbaa !9
  %192 = add nsw i32 %191, 1
  store i32 %192, ptr %58, align 4, !tbaa !9
  br label %178, !llvm.loop !33

193:                                              ; preds = %182
  %194 = load i32, ptr %51, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %54) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %53) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %52) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %51) #5
  ret i32 %194
}

declare void @f_snkerc(i32 noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, double noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef, i32 noundef) #3

attributes #0 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress 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 = { "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 #4 = { noreturn nounwind }
attributes #5 = { 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++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = !{!14, !10, i64 32}
!14 = !{!"_ZTS12snoptProblem", !7, i64 0, !10, i64 32, !10, i64 36, !10, i64 40, !10, i64 44, !10, i64 48, !6, i64 56, !6, i64 64, !10, i64 72, !10, i64 76, !6, i64 80, !6, i64 88}
!15 = !{!14, !10, i64 36}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = distinct !{!18, !17}
!19 = !{!20, !6, i64 96}
!20 = !{!"_ZTS15snoptProblemABC", !14, i64 0, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120}
!21 = !{!20, !6, i64 104}
!22 = !{!20, !6, i64 112}
!23 = !{!20, !6, i64 120}
!24 = !{!14, !6, i64 88}
!25 = !{!14, !10, i64 76}
!26 = !{!14, !6, i64 80}
!27 = !{!14, !10, i64 72}
!28 = !{!14, !6, i64 64}
!29 = !{!14, !10, i64 44}
!30 = !{!14, !6, i64 56}
!31 = !{!14, !10, i64 48}
!32 = distinct !{!32, !17}
!33 = distinct !{!33, !17}


; 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.2 = external hidden unnamed_addr constant [112 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [16 x i8], align 1
@__PRETTY_FUNCTION__._ZN13snoptProblemC5solveEiiiiiiiiidPFvPiS0_S0_S0_S0_S0_PdS1_S1_S1_S1_S0_PcS0_S0_S0_S1_S0_ES1_S0_S0_S1_S1_S0_S1_S1_S1_RiS5_RdS6_ = external hidden unnamed_addr constant [201 x i8], align 1

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #0

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN13snoptProblemC12setWorkspaceEiiiiiii(ptr noundef nonnull align 8 dereferenceable(128), i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN13snoptProblemC5solveEiiiiiiiiidPFvPiS0_S0_S0_S0_S0_PdS1_S1_S1_S1_S0_PcS0_S0_S0_S1_S0_ES1_S0_S0_S1_S1_S0_S1_S1_S1_RiS5_RdS6_(ptr noundef nonnull align 8 dereferenceable(128) %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4, i32 noundef %5, i32 noundef %6, i32 noundef %7, i32 noundef %8, i32 noundef %9, double noundef %10, ptr noundef %11, ptr noundef %12, ptr noundef %13, ptr noundef %14, ptr noundef %15, ptr noundef %16, ptr noundef %17, ptr noundef %18, ptr noundef %19, ptr noundef %20, ptr noundef nonnull align 4 dereferenceable(4) %21, ptr noundef nonnull align 4 dereferenceable(4) %22, ptr noundef nonnull align 8 dereferenceable(8) %23, ptr noundef nonnull align 8 dereferenceable(8) %24) local_unnamed_addr #2 align 2 {
  %26 = alloca i32, align 4
  %27 = alloca i32, align 4
  %28 = alloca i32, align 4
  %29 = getelementptr inbounds i8, ptr %0, i64 32
  %30 = load i32, ptr %29, align 8, !tbaa !5
  %31 = icmp eq i32 %30, 1
  br i1 %31, label %33, label %32

32:                                               ; preds = %25
  tail call void @__assert_fail(ptr noundef nonnull @.str.6, ptr noundef nonnull @.str.2, i32 noundef 478, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN13snoptProblemC5solveEiiiiiiiiidPFvPiS0_S0_S0_S0_S0_PdS1_S1_S1_S1_S0_PcS0_S0_S0_S1_S0_ES1_S0_S0_S1_S1_S0_S1_S1_S1_RiS5_RdS6_) #4
  unreachable

33:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %26) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %27) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %28) #5
  %34 = getelementptr inbounds i8, ptr %0, i64 36
  %35 = load i32, ptr %34, align 4, !tbaa !11
  %36 = icmp eq i32 %35, 0
  br i1 %36, label %37, label %38

37:                                               ; preds = %33
  tail call void @_ZN13snoptProblemC12setWorkspaceEiiiiiii(ptr noundef nonnull align 8 dereferenceable(128) %0, i32 noundef %2, i32 noundef %3, i32 noundef %4, i32 noundef %5, i32 noundef %6, i32 noundef %7, i32 noundef %8)
  br label %38

38:                                               ; preds = %37, %33
  %39 = icmp sgt i32 %4, 0
  br i1 %39, label %.lr.ph.preheader, label %.preheader57

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

.lr.ph.preheader128:                              ; preds = %middle.block, %.lr.ph.preheader
  %indvars.iv.ph = phi i64 [ 0, %.lr.ph.preheader ], [ %n.vec, %middle.block ]
  br label %.lr.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 ]
  %40 = getelementptr inbounds i32, ptr %13, i64 %index
  %41 = getelementptr inbounds i8, ptr %40, i64 16
  %wide.load = load <4 x i32>, ptr %40, align 4, !tbaa !12
  %wide.load85 = load <4 x i32>, ptr %41, align 4, !tbaa !12
  %42 = add nsw <4 x i32> %wide.load, <i32 1, i32 1, i32 1, i32 1>
  %43 = add nsw <4 x i32> %wide.load85, <i32 1, i32 1, i32 1, i32 1>
  store <4 x i32> %42, ptr %40, align 4, !tbaa !12
  store <4 x i32> %43, ptr %41, align 4, !tbaa !12
  %index.next = add nuw i64 %index, 8
  %44 = icmp eq i64 %index.next, %n.vec
  br i1 %44, label %middle.block, label %vector.body, !llvm.loop !13

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  br i1 %cmp.n, label %.preheader57, label %.lr.ph.preheader128

.preheader57:                                     ; preds = %.lr.ph, %middle.block, %38
  %.not59 = icmp slt i32 %3, 0
  br i1 %.not59, label %._crit_edge, label %.lr.ph61.preheader

.lr.ph61.preheader:                               ; preds = %.preheader57
  %45 = add nuw i32 %3, 1
  %wide.trip.count73 = zext i32 %45 to i64
  %min.iters.check88 = icmp ult i32 %3, 7
  br i1 %min.iters.check88, label %.lr.ph61.preheader127, label %vector.ph89

.lr.ph61.preheader127:                            ; preds = %middle.block86, %.lr.ph61.preheader
  %indvars.iv70.ph = phi i64 [ 0, %.lr.ph61.preheader ], [ %n.vec91, %middle.block86 ]
  br label %.lr.ph61

vector.ph89:                                      ; preds = %.lr.ph61.preheader
  %n.vec91 = and i64 %wide.trip.count73, 4294967288
  br label %vector.body93

vector.body93:                                    ; preds = %vector.body93, %vector.ph89
  %index94 = phi i64 [ 0, %vector.ph89 ], [ %index.next97, %vector.body93 ]
  %46 = getelementptr inbounds i32, ptr %14, i64 %index94
  %47 = getelementptr inbounds i8, ptr %46, i64 16
  %wide.load95 = load <4 x i32>, ptr %46, align 4, !tbaa !12
  %wide.load96 = load <4 x i32>, ptr %47, align 4, !tbaa !12
  %48 = add nsw <4 x i32> %wide.load95, <i32 1, i32 1, i32 1, i32 1>
  %49 = add nsw <4 x i32> %wide.load96, <i32 1, i32 1, i32 1, i32 1>
  store <4 x i32> %48, ptr %46, align 4, !tbaa !12
  store <4 x i32> %49, ptr %47, align 4, !tbaa !12
  %index.next97 = add nuw i64 %index94, 8
  %50 = icmp eq i64 %index.next97, %n.vec91
  br i1 %50, label %middle.block86, label %vector.body93, !llvm.loop !17

middle.block86:                                   ; preds = %vector.body93
  %cmp.n98 = icmp eq i64 %n.vec91, %wide.trip.count73
  br i1 %cmp.n98, label %._crit_edge, label %.lr.ph61.preheader127

.lr.ph:                                           ; preds = %.lr.ph.preheader128, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ %indvars.iv.ph, %.lr.ph.preheader128 ]
  %51 = getelementptr inbounds i32, ptr %13, i64 %indvars.iv
  %52 = load i32, ptr %51, align 4, !tbaa !12
  %53 = add nsw i32 %52, 1
  store i32 %53, ptr %51, align 4, !tbaa !12
  %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 %.preheader57, label %.lr.ph, !llvm.loop !18

._crit_edge:                                      ; preds = %.lr.ph61, %middle.block86, %.preheader57
  %54 = add nsw i32 %9, 1
  %55 = getelementptr inbounds i8, ptr %0, i64 96
  %56 = load ptr, ptr %55, align 8, !tbaa !19
  %57 = getelementptr inbounds i8, ptr %0, i64 104
  %58 = load ptr, ptr %57, align 8, !tbaa !21
  %59 = getelementptr inbounds i8, ptr %0, i64 112
  %60 = load ptr, ptr %59, align 8, !tbaa !22
  %61 = getelementptr inbounds i8, ptr %0, i64 120
  %62 = load ptr, ptr %61, align 8, !tbaa !23
  %63 = getelementptr inbounds i8, ptr %0, i64 88
  %64 = load ptr, ptr %63, align 8, !tbaa !24
  %65 = getelementptr inbounds i8, ptr %0, i64 76
  %66 = load i32, ptr %65, align 4, !tbaa !25
  %67 = getelementptr inbounds i8, ptr %0, i64 80
  %68 = load ptr, ptr %67, align 8, !tbaa !26
  %69 = getelementptr inbounds i8, ptr %0, i64 72
  %70 = load i32, ptr %69, align 8, !tbaa !27
  %71 = getelementptr inbounds i8, ptr %0, i64 64
  %72 = load ptr, ptr %71, align 8, !tbaa !28
  %73 = getelementptr inbounds i8, ptr %0, i64 44
  %74 = load i32, ptr %73, align 4, !tbaa !29
  %75 = getelementptr inbounds i8, ptr %0, i64 56
  %76 = load ptr, ptr %75, align 8, !tbaa !30
  %77 = getelementptr inbounds i8, ptr %0, i64 48
  %78 = load i32, ptr %77, align 8, !tbaa !31
  call void @f_snkerc(i32 noundef %1, ptr noundef nonnull %0, i32 noundef %2, i32 noundef %3, i32 noundef %4, i32 noundef %6, i32 noundef %7, i32 noundef %8, i32 noundef %54, double noundef %10, ptr noundef %11, ptr noundef %56, ptr noundef %58, ptr noundef %60, ptr noundef %62, ptr noundef %12, ptr noundef %13, ptr noundef %14, ptr noundef %15, ptr noundef %16, ptr noundef %17, ptr noundef %18, ptr noundef %19, ptr noundef %20, ptr noundef nonnull %26, ptr noundef nonnull %21, ptr noundef nonnull %22, ptr noundef nonnull %23, ptr noundef nonnull %24, ptr noundef nonnull %27, ptr noundef nonnull %28, ptr noundef %64, i32 noundef %66, ptr noundef %68, i32 noundef %70, ptr noundef %72, i32 noundef %74, ptr noundef %76, i32 noundef %78)
  br i1 %39, label %.lr.ph64.preheader, label %.preheader

.lr.ph64.preheader:                               ; preds = %._crit_edge
  %wide.trip.count78 = zext nneg i32 %4 to i64
  %min.iters.check101 = icmp ult i32 %4, 8
  br i1 %min.iters.check101, label %.lr.ph64.preheader126, label %vector.ph102

.lr.ph64.preheader126:                            ; preds = %middle.block99, %.lr.ph64.preheader
  %indvars.iv75.ph = phi i64 [ 0, %.lr.ph64.preheader ], [ %n.vec104, %middle.block99 ]
  br label %.lr.ph64

vector.ph102:                                     ; preds = %.lr.ph64.preheader
  %n.vec104 = and i64 %wide.trip.count78, 2147483640
  br label %vector.body106

vector.body106:                                   ; preds = %vector.body106, %vector.ph102
  %index107 = phi i64 [ 0, %vector.ph102 ], [ %index.next110, %vector.body106 ]
  %79 = getelementptr inbounds i32, ptr %13, i64 %index107
  %80 = getelementptr inbounds i8, ptr %79, i64 16
  %wide.load108 = load <4 x i32>, ptr %79, align 4, !tbaa !12
  %wide.load109 = load <4 x i32>, ptr %80, align 4, !tbaa !12
  %81 = add nsw <4 x i32> %wide.load108, <i32 -1, i32 -1, i32 -1, i32 -1>
  %82 = add nsw <4 x i32> %wide.load109, <i32 -1, i32 -1, i32 -1, i32 -1>
  store <4 x i32> %81, ptr %79, align 4, !tbaa !12
  store <4 x i32> %82, ptr %80, align 4, !tbaa !12
  %index.next110 = add nuw i64 %index107, 8
  %83 = icmp eq i64 %index.next110, %n.vec104
  br i1 %83, label %middle.block99, label %vector.body106, !llvm.loop !32

middle.block99:                                   ; preds = %vector.body106
  %cmp.n111 = icmp eq i64 %n.vec104, %wide.trip.count78
  br i1 %cmp.n111, label %.preheader, label %.lr.ph64.preheader126

.lr.ph61:                                         ; preds = %.lr.ph61.preheader127, %.lr.ph61
  %indvars.iv70 = phi i64 [ %indvars.iv.next71, %.lr.ph61 ], [ %indvars.iv70.ph, %.lr.ph61.preheader127 ]
  %84 = getelementptr inbounds i32, ptr %14, i64 %indvars.iv70
  %85 = load i32, ptr %84, align 4, !tbaa !12
  %86 = add nsw i32 %85, 1
  store i32 %86, ptr %84, align 4, !tbaa !12
  %indvars.iv.next71 = add nuw nsw i64 %indvars.iv70, 1
  %exitcond74.not = icmp eq i64 %indvars.iv.next71, %wide.trip.count73
  br i1 %exitcond74.not, label %._crit_edge, label %.lr.ph61, !llvm.loop !33

.preheader:                                       ; preds = %.lr.ph64, %middle.block99, %._crit_edge
  br i1 %.not59, label %._crit_edge68, label %.lr.ph67.preheader

.lr.ph67.preheader:                               ; preds = %.preheader
  %87 = add nuw i32 %3, 1
  %wide.trip.count83 = zext i32 %87 to i64
  %min.iters.check114 = icmp ult i32 %3, 7
  br i1 %min.iters.check114, label %.lr.ph67.preheader125, label %vector.ph115

.lr.ph67.preheader125:                            ; preds = %middle.block112, %.lr.ph67.preheader
  %indvars.iv80.ph = phi i64 [ 0, %.lr.ph67.preheader ], [ %n.vec117, %middle.block112 ]
  br label %.lr.ph67

vector.ph115:                                     ; preds = %.lr.ph67.preheader
  %n.vec117 = and i64 %wide.trip.count83, 4294967288
  br label %vector.body119

vector.body119:                                   ; preds = %vector.body119, %vector.ph115
  %index120 = phi i64 [ 0, %vector.ph115 ], [ %index.next123, %vector.body119 ]
  %88 = getelementptr inbounds i32, ptr %14, i64 %index120
  %89 = getelementptr inbounds i8, ptr %88, i64 16
  %wide.load121 = load <4 x i32>, ptr %88, align 4, !tbaa !12
  %wide.load122 = load <4 x i32>, ptr %89, align 4, !tbaa !12
  %90 = add nsw <4 x i32> %wide.load121, <i32 -1, i32 -1, i32 -1, i32 -1>
  %91 = add nsw <4 x i32> %wide.load122, <i32 -1, i32 -1, i32 -1, i32 -1>
  store <4 x i32> %90, ptr %88, align 4, !tbaa !12
  store <4 x i32> %91, ptr %89, align 4, !tbaa !12
  %index.next123 = add nuw i64 %index120, 8
  %92 = icmp eq i64 %index.next123, %n.vec117
  br i1 %92, label %middle.block112, label %vector.body119, !llvm.loop !34

middle.block112:                                  ; preds = %vector.body119
  %cmp.n124 = icmp eq i64 %n.vec117, %wide.trip.count83
  br i1 %cmp.n124, label %._crit_edge68, label %.lr.ph67.preheader125

.lr.ph64:                                         ; preds = %.lr.ph64.preheader126, %.lr.ph64
  %indvars.iv75 = phi i64 [ %indvars.iv.next76, %.lr.ph64 ], [ %indvars.iv75.ph, %.lr.ph64.preheader126 ]
  %93 = getelementptr inbounds i32, ptr %13, i64 %indvars.iv75
  %94 = load i32, ptr %93, align 4, !tbaa !12
  %95 = add nsw i32 %94, -1
  store i32 %95, ptr %93, align 4, !tbaa !12
  %indvars.iv.next76 = add nuw nsw i64 %indvars.iv75, 1
  %exitcond79.not = icmp eq i64 %indvars.iv.next76, %wide.trip.count78
  br i1 %exitcond79.not, label %.preheader, label %.lr.ph64, !llvm.loop !35

._crit_edge68:                                    ; preds = %.lr.ph67, %middle.block112, %.preheader
  %96 = load i32, ptr %26, align 4, !tbaa !12
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %28) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %27) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %26) #5
  ret i32 %96

.lr.ph67:                                         ; preds = %.lr.ph67.preheader125, %.lr.ph67
  %indvars.iv80 = phi i64 [ %indvars.iv.next81, %.lr.ph67 ], [ %indvars.iv80.ph, %.lr.ph67.preheader125 ]
  %97 = getelementptr inbounds i32, ptr %14, i64 %indvars.iv80
  %98 = load i32, ptr %97, align 4, !tbaa !12
  %99 = add nsw i32 %98, -1
  store i32 %99, ptr %97, align 4, !tbaa !12
  %indvars.iv.next81 = add nuw nsw i64 %indvars.iv80, 1
  %exitcond84.not = icmp eq i64 %indvars.iv.next81, %wide.trip.count83
  br i1 %exitcond84.not, label %._crit_edge68, label %.lr.ph67, !llvm.loop !36
}

declare void @f_snkerc(i32 noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, double noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef, i32 noundef) local_unnamed_addr #3

attributes #0 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress 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 = { "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 #4 = { noreturn nounwind }
attributes #5 = { 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, !9, i64 32}
!6 = !{!"_ZTS12snoptProblem", !7, i64 0, !9, i64 32, !9, i64 36, !9, i64 40, !9, i64 44, !9, i64 48, !10, i64 56, !10, i64 64, !9, i64 72, !9, i64 76, !10, i64 80, !10, i64 88}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!"int", !7, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!6, !9, i64 36}
!12 = !{!9, !9, 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, !15, !16}
!18 = distinct !{!18, !14, !16, !15}
!19 = !{!20, !10, i64 96}
!20 = !{!"_ZTS15snoptProblemABC", !6, i64 0, !10, i64 96, !10, i64 104, !10, i64 112, !10, i64 120}
!21 = !{!20, !10, i64 104}
!22 = !{!20, !10, i64 112}
!23 = !{!20, !10, i64 120}
!24 = !{!6, !10, i64 88}
!25 = !{!6, !9, i64 76}
!26 = !{!6, !10, i64 80}
!27 = !{!6, !9, i64 72}
!28 = !{!6, !10, i64 64}
!29 = !{!6, !9, i64 44}
!30 = !{!6, !10, i64 56}
!31 = !{!6, !9, i64 48}
!32 = distinct !{!32, !14, !15, !16}
!33 = distinct !{!33, !14, !16, !15}
!34 = distinct !{!34, !14, !15, !16}
!35 = distinct !{!35, !14, !16, !15}
!36 = distinct !{!36, !14, !16, !15}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,SROAPass,SimplifyCFGPass,TailCallElimPass