; 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__._ZN13snoptProblemB5solveEiiiiiiiiidPFvPiS0_S0_S0_PdS1_S1_S0_PcS0_S0_S0_S1_S0_EPFvS0_S0_S1_S1_S1_S0_S2_S0_S0_S0_S1_S0_ES1_S0_S0_S1_S1_S0_S1_S1_S1_RiS7_RdS8_ = external hidden unnamed_addr constant [209 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 @_ZN13snoptProblemB5solveEiiiiiiiiidPFvPiS0_S0_S0_PdS1_S1_S0_PcS0_S0_S0_S1_S0_EPFvS0_S0_S1_S1_S1_S0_S2_S0_S0_S0_S1_S0_ES1_S0_S0_S1_S1_S0_S1_S1_S1_RiS7_RdS8_(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 %21, ptr noundef nonnull align 4 dereferenceable(4) %22, ptr noundef nonnull align 4 dereferenceable(4) %23, ptr noundef nonnull align 8 dereferenceable(8) %24, ptr noundef nonnull align 8 dereferenceable(8) %25) #2 align 2 {
  %27 = alloca ptr, align 8
  %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 i32, align 4
  %37 = alloca double, 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 ptr, align 8
  %52 = alloca ptr, align 8
  %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
  %59 = alloca i32, align 4
  %60 = alloca i32, align 4
  store ptr %0, ptr %27, align 8, !tbaa !5
  store i32 %1, ptr %28, align 4, !tbaa !9
  store i32 %2, ptr %29, align 4, !tbaa !9
  store i32 %3, ptr %30, align 4, !tbaa !9
  store i32 %4, ptr %31, align 4, !tbaa !9
  store i32 %5, ptr %32, align 4, !tbaa !9
  store i32 %6, ptr %33, align 4, !tbaa !9
  store i32 %7, ptr %34, align 4, !tbaa !9
  store i32 %8, ptr %35, align 4, !tbaa !9
  store i32 %9, ptr %36, align 4, !tbaa !9
  store double %10, ptr %37, align 8, !tbaa !11
  store ptr %11, ptr %38, align 8, !tbaa !5
  store ptr %12, ptr %39, align 8, !tbaa !5
  store ptr %13, ptr %40, align 8, !tbaa !5
  store ptr %14, ptr %41, align 8, !tbaa !5
  store ptr %15, ptr %42, align 8, !tbaa !5
  store ptr %16, ptr %43, align 8, !tbaa !5
  store ptr %17, ptr %44, align 8, !tbaa !5
  store ptr %18, ptr %45, align 8, !tbaa !5
  store ptr %19, ptr %46, align 8, !tbaa !5
  store ptr %20, ptr %47, align 8, !tbaa !5
  store ptr %21, ptr %48, align 8, !tbaa !5
  store ptr %22, ptr %49, align 8, !tbaa !5
  store ptr %23, ptr %50, align 8, !tbaa !5
  store ptr %24, ptr %51, align 8, !tbaa !5
  store ptr %25, ptr %52, align 8, !tbaa !5
  %61 = load ptr, ptr %27, align 8
  %62 = getelementptr inbounds %class.snoptProblem, ptr %61, i32 0, i32 1
  %63 = load i32, ptr %62, align 8, !tbaa !13
  %64 = icmp eq i32 %63, 1
  br i1 %64, label %65, label %66

65:                                               ; preds = %26
  br label %68

66:                                               ; preds = %26
  call void @__assert_fail(ptr noundef @.str.6, ptr noundef @.str.2, i32 noundef 535, ptr noundef @__PRETTY_FUNCTION__._ZN13snoptProblemB5solveEiiiiiiiiidPFvPiS0_S0_S0_PdS1_S1_S0_PcS0_S0_S0_S1_S0_EPFvS0_S0_S1_S1_S1_S0_S2_S0_S0_S0_S1_S0_ES1_S0_S0_S1_S1_S0_S1_S1_S1_RiS7_RdS8_) #4
  unreachable

67:                                               ; No predecessors!
  br label %68

68:                                               ; preds = %67, %65
  call void @llvm.lifetime.start.p0(i64 4, ptr %53) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %54) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %55) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %56) #5
  %69 = getelementptr inbounds %class.snoptProblem, ptr %61, i32 0, i32 2
  %70 = load i32, ptr %69, align 4, !tbaa !15
  %71 = icmp eq i32 %70, 0
  br i1 %71, label %72, label %80

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

80:                                               ; preds = %72, %68
  call void @llvm.lifetime.start.p0(i64 4, ptr %57) #5
  store i32 0, ptr %57, align 4, !tbaa !9
  br label %81

81:                                               ; preds = %93, %80
  %82 = load i32, ptr %57, align 4, !tbaa !9
  %83 = load i32, ptr %31, align 4, !tbaa !9
  %84 = icmp slt i32 %82, %83
  br i1 %84, label %86, label %85

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

86:                                               ; preds = %81
  %87 = load ptr, ptr %41, align 8, !tbaa !5
  %88 = load i32, ptr %57, align 4, !tbaa !9
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds i32, ptr %87, i64 %89
  %91 = load i32, ptr %90, align 4, !tbaa !9
  %92 = add nsw i32 %91, 1
  store i32 %92, ptr %90, align 4, !tbaa !9
  br label %93

93:                                               ; preds = %86
  %94 = load i32, ptr %57, align 4, !tbaa !9
  %95 = add nsw i32 %94, 1
  store i32 %95, ptr %57, align 4, !tbaa !9
  br label %81, !llvm.loop !16

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

97:                                               ; preds = %109, %96
  %98 = load i32, ptr %58, align 4, !tbaa !9
  %99 = load i32, ptr %30, align 4, !tbaa !9
  %100 = icmp sle i32 %98, %99
  br i1 %100, label %102, label %101

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

102:                                              ; preds = %97
  %103 = load ptr, ptr %42, align 8, !tbaa !5
  %104 = load i32, ptr %58, align 4, !tbaa !9
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds i32, ptr %103, i64 %105
  %107 = load i32, ptr %106, align 4, !tbaa !9
  %108 = add nsw i32 %107, 1
  store i32 %108, ptr %106, align 4, !tbaa !9
  br label %109

109:                                              ; preds = %102
  %110 = load i32, ptr %58, align 4, !tbaa !9
  %111 = add nsw i32 %110, 1
  store i32 %111, ptr %58, align 4, !tbaa !9
  br label %97, !llvm.loop !18

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

165:                                              ; preds = %177, %112
  %166 = load i32, ptr %59, align 4, !tbaa !9
  %167 = load i32, ptr %31, align 4, !tbaa !9
  %168 = icmp slt i32 %166, %167
  br i1 %168, label %170, label %169

169:                                              ; preds = %165
  call void @llvm.lifetime.end.p0(i64 4, ptr %59) #5
  br label %180

170:                                              ; preds = %165
  %171 = load ptr, ptr %41, align 8, !tbaa !5
  %172 = load i32, ptr %59, align 4, !tbaa !9
  %173 = sext i32 %172 to i64
  %174 = getelementptr inbounds i32, ptr %171, i64 %173
  %175 = load i32, ptr %174, align 4, !tbaa !9
  %176 = add nsw i32 %175, -1
  store i32 %176, ptr %174, align 4, !tbaa !9
  br label %177

177:                                              ; preds = %170
  %178 = load i32, ptr %59, align 4, !tbaa !9
  %179 = add nsw i32 %178, 1
  store i32 %179, ptr %59, align 4, !tbaa !9
  br label %165, !llvm.loop !32

180:                                              ; preds = %169
  call void @llvm.lifetime.start.p0(i64 4, ptr %60) #5
  store i32 0, ptr %60, align 4, !tbaa !9
  br label %181

181:                                              ; preds = %193, %180
  %182 = load i32, ptr %60, align 4, !tbaa !9
  %183 = load i32, ptr %30, align 4, !tbaa !9
  %184 = icmp sle i32 %182, %183
  br i1 %184, label %186, label %185

185:                                              ; preds = %181
  call void @llvm.lifetime.end.p0(i64 4, ptr %60) #5
  br label %196

186:                                              ; preds = %181
  %187 = load ptr, ptr %42, align 8, !tbaa !5
  %188 = load i32, ptr %60, align 4, !tbaa !9
  %189 = sext i32 %188 to i64
  %190 = getelementptr inbounds i32, ptr %187, i64 %189
  %191 = load i32, ptr %190, align 4, !tbaa !9
  %192 = add nsw i32 %191, -1
  store i32 %192, ptr %190, align 4, !tbaa !9
  br label %193

193:                                              ; preds = %186
  %194 = load i32, ptr %60, align 4, !tbaa !9
  %195 = add nsw i32 %194, 1
  store i32 %195, ptr %60, align 4, !tbaa !9
  br label %181, !llvm.loop !33

196:                                              ; preds = %185
  %197 = load i32, ptr %53, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %56) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %55) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %54) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %53) #5
  ret i32 %197
}

declare void @f_snkerb(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, 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__._ZN13snoptProblemB5solveEiiiiiiiiidPFvPiS0_S0_S0_PdS1_S1_S0_PcS0_S0_S0_S1_S0_EPFvS0_S0_S1_S1_S1_S0_S2_S0_S0_S0_S1_S0_ES1_S0_S0_S1_S1_S0_S1_S1_S1_RiS7_RdS8_ = external hidden unnamed_addr constant [209 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 @_ZN13snoptProblemB5solveEiiiiiiiiidPFvPiS0_S0_S0_PdS1_S1_S0_PcS0_S0_S0_S1_S0_EPFvS0_S0_S1_S1_S1_S0_S2_S0_S0_S0_S1_S0_ES1_S0_S0_S1_S1_S0_S1_S1_S1_RiS7_RdS8_(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 %21, ptr noundef nonnull align 4 dereferenceable(4) %22, ptr noundef nonnull align 4 dereferenceable(4) %23, ptr noundef nonnull align 8 dereferenceable(8) %24, ptr noundef nonnull align 8 dereferenceable(8) %25) local_unnamed_addr #2 align 2 {
  %27 = alloca i32, align 4
  %28 = alloca i32, align 4
  %29 = alloca i32, align 4
  %30 = getelementptr inbounds i8, ptr %0, i64 32
  %31 = load i32, ptr %30, align 8, !tbaa !5
  %32 = icmp eq i32 %31, 1
  br i1 %32, label %34, label %33

33:                                               ; preds = %26
  tail call void @__assert_fail(ptr noundef nonnull @.str.6, ptr noundef nonnull @.str.2, i32 noundef 535, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN13snoptProblemB5solveEiiiiiiiiidPFvPiS0_S0_S0_PdS1_S1_S0_PcS0_S0_S0_S1_S0_EPFvS0_S0_S1_S1_S1_S0_S2_S0_S0_S0_S1_S0_ES1_S0_S0_S1_S1_S0_S1_S1_S1_RiS7_RdS8_) #4
  unreachable

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

38:                                               ; preds = %34
  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 %39

39:                                               ; preds = %38, %34
  %40 = icmp sgt i32 %4, 0
  br i1 %40, label %.lr.ph.preheader, label %.preheader58

.lr.ph.preheader:                                 ; preds = %39
  %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.preheader129, label %vector.ph

.lr.ph.preheader129:                              ; 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 ]
  %41 = getelementptr inbounds i32, ptr %14, i64 %index
  %42 = getelementptr inbounds i8, ptr %41, i64 16
  %wide.load = load <4 x i32>, ptr %41, align 4, !tbaa !12
  %wide.load86 = load <4 x i32>, ptr %42, align 4, !tbaa !12
  %43 = add nsw <4 x i32> %wide.load, <i32 1, i32 1, i32 1, i32 1>
  %44 = add nsw <4 x i32> %wide.load86, <i32 1, i32 1, i32 1, i32 1>
  store <4 x i32> %43, ptr %41, align 4, !tbaa !12
  store <4 x i32> %44, ptr %42, align 4, !tbaa !12
  %index.next = add nuw i64 %index, 8
  %45 = icmp eq i64 %index.next, %n.vec
  br i1 %45, 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 %.preheader58, label %.lr.ph.preheader129

.preheader58:                                     ; preds = %.lr.ph, %middle.block, %39
  %.not60 = icmp slt i32 %3, 0
  br i1 %.not60, label %._crit_edge, label %.lr.ph62.preheader

.lr.ph62.preheader:                               ; preds = %.preheader58
  %46 = add nuw i32 %3, 1
  %wide.trip.count74 = zext i32 %46 to i64
  %min.iters.check89 = icmp ult i32 %3, 7
  br i1 %min.iters.check89, label %.lr.ph62.preheader128, label %vector.ph90

.lr.ph62.preheader128:                            ; preds = %middle.block87, %.lr.ph62.preheader
  %indvars.iv71.ph = phi i64 [ 0, %.lr.ph62.preheader ], [ %n.vec92, %middle.block87 ]
  br label %.lr.ph62

vector.ph90:                                      ; preds = %.lr.ph62.preheader
  %n.vec92 = and i64 %wide.trip.count74, 4294967288
  br label %vector.body94

vector.body94:                                    ; preds = %vector.body94, %vector.ph90
  %index95 = phi i64 [ 0, %vector.ph90 ], [ %index.next98, %vector.body94 ]
  %47 = getelementptr inbounds i32, ptr %15, i64 %index95
  %48 = getelementptr inbounds i8, ptr %47, i64 16
  %wide.load96 = load <4 x i32>, ptr %47, align 4, !tbaa !12
  %wide.load97 = load <4 x i32>, ptr %48, align 4, !tbaa !12
  %49 = add nsw <4 x i32> %wide.load96, <i32 1, i32 1, i32 1, i32 1>
  %50 = add nsw <4 x i32> %wide.load97, <i32 1, i32 1, i32 1, i32 1>
  store <4 x i32> %49, ptr %47, align 4, !tbaa !12
  store <4 x i32> %50, ptr %48, align 4, !tbaa !12
  %index.next98 = add nuw i64 %index95, 8
  %51 = icmp eq i64 %index.next98, %n.vec92
  br i1 %51, label %middle.block87, label %vector.body94, !llvm.loop !17

middle.block87:                                   ; preds = %vector.body94
  %cmp.n99 = icmp eq i64 %n.vec92, %wide.trip.count74
  br i1 %cmp.n99, label %._crit_edge, label %.lr.ph62.preheader128

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

._crit_edge:                                      ; preds = %.lr.ph62, %middle.block87, %.preheader58
  %55 = add nsw i32 %9, 1
  %56 = getelementptr inbounds i8, ptr %0, i64 96
  %57 = load ptr, ptr %56, align 8, !tbaa !19
  %58 = getelementptr inbounds i8, ptr %0, i64 104
  %59 = load ptr, ptr %58, align 8, !tbaa !21
  %60 = getelementptr inbounds i8, ptr %0, i64 112
  %61 = load ptr, ptr %60, align 8, !tbaa !22
  %62 = getelementptr inbounds i8, ptr %0, i64 120
  %63 = load ptr, ptr %62, align 8, !tbaa !23
  %64 = getelementptr inbounds i8, ptr %0, i64 88
  %65 = load ptr, ptr %64, align 8, !tbaa !24
  %66 = getelementptr inbounds i8, ptr %0, i64 76
  %67 = load i32, ptr %66, align 4, !tbaa !25
  %68 = getelementptr inbounds i8, ptr %0, i64 80
  %69 = load ptr, ptr %68, align 8, !tbaa !26
  %70 = getelementptr inbounds i8, ptr %0, i64 72
  %71 = load i32, ptr %70, align 8, !tbaa !27
  %72 = getelementptr inbounds i8, ptr %0, i64 64
  %73 = load ptr, ptr %72, align 8, !tbaa !28
  %74 = getelementptr inbounds i8, ptr %0, i64 44
  %75 = load i32, ptr %74, align 4, !tbaa !29
  %76 = getelementptr inbounds i8, ptr %0, i64 56
  %77 = load ptr, ptr %76, align 8, !tbaa !30
  %78 = getelementptr inbounds i8, ptr %0, i64 48
  %79 = load i32, ptr %78, align 8, !tbaa !31
  call void @f_snkerb(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 %55, double noundef %10, ptr noundef %11, ptr noundef %12, ptr noundef %57, ptr noundef %59, ptr noundef %61, ptr noundef %63, 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 %21, ptr noundef nonnull %27, ptr noundef nonnull %22, ptr noundef nonnull %23, ptr noundef nonnull %24, ptr noundef nonnull %25, ptr noundef nonnull %28, ptr noundef nonnull %29, ptr noundef %65, i32 noundef %67, ptr noundef %69, i32 noundef %71, ptr noundef %73, i32 noundef %75, ptr noundef %77, i32 noundef %79)
  br i1 %40, label %.lr.ph65.preheader, label %.preheader

.lr.ph65.preheader:                               ; preds = %._crit_edge
  %wide.trip.count79 = zext nneg i32 %4 to i64
  %min.iters.check102 = icmp ult i32 %4, 8
  br i1 %min.iters.check102, label %.lr.ph65.preheader127, label %vector.ph103

.lr.ph65.preheader127:                            ; preds = %middle.block100, %.lr.ph65.preheader
  %indvars.iv76.ph = phi i64 [ 0, %.lr.ph65.preheader ], [ %n.vec105, %middle.block100 ]
  br label %.lr.ph65

vector.ph103:                                     ; preds = %.lr.ph65.preheader
  %n.vec105 = and i64 %wide.trip.count79, 2147483640
  br label %vector.body107

vector.body107:                                   ; preds = %vector.body107, %vector.ph103
  %index108 = phi i64 [ 0, %vector.ph103 ], [ %index.next111, %vector.body107 ]
  %80 = getelementptr inbounds i32, ptr %14, i64 %index108
  %81 = getelementptr inbounds i8, ptr %80, i64 16
  %wide.load109 = load <4 x i32>, ptr %80, align 4, !tbaa !12
  %wide.load110 = load <4 x i32>, ptr %81, align 4, !tbaa !12
  %82 = add nsw <4 x i32> %wide.load109, <i32 -1, i32 -1, i32 -1, i32 -1>
  %83 = add nsw <4 x i32> %wide.load110, <i32 -1, i32 -1, i32 -1, i32 -1>
  store <4 x i32> %82, ptr %80, align 4, !tbaa !12
  store <4 x i32> %83, ptr %81, align 4, !tbaa !12
  %index.next111 = add nuw i64 %index108, 8
  %84 = icmp eq i64 %index.next111, %n.vec105
  br i1 %84, label %middle.block100, label %vector.body107, !llvm.loop !32

middle.block100:                                  ; preds = %vector.body107
  %cmp.n112 = icmp eq i64 %n.vec105, %wide.trip.count79
  br i1 %cmp.n112, label %.preheader, label %.lr.ph65.preheader127

.lr.ph62:                                         ; preds = %.lr.ph62.preheader128, %.lr.ph62
  %indvars.iv71 = phi i64 [ %indvars.iv.next72, %.lr.ph62 ], [ %indvars.iv71.ph, %.lr.ph62.preheader128 ]
  %85 = getelementptr inbounds i32, ptr %15, i64 %indvars.iv71
  %86 = load i32, ptr %85, align 4, !tbaa !12
  %87 = add nsw i32 %86, 1
  store i32 %87, ptr %85, align 4, !tbaa !12
  %indvars.iv.next72 = add nuw nsw i64 %indvars.iv71, 1
  %exitcond75.not = icmp eq i64 %indvars.iv.next72, %wide.trip.count74
  br i1 %exitcond75.not, label %._crit_edge, label %.lr.ph62, !llvm.loop !33

.preheader:                                       ; preds = %.lr.ph65, %middle.block100, %._crit_edge
  br i1 %.not60, label %._crit_edge69, label %.lr.ph68.preheader

.lr.ph68.preheader:                               ; preds = %.preheader
  %88 = add nuw i32 %3, 1
  %wide.trip.count84 = zext i32 %88 to i64
  %min.iters.check115 = icmp ult i32 %3, 7
  br i1 %min.iters.check115, label %.lr.ph68.preheader126, label %vector.ph116

.lr.ph68.preheader126:                            ; preds = %middle.block113, %.lr.ph68.preheader
  %indvars.iv81.ph = phi i64 [ 0, %.lr.ph68.preheader ], [ %n.vec118, %middle.block113 ]
  br label %.lr.ph68

vector.ph116:                                     ; preds = %.lr.ph68.preheader
  %n.vec118 = and i64 %wide.trip.count84, 4294967288
  br label %vector.body120

vector.body120:                                   ; preds = %vector.body120, %vector.ph116
  %index121 = phi i64 [ 0, %vector.ph116 ], [ %index.next124, %vector.body120 ]
  %89 = getelementptr inbounds i32, ptr %15, i64 %index121
  %90 = getelementptr inbounds i8, ptr %89, i64 16
  %wide.load122 = load <4 x i32>, ptr %89, align 4, !tbaa !12
  %wide.load123 = load <4 x i32>, ptr %90, align 4, !tbaa !12
  %91 = add nsw <4 x i32> %wide.load122, <i32 -1, i32 -1, i32 -1, i32 -1>
  %92 = add nsw <4 x i32> %wide.load123, <i32 -1, i32 -1, i32 -1, i32 -1>
  store <4 x i32> %91, ptr %89, align 4, !tbaa !12
  store <4 x i32> %92, ptr %90, align 4, !tbaa !12
  %index.next124 = add nuw i64 %index121, 8
  %93 = icmp eq i64 %index.next124, %n.vec118
  br i1 %93, label %middle.block113, label %vector.body120, !llvm.loop !34

middle.block113:                                  ; preds = %vector.body120
  %cmp.n125 = icmp eq i64 %n.vec118, %wide.trip.count84
  br i1 %cmp.n125, label %._crit_edge69, label %.lr.ph68.preheader126

.lr.ph65:                                         ; preds = %.lr.ph65.preheader127, %.lr.ph65
  %indvars.iv76 = phi i64 [ %indvars.iv.next77, %.lr.ph65 ], [ %indvars.iv76.ph, %.lr.ph65.preheader127 ]
  %94 = getelementptr inbounds i32, ptr %14, i64 %indvars.iv76
  %95 = load i32, ptr %94, align 4, !tbaa !12
  %96 = add nsw i32 %95, -1
  store i32 %96, ptr %94, align 4, !tbaa !12
  %indvars.iv.next77 = add nuw nsw i64 %indvars.iv76, 1
  %exitcond80.not = icmp eq i64 %indvars.iv.next77, %wide.trip.count79
  br i1 %exitcond80.not, label %.preheader, label %.lr.ph65, !llvm.loop !35

._crit_edge69:                                    ; preds = %.lr.ph68, %middle.block113, %.preheader
  %97 = load i32, ptr %27, align 4, !tbaa !12
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %29) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %28) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %27) #5
  ret i32 %97

.lr.ph68:                                         ; preds = %.lr.ph68.preheader126, %.lr.ph68
  %indvars.iv81 = phi i64 [ %indvars.iv.next82, %.lr.ph68 ], [ %indvars.iv81.ph, %.lr.ph68.preheader126 ]
  %98 = getelementptr inbounds i32, ptr %15, i64 %indvars.iv81
  %99 = load i32, ptr %98, align 4, !tbaa !12
  %100 = add nsw i32 %99, -1
  store i32 %100, ptr %98, align 4, !tbaa !12
  %indvars.iv.next82 = add nuw nsw i64 %indvars.iv81, 1
  %exitcond85.not = icmp eq i64 %indvars.iv.next82, %wide.trip.count84
  br i1 %exitcond85.not, label %._crit_edge69, label %.lr.ph68, !llvm.loop !36
}

declare void @f_snkerb(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, 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