; LLVM IR from HRI-EU/Rcs :: src/RcsCore (Rcs_mathTests)

; 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.Rcs::CmdLineParser" = type { i8 }
%struct._MatNd = type { ptr, i32, i32, i32, i8 }

@RCS_GLOBAL_RLOG_CB = external global ptr, align 8
@.str.3 = external hidden unnamed_addr constant [74 x i8], align 1
@RcsLogLevel = external global i32, align 4
@stderr = external global ptr, align 8
@.str.5 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.64 = external hidden unnamed_addr constant [6 x i8], align 1
@__func__.testLinesearch = external hidden unnamed_addr constant [15 x i8], align 1
@.str.299 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.300 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.301 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.302 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.303 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.304 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.305 = external hidden unnamed_addr constant [47 x i8], align 1
@.str.306 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.307 = external hidden unnamed_addr constant [27 x i8], align 1

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

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

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #1

declare void @_ZN3Rcs13CmdLineParserC1EiPPc(ptr noundef nonnull align 1 dereferenceable(1), i32 noundef, ptr noundef) unnamed_addr #2

declare noundef zeroext i1 @_ZNK3Rcs13CmdLineParser11getArgumentEPKcPdS2_z(ptr noundef nonnull align 1 dereferenceable(1), ptr noundef, ptr noundef, ptr noundef, ...) #2

declare ptr @MatNd_create(i32 noundef, i32 noundef) #2

declare void @MatNd_setRandom(ptr noundef, double noundef, double noundef) #2

declare void @MatNd_destroy(ptr noundef) #2

declare noundef zeroext i1 @_ZNK3Rcs13CmdLineParser11getArgumentEPKcPiS2_z(ptr noundef nonnull align 1 dereferenceable(1), ptr noundef, ptr noundef, ptr noundef, ...) #2

; Function Attrs: mustprogress uwtable
define dso_local zeroext i1 @testLinesearch(i32 noundef %0, ptr noundef %1) #3 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca %"class.Rcs::CmdLineParser", align 1
  %6 = alloca i32, align 4
  %7 = alloca double, align 8
  %8 = alloca i8, align 1
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca double, align 8
  %12 = alloca double, align 8
  %13 = alloca i32, align 4
  store i32 %0, ptr %3, align 4, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !9
  br label %14

14:                                               ; preds = %2
  %15 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !9
  %16 = icmp ne ptr %15, null
  br i1 %16, label %17, label %19

17:                                               ; preds = %14
  %18 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !9
  call void (i32, ptr, ptr, i32, ptr, ...) %18(i32 noundef 2, ptr noundef @.str.3, ptr noundef @__func__.testLinesearch, i32 noundef 3051, ptr noundef @.str.24)
  br label %19

19:                                               ; preds = %17, %14
  %20 = load i32, ptr @RcsLogLevel, align 4, !tbaa !5
  %21 = icmp sle i32 2, %20
  br i1 %21, label %22, label %29

22:                                               ; preds = %19
  %23 = load ptr, ptr @stderr, align 8, !tbaa !9
  %24 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %23, ptr noundef @.str.5, ptr noundef @.str.3, ptr noundef @__func__.testLinesearch, i32 noundef 3051) #5
  %25 = load ptr, ptr @stderr, align 8, !tbaa !9
  %26 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %25, ptr noundef @.str.24) #5
  %27 = load ptr, ptr @stderr, align 8, !tbaa !9
  %28 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %27, ptr noundef @.str.6) #5
  br label %29

29:                                               ; preds = %22, %19
  br label %30

30:                                               ; preds = %29
  br label %31

31:                                               ; preds = %30
  %32 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !9
  %33 = icmp ne ptr %32, null
  br i1 %33, label %34, label %36

34:                                               ; preds = %31
  %35 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !9
  call void (i32, ptr, ptr, i32, ptr, ...) %35(i32 noundef 2, ptr noundef @.str.3, ptr noundef @__func__.testLinesearch, i32 noundef 3052, ptr noundef @.str.299)
  br label %36

36:                                               ; preds = %34, %31
  %37 = load i32, ptr @RcsLogLevel, align 4, !tbaa !5
  %38 = icmp sle i32 2, %37
  br i1 %38, label %39, label %46

39:                                               ; preds = %36
  %40 = load ptr, ptr @stderr, align 8, !tbaa !9
  %41 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %40, ptr noundef @.str.5, ptr noundef @.str.3, ptr noundef @__func__.testLinesearch, i32 noundef 3052) #5
  %42 = load ptr, ptr @stderr, align 8, !tbaa !9
  %43 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %42, ptr noundef @.str.299) #5
  %44 = load ptr, ptr @stderr, align 8, !tbaa !9
  %45 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %44, ptr noundef @.str.6) #5
  br label %46

46:                                               ; preds = %39, %36
  br label %47

47:                                               ; preds = %46
  br label %48

48:                                               ; preds = %47
  %49 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !9
  %50 = icmp ne ptr %49, null
  br i1 %50, label %51, label %53

51:                                               ; preds = %48
  %52 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !9
  call void (i32, ptr, ptr, i32, ptr, ...) %52(i32 noundef 2, ptr noundef @.str.3, ptr noundef @__func__.testLinesearch, i32 noundef 3053, ptr noundef @.str.24)
  br label %53

53:                                               ; preds = %51, %48
  %54 = load i32, ptr @RcsLogLevel, align 4, !tbaa !5
  %55 = icmp sle i32 2, %54
  br i1 %55, label %56, label %63

56:                                               ; preds = %53
  %57 = load ptr, ptr @stderr, align 8, !tbaa !9
  %58 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %57, ptr noundef @.str.5, ptr noundef @.str.3, ptr noundef @__func__.testLinesearch, i32 noundef 3053) #5
  %59 = load ptr, ptr @stderr, align 8, !tbaa !9
  %60 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %59, ptr noundef @.str.24) #5
  %61 = load ptr, ptr @stderr, align 8, !tbaa !9
  %62 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %61, ptr noundef @.str.6) #5
  br label %63

63:                                               ; preds = %56, %53
  br label %64

64:                                               ; preds = %63
  call void @llvm.lifetime.start.p0(i64 1, ptr %5) #5
  %65 = load i32, ptr %3, align 4, !tbaa !5
  %66 = load ptr, ptr %4, align 8, !tbaa !9
  call void @_ZN3Rcs13CmdLineParserC1EiPPc(ptr noundef nonnull align 1 dereferenceable(1) %5, i32 noundef %65, ptr noundef %66)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 10, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  store double 9.000000e-01, ptr %7, align 8, !tbaa !11
  %67 = call noundef zeroext i1 (ptr, ptr, ptr, ptr, ...) @_ZNK3Rcs13CmdLineParser11getArgumentEPKcPiS2_z(ptr noundef nonnull align 1 dereferenceable(1) %5, ptr noundef @.str.64, ptr noundef %6, ptr noundef @.str.300)
  %68 = call noundef zeroext i1 (ptr, ptr, ptr, ptr, ...) @_ZNK3Rcs13CmdLineParser11getArgumentEPKcPdS2_z(ptr noundef nonnull align 1 dereferenceable(1) %5, ptr noundef @.str.301, ptr noundef %7, ptr noundef @.str.302)
  call void @llvm.lifetime.start.p0(i64 1, ptr %8) #5
  store i8 1, ptr %8, align 1, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  %69 = call ptr @MatNd_create(i32 noundef 1, i32 noundef 1)
  store ptr %69, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %70 = call ptr @MatNd_create(i32 noundef 1, i32 noundef 1)
  store ptr %70, ptr %10, align 8, !tbaa !9
  %71 = load ptr, ptr %9, align 8, !tbaa !9
  call void @MatNd_setRandom(ptr noundef %71, double noundef -1.000000e+00, double noundef 1.000000e+00)
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %72 = load ptr, ptr %9, align 8, !tbaa !9
  %73 = getelementptr inbounds %struct._MatNd, ptr %72, i32 0, i32 0
  %74 = load ptr, ptr %73, align 8, !tbaa !15
  %75 = call noundef double @_ZL15lineSearch_costPdPv(ptr noundef %74, ptr noundef null)
  store double %75, ptr %11, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %76 = load double, ptr %11, align 8, !tbaa !11
  store double %76, ptr %12, align 8, !tbaa !11
  %77 = load ptr, ptr %10, align 8, !tbaa !9
  %78 = getelementptr inbounds %struct._MatNd, ptr %77, i32 0, i32 0
  %79 = load ptr, ptr %78, align 8, !tbaa !15
  %80 = load ptr, ptr %9, align 8, !tbaa !9
  %81 = getelementptr inbounds %struct._MatNd, ptr %80, i32 0, i32 0
  %82 = load ptr, ptr %81, align 8, !tbaa !15
  call void @_ZL15lineSearch_gradPdPKd(ptr noundef %79, ptr noundef %82)
  br label %83

83:                                               ; preds = %64
  %84 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !9
  %85 = icmp ne ptr %84, null
  br i1 %85, label %86, label %94

86:                                               ; preds = %83
  %87 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !9
  %88 = load double, ptr %11, align 8, !tbaa !11
  %89 = load ptr, ptr %9, align 8, !tbaa !9
  %90 = getelementptr inbounds %struct._MatNd, ptr %89, i32 0, i32 0
  %91 = load ptr, ptr %90, align 8, !tbaa !15
  %92 = getelementptr inbounds double, ptr %91, i64 0
  %93 = load double, ptr %92, align 8, !tbaa !11
  call void (i32, ptr, ptr, i32, ptr, ...) %87(i32 noundef 2, ptr noundef @.str.3, ptr noundef @__func__.testLinesearch, i32 noundef 3070, ptr noundef @.str.303, double noundef %88, double noundef %93)
  br label %94

94:                                               ; preds = %86, %83
  %95 = load i32, ptr @RcsLogLevel, align 4, !tbaa !5
  %96 = icmp sle i32 2, %95
  br i1 %96, label %97, label %110

97:                                               ; preds = %94
  %98 = load ptr, ptr @stderr, align 8, !tbaa !9
  %99 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %98, ptr noundef @.str.5, ptr noundef @.str.3, ptr noundef @__func__.testLinesearch, i32 noundef 3070) #5
  %100 = load ptr, ptr @stderr, align 8, !tbaa !9
  %101 = load double, ptr %11, align 8, !tbaa !11
  %102 = load ptr, ptr %9, align 8, !tbaa !9
  %103 = getelementptr inbounds %struct._MatNd, ptr %102, i32 0, i32 0
  %104 = load ptr, ptr %103, align 8, !tbaa !15
  %105 = getelementptr inbounds double, ptr %104, i64 0
  %106 = load double, ptr %105, align 8, !tbaa !11
  %107 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %100, ptr noundef @.str.303, double noundef %101, double noundef %106) #5
  %108 = load ptr, ptr @stderr, align 8, !tbaa !9
  %109 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %108, ptr noundef @.str.6) #5
  br label %110

110:                                              ; preds = %97, %94
  br label %111

111:                                              ; preds = %110
  br label %112

112:                                              ; preds = %111
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %113

113:                                              ; preds = %160, %112
  %114 = load i32, ptr %13, align 4, !tbaa !5
  %115 = load i32, ptr %6, align 4, !tbaa !5
  %116 = icmp slt i32 %114, %115
  br i1 %116, label %118, label %117

117:                                              ; preds = %113
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %163

118:                                              ; preds = %113
  %119 = load ptr, ptr %9, align 8, !tbaa !9
  %120 = load ptr, ptr %10, align 8, !tbaa !9
  %121 = call double @MatNd_lineSearchArmijo(ptr noundef %119, ptr noundef %120, ptr noundef @_ZL15lineSearch_costPdPv, ptr noundef null, ptr noundef %7)
  store double %121, ptr %12, align 8, !tbaa !11
  br label %122

122:                                              ; preds = %118
  %123 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !9
  %124 = icmp ne ptr %123, null
  br i1 %124, label %125, label %134

125:                                              ; preds = %122
  %126 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !9
  %127 = load double, ptr %12, align 8, !tbaa !11
  %128 = load ptr, ptr %9, align 8, !tbaa !9
  %129 = getelementptr inbounds %struct._MatNd, ptr %128, i32 0, i32 0
  %130 = load ptr, ptr %129, align 8, !tbaa !15
  %131 = getelementptr inbounds double, ptr %130, i64 0
  %132 = load double, ptr %131, align 8, !tbaa !11
  %133 = load double, ptr %7, align 8, !tbaa !11
  call void (i32, ptr, ptr, i32, ptr, ...) %126(i32 noundef 2, ptr noundef @.str.3, ptr noundef @__func__.testLinesearch, i32 noundef 3078, ptr noundef @.str.304, double noundef %127, double noundef %132, double noundef %133)
  br label %134

134:                                              ; preds = %125, %122
  %135 = load i32, ptr @RcsLogLevel, align 4, !tbaa !5
  %136 = icmp sle i32 2, %135
  br i1 %136, label %137, label %151

137:                                              ; preds = %134
  %138 = load ptr, ptr @stderr, align 8, !tbaa !9
  %139 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %138, ptr noundef @.str.5, ptr noundef @.str.3, ptr noundef @__func__.testLinesearch, i32 noundef 3078) #5
  %140 = load ptr, ptr @stderr, align 8, !tbaa !9
  %141 = load double, ptr %12, align 8, !tbaa !11
  %142 = load ptr, ptr %9, align 8, !tbaa !9
  %143 = getelementptr inbounds %struct._MatNd, ptr %142, i32 0, i32 0
  %144 = load ptr, ptr %143, align 8, !tbaa !15
  %145 = getelementptr inbounds double, ptr %144, i64 0
  %146 = load double, ptr %145, align 8, !tbaa !11
  %147 = load double, ptr %7, align 8, !tbaa !11
  %148 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %140, ptr noundef @.str.304, double noundef %141, double noundef %146, double noundef %147) #5
  %149 = load ptr, ptr @stderr, align 8, !tbaa !9
  %150 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %149, ptr noundef @.str.6) #5
  br label %151

151:                                              ; preds = %137, %134
  br label %152

152:                                              ; preds = %151
  br label %153

153:                                              ; preds = %152
  %154 = load ptr, ptr %10, align 8, !tbaa !9
  %155 = getelementptr inbounds %struct._MatNd, ptr %154, i32 0, i32 0
  %156 = load ptr, ptr %155, align 8, !tbaa !15
  %157 = load ptr, ptr %9, align 8, !tbaa !9
  %158 = getelementptr inbounds %struct._MatNd, ptr %157, i32 0, i32 0
  %159 = load ptr, ptr %158, align 8, !tbaa !15
  call void @_ZL15lineSearch_gradPdPKd(ptr noundef %156, ptr noundef %159)
  br label %160

160:                                              ; preds = %153
  %161 = load i32, ptr %13, align 4, !tbaa !5
  %162 = add nsw i32 %161, 1
  store i32 %162, ptr %13, align 4, !tbaa !5
  br label %113, !llvm.loop !17

163:                                              ; preds = %117
  %164 = load double, ptr %12, align 8, !tbaa !11
  %165 = load double, ptr %11, align 8, !tbaa !11
  %166 = fcmp ogt double %164, %165
  br i1 %166, label %167, label %190

167:                                              ; preds = %163
  br label %168

168:                                              ; preds = %167
  %169 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !9
  %170 = icmp ne ptr %169, null
  br i1 %170, label %171, label %175

171:                                              ; preds = %168
  %172 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !9
  %173 = load double, ptr %12, align 8, !tbaa !11
  %174 = load double, ptr %11, align 8, !tbaa !11
  call void (i32, ptr, ptr, i32, ptr, ...) %172(i32 noundef 1, ptr noundef @.str.18, ptr noundef @__func__.testLinesearch, i32 noundef 3085, ptr noundef @.str.305, double noundef %173, double noundef %174)
  br label %175

175:                                              ; preds = %171, %168
  %176 = load i32, ptr @RcsLogLevel, align 4, !tbaa !5
  %177 = icmp sle i32 1, %176
  br i1 %177, label %178, label %187

178:                                              ; preds = %175
  %179 = load ptr, ptr @stderr, align 8, !tbaa !9
  %180 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %179, ptr noundef @.str.22, ptr noundef @__func__.testLinesearch, i32 noundef 3085) #5
  %181 = load ptr, ptr @stderr, align 8, !tbaa !9
  %182 = load double, ptr %12, align 8, !tbaa !11
  %183 = load double, ptr %11, align 8, !tbaa !11
  %184 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %181, ptr noundef @.str.305, double noundef %182, double noundef %183) #5
  %185 = load ptr, ptr @stderr, align 8, !tbaa !9
  %186 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %185, ptr noundef @.str.6) #5
  br label %187

187:                                              ; preds = %178, %175
  br label %188

188:                                              ; preds = %187
  br label %189

189:                                              ; preds = %188
  store i8 0, ptr %8, align 1, !tbaa !13
  br label %213

190:                                              ; preds = %163
  br label %191

191:                                              ; preds = %190
  %192 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !9
  %193 = icmp ne ptr %192, null
  br i1 %193, label %194, label %198

194:                                              ; preds = %191
  %195 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !9
  %196 = load double, ptr %12, align 8, !tbaa !11
  %197 = load double, ptr %11, align 8, !tbaa !11
  call void (i32, ptr, ptr, i32, ptr, ...) %195(i32 noundef 2, ptr noundef @.str.3, ptr noundef @__func__.testLinesearch, i32 noundef 3091, ptr noundef @.str.306, double noundef %196, double noundef %197)
  br label %198

198:                                              ; preds = %194, %191
  %199 = load i32, ptr @RcsLogLevel, align 4, !tbaa !5
  %200 = icmp sle i32 2, %199
  br i1 %200, label %201, label %210

201:                                              ; preds = %198
  %202 = load ptr, ptr @stderr, align 8, !tbaa !9
  %203 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %202, ptr noundef @.str.5, ptr noundef @.str.3, ptr noundef @__func__.testLinesearch, i32 noundef 3091) #5
  %204 = load ptr, ptr @stderr, align 8, !tbaa !9
  %205 = load double, ptr %12, align 8, !tbaa !11
  %206 = load double, ptr %11, align 8, !tbaa !11
  %207 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %204, ptr noundef @.str.306, double noundef %205, double noundef %206) #5
  %208 = load ptr, ptr @stderr, align 8, !tbaa !9
  %209 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %208, ptr noundef @.str.6) #5
  br label %210

210:                                              ; preds = %201, %198
  br label %211

211:                                              ; preds = %210
  br label %212

212:                                              ; preds = %211
  br label %213

213:                                              ; preds = %212, %189
  %214 = load ptr, ptr %9, align 8, !tbaa !9
  call void @MatNd_destroy(ptr noundef %214)
  %215 = load ptr, ptr %10, align 8, !tbaa !9
  call void @MatNd_destroy(ptr noundef %215)
  br label %216

216:                                              ; preds = %213
  %217 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !9
  %218 = icmp ne ptr %217, null
  br i1 %218, label %219, label %230

219:                                              ; preds = %216
  %220 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !9
  %221 = load i8, ptr %8, align 1, !tbaa !13, !range !19, !noundef !20
  %222 = trunc i8 %221 to i1
  br i1 %222, label %223, label %224

223:                                              ; preds = %219
  br label %225

224:                                              ; preds = %219
  br label %225

225:                                              ; preds = %224, %223
  %226 = phi ptr [ @.str.20, %223 ], [ @.str.21, %224 ]
  %227 = getelementptr inbounds [8 x i8], ptr %226, i64 0, i64 0
  %228 = load double, ptr %12, align 8, !tbaa !11
  %229 = load double, ptr %11, align 8, !tbaa !11
  call void (i32, ptr, ptr, i32, ptr, ...) %220(i32 noundef 1, ptr noundef @.str.18, ptr noundef @__func__.testLinesearch, i32 noundef 3098, ptr noundef @.str.307, ptr noundef %227, double noundef %228, double noundef %229)
  br label %230

230:                                              ; preds = %225, %216
  %231 = load i32, ptr @RcsLogLevel, align 4, !tbaa !5
  %232 = icmp sle i32 1, %231
  br i1 %232, label %233, label %249

233:                                              ; preds = %230
  %234 = load ptr, ptr @stderr, align 8, !tbaa !9
  %235 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %234, ptr noundef @.str.22, ptr noundef @__func__.testLinesearch, i32 noundef 3098) #5
  %236 = load ptr, ptr @stderr, align 8, !tbaa !9
  %237 = load i8, ptr %8, align 1, !tbaa !13, !range !19, !noundef !20
  %238 = trunc i8 %237 to i1
  br i1 %238, label %239, label %240

239:                                              ; preds = %233
  br label %241

240:                                              ; preds = %233
  br label %241

241:                                              ; preds = %240, %239
  %242 = phi ptr [ @.str.20, %239 ], [ @.str.21, %240 ]
  %243 = getelementptr inbounds [8 x i8], ptr %242, i64 0, i64 0
  %244 = load double, ptr %12, align 8, !tbaa !11
  %245 = load double, ptr %11, align 8, !tbaa !11
  %246 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %236, ptr noundef @.str.307, ptr noundef %243, double noundef %244, double noundef %245) #5
  %247 = load ptr, ptr @stderr, align 8, !tbaa !9
  %248 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %247, ptr noundef @.str.6) #5
  br label %249

249:                                              ; preds = %241, %230
  br label %250

250:                                              ; preds = %249
  br label %251

251:                                              ; preds = %250
  %252 = load i8, ptr %8, align 1, !tbaa !13, !range !19, !noundef !20
  %253 = trunc i8 %252 to i1
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #5
  ret i1 %253
}

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef double @_ZL15lineSearch_costPdPv(ptr noundef, ptr noundef) #4

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZL15lineSearch_gradPdPKd(ptr noundef, ptr noundef) #4

declare double @MatNd_lineSearchArmijo(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { "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 = { 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 #4 = { mustprogress 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 #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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"bool", !7, i64 0}
!15 = !{!16, !10, i64 0}
!16 = !{!"_ZTS6_MatNd", !10, i64 0, !6, i64 8, !6, i64 12, !6, i64 16, !14, i64 20}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = !{i8 0, i8 2}
!20 = !{}


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

%"class.Rcs::CmdLineParser" = type { i8 }

@RCS_GLOBAL_RLOG_CB = external local_unnamed_addr global ptr, align 8
@.str.3 = external hidden unnamed_addr constant [74 x i8], align 1
@RcsLogLevel = external local_unnamed_addr global i32, align 4
@stderr = external local_unnamed_addr global ptr, align 8
@.str.5 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.64 = external hidden unnamed_addr constant [6 x i8], align 1
@__func__.testLinesearch = external hidden unnamed_addr constant [15 x i8], align 1
@.str.299 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.300 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.301 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.302 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.303 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.304 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.305 = external hidden unnamed_addr constant [47 x i8], align 1
@.str.306 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.307 = external hidden unnamed_addr constant [27 x i8], align 1

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

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

; Function Attrs: nofree nounwind
declare noundef i32 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #1

declare void @_ZN3Rcs13CmdLineParserC1EiPPc(ptr noundef nonnull align 1 dereferenceable(1), i32 noundef, ptr noundef) unnamed_addr #2

declare noundef zeroext i1 @_ZNK3Rcs13CmdLineParser11getArgumentEPKcPdS2_z(ptr noundef nonnull align 1 dereferenceable(1), ptr noundef, ptr noundef, ptr noundef, ...) local_unnamed_addr #2

declare ptr @MatNd_create(i32 noundef, i32 noundef) local_unnamed_addr #2

declare void @MatNd_setRandom(ptr noundef, double noundef, double noundef) local_unnamed_addr #2

declare void @MatNd_destroy(ptr noundef) local_unnamed_addr #2

declare noundef zeroext i1 @_ZNK3Rcs13CmdLineParser11getArgumentEPKcPiS2_z(ptr noundef nonnull align 1 dereferenceable(1), ptr noundef, ptr noundef, ptr noundef, ...) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @testLinesearch(i32 noundef %0, ptr noundef %1) local_unnamed_addr #3 {
  %3 = alloca %"class.Rcs::CmdLineParser", align 1
  %4 = alloca i32, align 4
  %5 = alloca double, align 8
  %6 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !5
  %.not = icmp eq ptr %6, null
  br i1 %.not, label %8, label %7

7:                                                ; preds = %2
  tail call void (i32, ptr, ptr, i32, ptr, ...) %6(i32 noundef 2, ptr noundef nonnull @.str.3, ptr noundef nonnull @__func__.testLinesearch, i32 noundef 3051, ptr noundef nonnull @.str.24)
  br label %8

8:                                                ; preds = %7, %2
  %9 = load i32, ptr @RcsLogLevel, align 4, !tbaa !9
  %10 = icmp sgt i32 %9, 1
  br i1 %10, label %11, label %18

11:                                               ; preds = %8
  %12 = load ptr, ptr @stderr, align 8, !tbaa !5
  %13 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %12, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.3, ptr noundef nonnull @__func__.testLinesearch, i32 noundef 3051) #5
  %14 = load ptr, ptr @stderr, align 8, !tbaa !5
  %15 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %14, ptr noundef nonnull @.str.24) #5
  %16 = load ptr, ptr @stderr, align 8, !tbaa !5
  %17 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %16, ptr noundef nonnull @.str.6) #5
  br label %18

18:                                               ; preds = %11, %8
  %19 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !5
  %.not51 = icmp eq ptr %19, null
  br i1 %.not51, label %21, label %20

20:                                               ; preds = %18
  tail call void (i32, ptr, ptr, i32, ptr, ...) %19(i32 noundef 2, ptr noundef nonnull @.str.3, ptr noundef nonnull @__func__.testLinesearch, i32 noundef 3052, ptr noundef nonnull @.str.299)
  br label %21

21:                                               ; preds = %20, %18
  %22 = load i32, ptr @RcsLogLevel, align 4, !tbaa !9
  %23 = icmp sgt i32 %22, 1
  br i1 %23, label %24, label %31

24:                                               ; preds = %21
  %25 = load ptr, ptr @stderr, align 8, !tbaa !5
  %26 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %25, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.3, ptr noundef nonnull @__func__.testLinesearch, i32 noundef 3052) #5
  %27 = load ptr, ptr @stderr, align 8, !tbaa !5
  %28 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %27, ptr noundef nonnull @.str.299) #5
  %29 = load ptr, ptr @stderr, align 8, !tbaa !5
  %30 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %29, ptr noundef nonnull @.str.6) #5
  br label %31

31:                                               ; preds = %24, %21
  %32 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !5
  %.not52 = icmp eq ptr %32, null
  br i1 %.not52, label %34, label %33

33:                                               ; preds = %31
  tail call void (i32, ptr, ptr, i32, ptr, ...) %32(i32 noundef 2, ptr noundef nonnull @.str.3, ptr noundef nonnull @__func__.testLinesearch, i32 noundef 3053, ptr noundef nonnull @.str.24)
  br label %34

34:                                               ; preds = %33, %31
  %35 = load i32, ptr @RcsLogLevel, align 4, !tbaa !9
  %36 = icmp sgt i32 %35, 1
  br i1 %36, label %37, label %44

37:                                               ; preds = %34
  %38 = load ptr, ptr @stderr, align 8, !tbaa !5
  %39 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %38, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.3, ptr noundef nonnull @__func__.testLinesearch, i32 noundef 3053) #5
  %40 = load ptr, ptr @stderr, align 8, !tbaa !5
  %41 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %40, ptr noundef nonnull @.str.24) #5
  %42 = load ptr, ptr @stderr, align 8, !tbaa !5
  %43 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %42, ptr noundef nonnull @.str.6) #5
  br label %44

44:                                               ; preds = %34, %37
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %3) #6
  call void @_ZN3Rcs13CmdLineParserC1EiPPc(ptr noundef nonnull align 1 dereferenceable(1) %3, i32 noundef %0, ptr noundef %1)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #6
  store i32 10, ptr %4, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  store double 9.000000e-01, ptr %5, align 8, !tbaa !11
  %45 = call noundef zeroext i1 (ptr, ptr, ptr, ptr, ...) @_ZNK3Rcs13CmdLineParser11getArgumentEPKcPiS2_z(ptr noundef nonnull align 1 dereferenceable(1) %3, ptr noundef nonnull @.str.64, ptr noundef nonnull %4, ptr noundef nonnull @.str.300)
  %46 = call noundef zeroext i1 (ptr, ptr, ptr, ptr, ...) @_ZNK3Rcs13CmdLineParser11getArgumentEPKcPdS2_z(ptr noundef nonnull align 1 dereferenceable(1) %3, ptr noundef nonnull @.str.301, ptr noundef nonnull %5, ptr noundef nonnull @.str.302)
  %47 = call ptr @MatNd_create(i32 noundef 1, i32 noundef 1)
  %48 = call ptr @MatNd_create(i32 noundef 1, i32 noundef 1)
  call void @MatNd_setRandom(ptr noundef %47, double noundef -1.000000e+00, double noundef 1.000000e+00)
  %49 = load ptr, ptr %47, align 8, !tbaa !13
  %50 = call noundef double @_ZL15lineSearch_costPdPv(ptr noundef %49, ptr noundef null)
  %51 = load ptr, ptr %48, align 8, !tbaa !13
  %52 = load ptr, ptr %47, align 8, !tbaa !13
  call void @_ZL15lineSearch_gradPdPKd(ptr noundef %51, ptr noundef %52)
  %53 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !5
  %.not53 = icmp eq ptr %53, null
  br i1 %.not53, label %57, label %54

54:                                               ; preds = %44
  %55 = load ptr, ptr %47, align 8, !tbaa !13
  %56 = load double, ptr %55, align 8, !tbaa !11
  call void (i32, ptr, ptr, i32, ptr, ...) %53(i32 noundef 2, ptr noundef nonnull @.str.3, ptr noundef nonnull @__func__.testLinesearch, i32 noundef 3070, ptr noundef nonnull @.str.303, double noundef %50, double noundef %56)
  br label %57

57:                                               ; preds = %54, %44
  %58 = load i32, ptr @RcsLogLevel, align 4, !tbaa !9
  %59 = icmp sgt i32 %58, 1
  br i1 %59, label %60, label %69

60:                                               ; preds = %57
  %61 = load ptr, ptr @stderr, align 8, !tbaa !5
  %62 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %61, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.3, ptr noundef nonnull @__func__.testLinesearch, i32 noundef 3070) #5
  %63 = load ptr, ptr @stderr, align 8, !tbaa !5
  %64 = load ptr, ptr %47, align 8, !tbaa !13
  %65 = load double, ptr %64, align 8, !tbaa !11
  %66 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %63, ptr noundef nonnull @.str.303, double noundef %50, double noundef %65) #5
  %67 = load ptr, ptr @stderr, align 8, !tbaa !5
  %68 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %67, ptr noundef nonnull @.str.6) #5
  br label %69

69:                                               ; preds = %60, %57
  %70 = load i32, ptr %4, align 4, !tbaa !9
  %71 = icmp sgt i32 %70, 0
  br i1 %71, label %.lr.ph, label %._crit_edge.thread

._crit_edge:                                      ; preds = %92
  %72 = fcmp ule double %73, %50
  br i1 %72, label %._crit_edge.thread, label %98

.lr.ph:                                           ; preds = %69, %92
  %.058 = phi i32 [ %95, %92 ], [ 0, %69 ]
  %73 = call double @MatNd_lineSearchArmijo(ptr noundef nonnull %47, ptr noundef nonnull %48, ptr noundef nonnull @_ZL15lineSearch_costPdPv, ptr noundef null, ptr noundef nonnull %5)
  %74 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !5
  %.not57 = icmp eq ptr %74, null
  br i1 %.not57, label %79, label %75

75:                                               ; preds = %.lr.ph
  %76 = load ptr, ptr %47, align 8, !tbaa !13
  %77 = load double, ptr %76, align 8, !tbaa !11
  %78 = load double, ptr %5, align 8, !tbaa !11
  call void (i32, ptr, ptr, i32, ptr, ...) %74(i32 noundef 2, ptr noundef nonnull @.str.3, ptr noundef nonnull @__func__.testLinesearch, i32 noundef 3078, ptr noundef nonnull @.str.304, double noundef %73, double noundef %77, double noundef %78)
  br label %79

79:                                               ; preds = %75, %.lr.ph
  %80 = load i32, ptr @RcsLogLevel, align 4, !tbaa !9
  %81 = icmp sgt i32 %80, 1
  br i1 %81, label %82, label %92

82:                                               ; preds = %79
  %83 = load ptr, ptr @stderr, align 8, !tbaa !5
  %84 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %83, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.3, ptr noundef nonnull @__func__.testLinesearch, i32 noundef 3078) #5
  %85 = load ptr, ptr @stderr, align 8, !tbaa !5
  %86 = load ptr, ptr %47, align 8, !tbaa !13
  %87 = load double, ptr %86, align 8, !tbaa !11
  %88 = load double, ptr %5, align 8, !tbaa !11
  %89 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %85, ptr noundef nonnull @.str.304, double noundef %73, double noundef %87, double noundef %88) #5
  %90 = load ptr, ptr @stderr, align 8, !tbaa !5
  %91 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %90, ptr noundef nonnull @.str.6) #5
  br label %92

92:                                               ; preds = %82, %79
  %93 = load ptr, ptr %48, align 8, !tbaa !13
  %94 = load ptr, ptr %47, align 8, !tbaa !13
  call void @_ZL15lineSearch_gradPdPKd(ptr noundef %93, ptr noundef %94)
  %95 = add nuw nsw i32 %.058, 1
  %96 = load i32, ptr %4, align 4, !tbaa !9
  %97 = icmp slt i32 %95, %96
  br i1 %97, label %.lr.ph, label %._crit_edge, !llvm.loop !16

98:                                               ; preds = %._crit_edge
  %99 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !5
  %.not55 = icmp eq ptr %99, null
  br i1 %.not55, label %101, label %100

100:                                              ; preds = %98
  call void (i32, ptr, ptr, i32, ptr, ...) %99(i32 noundef 1, ptr noundef nonnull @.str.18, ptr noundef nonnull @__func__.testLinesearch, i32 noundef 3085, ptr noundef nonnull @.str.305, double noundef %73, double noundef %50)
  br label %101

101:                                              ; preds = %100, %98
  %102 = load i32, ptr @RcsLogLevel, align 4, !tbaa !9
  %103 = icmp sgt i32 %102, 0
  br i1 %103, label %104, label %121

104:                                              ; preds = %101
  %105 = load ptr, ptr @stderr, align 8, !tbaa !5
  %106 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %105, ptr noundef nonnull @.str.22, ptr noundef nonnull @__func__.testLinesearch, i32 noundef 3085) #5
  %107 = load ptr, ptr @stderr, align 8, !tbaa !5
  %108 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %107, ptr noundef nonnull @.str.305, double noundef %73, double noundef %50) #5
  br label %.sink.split

._crit_edge.thread:                               ; preds = %69, %._crit_edge
  %.040.lcssa60 = phi double [ %73, %._crit_edge ], [ %50, %69 ]
  %109 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !5
  %.not54 = icmp eq ptr %109, null
  br i1 %.not54, label %111, label %110

110:                                              ; preds = %._crit_edge.thread
  call void (i32, ptr, ptr, i32, ptr, ...) %109(i32 noundef 2, ptr noundef nonnull @.str.3, ptr noundef nonnull @__func__.testLinesearch, i32 noundef 3091, ptr noundef nonnull @.str.306, double noundef %.040.lcssa60, double noundef %50)
  br label %111

111:                                              ; preds = %110, %._crit_edge.thread
  %112 = load i32, ptr @RcsLogLevel, align 4, !tbaa !9
  %113 = icmp sgt i32 %112, 1
  br i1 %113, label %114, label %121

114:                                              ; preds = %111
  %115 = load ptr, ptr @stderr, align 8, !tbaa !5
  %116 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %115, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.3, ptr noundef nonnull @__func__.testLinesearch, i32 noundef 3091) #5
  %117 = load ptr, ptr @stderr, align 8, !tbaa !5
  %118 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %117, ptr noundef nonnull @.str.306, double noundef %.040.lcssa60, double noundef %50) #5
  br label %.sink.split

.sink.split:                                      ; preds = %114, %104
  %.ph = phi i1 [ true, %114 ], [ false, %104 ]
  %.040.lcssa61.ph = phi double [ %.040.lcssa60, %114 ], [ %73, %104 ]
  %119 = load ptr, ptr @stderr, align 8, !tbaa !5
  %120 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %119, ptr noundef nonnull @.str.6) #5
  br label %121

121:                                              ; preds = %.sink.split, %101, %111
  %122 = phi i1 [ false, %101 ], [ true, %111 ], [ %.ph, %.sink.split ]
  %.040.lcssa61 = phi double [ %73, %101 ], [ %.040.lcssa60, %111 ], [ %.040.lcssa61.ph, %.sink.split ]
  call void @MatNd_destroy(ptr noundef nonnull %47)
  call void @MatNd_destroy(ptr noundef nonnull %48)
  %123 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !5
  %.not56 = icmp eq ptr %123, null
  br i1 %.not56, label %125, label %124

124:                                              ; preds = %121
  %.str.20..str.21 = select i1 %122, ptr @.str.20, ptr @.str.21
  call void (i32, ptr, ptr, i32, ptr, ...) %123(i32 noundef 1, ptr noundef nonnull @.str.18, ptr noundef nonnull @__func__.testLinesearch, i32 noundef 3098, ptr noundef nonnull @.str.307, ptr noundef nonnull %.str.20..str.21, double noundef %.040.lcssa61, double noundef %50)
  br label %125

125:                                              ; preds = %124, %121
  %126 = load i32, ptr @RcsLogLevel, align 4, !tbaa !9
  %127 = icmp sgt i32 %126, 0
  br i1 %127, label %128, label %135

128:                                              ; preds = %125
  %129 = load ptr, ptr @stderr, align 8, !tbaa !5
  %130 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %129, ptr noundef nonnull @.str.22, ptr noundef nonnull @__func__.testLinesearch, i32 noundef 3098) #5
  %131 = load ptr, ptr @stderr, align 8, !tbaa !5
  %.str.20..str.211 = select i1 %122, ptr @.str.20, ptr @.str.21
  %132 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %131, ptr noundef nonnull @.str.307, ptr noundef nonnull %.str.20..str.211, double noundef %.040.lcssa61, double noundef %50) #5
  %133 = load ptr, ptr @stderr, align 8, !tbaa !5
  %134 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %133, ptr noundef nonnull @.str.6) #5
  br label %135

135:                                              ; preds = %128, %125
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %3) #6
  ret i1 %122
}

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef double @_ZL15lineSearch_costPdPv(ptr noundef, ptr noundef) #4

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZL15lineSearch_gradPdPKd(ptr noundef, ptr noundef) local_unnamed_addr #4

declare double @MatNd_lineSearchArmijo(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nofree 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 #2 = { "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 = { 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 #4 = { mustprogress 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 #5 = { cold nounwind }
attributes #6 = { 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, !6, i64 0}
!14 = !{!"_ZTS6_MatNd", !6, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !15, i64 20}
!15 = !{!"bool", !7, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}


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